Index: lams_central/src/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as =================================================================== diff -u -rb509597773d43a584fd80b72e1e9c6282697f551 -r54f3e9e034d6077a903ba14e3b2fbdf035d9ac94 --- lams_central/src/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as (.../DesignDataModel.as) (revision b509597773d43a584fd80b72e1e9c6282697f551) +++ lams_central/src/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as (.../DesignDataModel.as) (revision 54f3e9e034d6077a903ba14e3b2fbdf035d9ac94) @@ -3,9 +3,19 @@ import org.lamsfoundation.lams.common.*; /* * +* DesignDataModel stores all the data relating to the design +* +* Note the hashtable of _activities might contain the following types: +* 1) ToolActivities +* 2) Grouping activities which reference a _groupings element +* 3) Parallel activities which reference 2 or more other _activitiy elements +* 4) Optional activities which reference 2 or more other _activitiy elements +* 5) Gate activities +* +* * @author DC * @version 0.1 -* @comments DesignDataModel stores a complete learning design +* */ class org.lamsfoundation.lams.authoring.DesignDataModel { @@ -23,42 +33,47 @@ private var _learningDesignID:Number; - private var _uiID:Number; private var _title:String; private var _description:String; private var _helpText:String; private var _version:String; - private var _userID:Number; - private var _workspaceFolderID:Number; - private var _createDateTime:Date; + private var _duration:Number; private var _readOnly:Boolean; private var _validDesign:Boolean; - private var _maxID:Number; - private var _firstID:Number; + private var _firstActivityID:Number; + private var _firstActivityUIID:Number; + private var _parentLearningDesignID:Number; private var _activities:Hashtable; private var _transitions:Hashtable; private var _groupings:Hashtable; - - + private var _licenseID:Number; + private var _licenseText:String; + private var _workspaceFolderID:Number; + private var _createDateTime:Date; + private var _lastModifiedDateTime:Date; + private var _dateReadOnly:Date; + + //Constructor function DesignDataModel(){ //initialise the hashtables _activities = new Hashtable("_activities"); _transitions = new Hashtable("_transitions"); //set the defualts: - _objectType = "LearningDesign"; _copyTypeID = COPY_TYPE_ID_AUTHORING; _version = "1.1_beta"; _readOnly = false; _validDesign = false; + _userID = Config.getInstance().userID; + } /** @@ -106,48 +121,14 @@ public function addTransition(transition:Transition):Boolean{ Debugger.log('Transition from:'+transition.fromUIID+', to:'+transition.toUIID,4,'addActivity','DesignDataModel'); - _transitions.put(transition.uiID,transition); + _transitions.put(transition.transitionUIID,transition); //TODO some validation would be nice return true; } /** - * Clears the current design in the DDM. - * @returns success - */ - public function clearDesign():Boolean{ - var success:Boolean = false; - - //TODO:Validate if design is saved if not notify user - success = true; - _objectType = null; - _learningDesignID = null; - _title = null; - _description = null; - _helpText = null; - _version = null; - - _userID = null; - _workspaceFolderID = null; - _createDateTime = null; - _readOnly = null; - _validDesign = null; - - _maxID = null; - _firstID = null; - - _activities = new Hashtable("_activities"); - _transitions = new Hashtable("_transitions"); - - success = true; - - Debugger.log('Cleared design:'+success,Debugger.GEN,'clearDesign','DesignDataModel'); - return success; - } - - /** * Sets a new design for the DDM. * @usage .setDesign(design:Object) * @param design @@ -174,19 +155,32 @@ _validDesign = design.valid_design_flag; _maxID = design.max_id; - _firstID = design.first_id; + _firstActivityID = design.first_id; //set the activities in the hash table for(var i=0; i 0){ design.activities = new Array(); @@ -408,12 +394,12 @@ _maxID = a; } - public function get firstID():Number{ - return _firstID; + public function get firstActivityID():Number{ + return _firstActivityID; } - public function set firstID(a:Number):Void{ - _firstID = a; + public function set firstActivityID(a:Number):Void{ + _firstActivityID = a; } public function get activities():Hashtable{ @@ -451,6 +437,131 @@ } + /** + * + * @usage + * @param newlastModifiedDateTime + * @return + */ + public function set lastModifiedDateTime (newlastModifiedDateTime:Date):Void { + _lastModifiedDateTime = newlastModifiedDateTime; + } + /** + * + * @usage + * @return + */ + public function get lastModifiedDateTime ():Date { + return _lastModifiedDateTime; + } + /** + * + * @usage + * @param newdateReadOnly + * @return + */ + public function set dateReadOnly (newdateReadOnly:Date):Void { + _dateReadOnly = newdateReadOnly; + } + /** + * + * @usage + * @return + */ + public function get dateReadOnly ():Date { + return _dateReadOnly; + } + /** + * + * @usage + * @param newduration + * @return + */ + public function set duration (newduration:Number):Void { + _duration = newduration; + } + /** + * + * @usage + * @return + */ + public function get duration ():Number { + return _duration; + } + + /** + * + * @usage + * @param newfirstActivityUIID + * @return + */ + public function set firstActivityUIID (newfirstActivityUIID:Number):Void { + _firstActivityUIID = newfirstActivityUIID; + } + /** + * + * @usage + * @return + */ + public function get firstActivityUIID ():Number { + return _firstActivityUIID; + } + + /** + * + * @usage + * @param newlicenseID + * @return + */ + public function set licenseID (newlicenseID:Number):Void { + _licenseID = newlicenseID; + } + /** + * + * @usage + * @return + */ + public function get licenseID ():Number { + return _licenseID; + } + + /** + * + * @usage + * @param newlicenseText + * @return + */ + public function set licenseText (newlicenseText:String):Void { + _licenseText = newlicenseText; + } + /** + * + * @usage + * @return + */ + public function get licenseText ():String { + return _licenseText; + } + + /** + * + * @usage + * @param newparentLearningDesignID + * @return + */ + public function set parentLearningDesignID (newparentLearningDesignID:Number):Void { + _parentLearningDesignID = newparentLearningDesignID; + } + /** + * + * @usage + * @return + */ + public function get parentLearningDesignID ():Number { + return _parentLearningDesignID; + } + + } \ No newline at end of file