+ * _resultDTO.selectedResourceID //The ID of the resource that was selected when the dialogue closed
+ * _resultDTO.resourceName //The contents of the Name text field
+ * _resultDTO.resourceDescription //The contents of the description field on the propertirs tab
+ * _resultDTO.resourceLicenseText //The contents of the license text field
+ * _resultDTO.resourceLicenseID //The ID of the selected license from the drop down.
+ *
+ * And then saves the design to the sever by posting XML via comms class
+ * @usage
+ * @return
+ */
+ public function saveDesignToServer(workspaceResultDTO:Object):Boolean{
+ _global.breakpoint();
+ //TODO: Set the results from wsp into design.
+ if(workspaceResultDTO != null){
+ if(workspaceResultDTO.selectedResourceID != null){
+ //must be overwriting an existing design as we have a new resourceID
+ _ddm.learningDesignID = workspaceResultDTO.selectedResourceID;
+ }
+ _ddm.workspaceFolderID = workspaceResultDTO.targetWorkspaceFolderID;
+ _ddm.title = workspaceResultDTO.resourceName;
+ _ddm.description = workspaceResultDTO.resourceDescription;
+ _ddm.licenseText = workspaceResultDTO.resourceLicenseText;
+ _ddm.licenseID = workspaceResultDTO.resourceLicenseID;
+ }
+
+ var dto:Object = _ddm.getDesignForSaving();
+
+ var callback:Function = Proxy.create(this,onStoreDesignResponse);
+
+ Application.getInstance().getComms().sendAndReceive(dto,"authoring/storeLearningDesignDetails",callback,false);
+ //Application.getInstance().getComms().sendAndReceive(dto,"http://dolly.uklams.net:8080/lams/authoring/authorServlet",onStoreDesignResponse,true);
+ //Application.getInstance().getComms().sendAndReceive(dto,"http://geo.uklams.net/testing/printPost.php",onStoreDesignResponse,true);
+
+ return true;
+ //public function sendAndReceive(dto:Object, requestURL:String,handler:Function,isFullURL){
+ }
+
+ public function onStoreDesignResponse(r):Void{
+ //Debugger.log('Response:'+ObjectUtils.printObject(response),Debugger.GEN,'onStoreDesignResponse','Canvas');
+ if(r instanceof LFError){
+ r.showErrorAlert();
+ }else{
+ //_global.breakpoint();
+ //TODO:
+ //Debugger.log('_ddm.learningDesignID:'+_ddm.learningDesignID,Debugger.GEN,'setDroppedTemplateActivity','Canvas');
+ _ddm.learningDesignID = r;
+ Debugger.log('_ddm.learningDesignID:'+_ddm.learningDesignID,Debugger.GEN,'onStoreDesignResponse','Canvas');
+
+
+ var msg:String = "Your design has been saved with ID:"+r;
+ LFMessage.showMessageAlert(msg);
+
+ }
+ }
+
+ /**
+ * Called when a template activity is dropped onto the canvas
+ * @usage
+ * @param ta TemplateActivity
+ * @return
+ */
+ public function setDroppedTemplateActivity(ta:TemplateActivity):Void{
+
+ var actToCopy:Activity = ta.mainActivity;
+ //loosly typed this var as it might be any type of activity
+ var actToAdd:Activity;
+
+ Debugger.log('actToCopy.activityTypeID:'+actToCopy.activityTypeID,Debugger.GEN,'setDroppedTemplateActivity','Canvas');
+ //_global.breakpoint();
+ switch(actToCopy.activityTypeID){
+
+ case(Activity.TOOL_ACTIVITY_TYPE):
+ actToAdd = ToolActivity(actToCopy.clone());
+ //give it a new UIID:
+ actToAdd.activityUIID = _ddm.newUIID();
+ break;
+ //case(Activity.OPTIONS_ACTIVITY_TYPE):
+ case(Activity.PARALLEL_ACTIVITY_TYPE):
+
+ actToAdd = Activity(actToCopy.clone());
+
+ //give it a new UIID:
+ actToAdd.activityUIID = _ddm.newUIID();
+
+
+ Debugger.log('parallel activity given new UIID of:'+actToAdd.activityUIID ,Debugger.GEN,'setDroppedTemplateActivity','Canvas');
+ //now get this acts children and add them to the design (WHINEY VOICE:"will somebody pleeeease think of the children.....")
+ for(var i=0;i"+c.getTemplateActivityData().title+"
"+c.getTemplateActivityData().description+"
"; + libraryActivityDesc_txa.text = ""+c.toolActivity.title+"
"+c.toolActivity.description+"
"; //set up the drag initDrag(c); @@ -256,12 +258,12 @@ //dragIcon_mc = _root.createObjectAtDepth("dummy_mc",DepthManager.kCursor); //dragIcon_mc = Application.root.createObjectAtDepth("dummy_mc",DepthManager.kCursor); - Debugger.log('dragIcon_mc:'+dragIcon_mc,4,'initDrag','TemplateActivity'); + //Debugger.log('dragIcon_mc:'+dragIcon_mc,4,'initDrag','ToolkitView'); //TODO: Here we need to load the right icon. - //var icon_url = selectedTA.getTemplateActivityData().library_activity_ui_image - dragIcon_mcl.loadClip("http://dolly.uklams.net/lams/lams_central/icons/icon_chat.swf",dragIcon_mc); - //dragIcon_mc = _global.myRoot.duplicateMovieClip('dragIcon_mc',DepthManager.kTopmost); + dragIcon_mcl.loadClip(Config.getInstance().serverUrl+selectedTA.toolActivity.libraryActivityUIImage,dragIcon_mc); + //dragIcon_mc = _global.myRoot.duplicateMovieClip('dragIcon_mc',DepthManager.kTopmost); + //Debugger.log('dragIcon_mc:'+dragIcon_mc,4,'initDrag','ToolkitView'); } /* @@ -277,8 +279,8 @@ */ private function setUpDrag(aDragIcon_mc):Void{ - Debugger.log('aDragIcon_mc:'+aDragIcon_mc,4,'setUpDrag','TemplateActivity'); - Debugger.log('this:'+this,4,'setUpDrag','TemplateActivity'); + //Debugger.log('aDragIcon_mc:'+aDragIcon_mc,4,'setUpDrag','TemplateActivity'); + //Debugger.log('this:'+this,4,'setUpDrag','TemplateActivity'); dragIcon_mc = aDragIcon_mc; _dragging = true;