Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -rbad0093158b1399f89d2acc555154b39835a5a70 -r470bd43cd17fa6128a767fec948850a5815c1c55 Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -r0e2d05a6e9532af4ebe25ee38f43b65da80889c8 -r470bd43cd17fa6128a767fec948850a5815c1c55 Binary files differ Index: lams_central/web/lams_preloader.swf =================================================================== diff -u -r650209a0e9e93262a3bcac01d9336ebf8c5631e9 -r470bd43cd17fa6128a767fec948850a5815c1c55 Binary files differ Index: lams_flash/src/central/flash/main.as =================================================================== diff -u -rde65d00b5bf887f55beabea327159f0df35f0933 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/main.as (.../main.as) (revision de65d00b5bf887f55beabea327159f0df35f0933) +++ lams_flash/src/central/flash/main.as (.../main.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -72,8 +72,16 @@ if(StringUtils.isEmpty(isMac)) { _root.isMac = false; -} +} +if(StringUtils.isEmpty(extlmsid)) { + _root.extlmsid = null; +} + +if(StringUtils.isEmpty(customCSV)) { + _root.customCSV = null; +} + //Set stage alignment to top left and prevent scaling Stage.align = "TL"; Stage.scaleMode = "noScale"; Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as =================================================================== diff -u -r27d85ee30520b52c79e0b44ca00a475bf57a1de2 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as (.../DesignDataModel.as) (revision 27d85ee30520b52c79e0b44ca00a475bf57a1de2) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/DesignDataModel.as (.../DesignDataModel.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -672,6 +672,7 @@ if(title) { data.lessonName = title; } if(description) { data.lessonDescription = description; } + if(_root.customCSV) { data.customCSV = _root.customCSV; } if(_learningDesignID) { data.learningDesignID = _learningDesignID; } data.organisationID = Config.NUMERIC_NULL_VALUE; Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as =================================================================== diff -u -r5b44cd0646c0ee06e57059948a5d5f730040f431 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as (.../ToolActivity.as) (revision 5b44cd0646c0ee06e57059948a5d5f730040f431) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as (.../ToolActivity.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -46,6 +46,8 @@ private var _toolContentID:Number; private var _toolID:Number; + private var _extLmsId:String; //external LMS id for tool adapter tools + //flags to tell UI which to disable private var _supportsContribute:Boolean; private var _supportsDefineLater:Boolean; @@ -135,6 +137,9 @@ if(StringUtils.isWDDXNull(dto.toolID)) { _toolID = null } else { _toolID = dto.toolID; } + if(StringUtils.isWDDXNull(dto.extLmsId)) { _extLmsId = null } + else { _extLmsId = dto.extLmsId; } + _supportsContribute = dto.supportsContribute; _supportsDefineLater = dto.supportsDefineLater; _supportsModeration = dto.supportsRunOffline @@ -156,6 +161,7 @@ dto.toolContentID = (_toolContentID) ? _toolContentID: Config.NUMERIC_NULL_VALUE; dto.toolID = (_toolID) ? _toolID: Config.NUMERIC_NULL_VALUE; + dto.extLmsId = (_extLmsId) ? _extLmsId : Config.STRING_NULL_VALUE; /* THESE are internal flags, not part of the design dto.supportsContribute = (_supportsContribute!=null) ? _supportsContribute: Config.BOOLEAN_NULL_VALUE; dto.supportsDefineLater = (_supportsDefineLater!=null) ? _supportsDefineLater: Config.BOOLEAN_NULL_VALUE; @@ -210,6 +216,7 @@ n.supportsDefineLater = _supportsDefineLater; n.supportsModeration = _supportsRunOffline; n.supportsOutputs = _supportsOutputs; + n.extLmsId = _extLmsId; return n; @@ -320,7 +327,7 @@ return _toolID; } - /** + /** * * @usage * @param newsupportsContribute @@ -464,6 +471,23 @@ public function get helpURL ():String { return _helpURL; } - + + /** + * + * @usage + * @param str + * @return + */ + public function set extLmsId (str:String):Void { + _extLmsId = str; + } + /** + * + * @usage + * @return + */ + public function get extLmsId ():String { + return _extLmsId; + } } Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/Canvas.as =================================================================== diff -u -r5b44cd0646c0ee06e57059948a5d5f730040f431 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/Canvas.as (.../Canvas.as) (revision 5b44cd0646c0ee06e57059948a5d5f730040f431) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/Canvas.as (.../Canvas.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -524,7 +524,7 @@ var ws = Application.getInstance().getWorkspace(); ws.userSelectItem(callback, mode); } - + /** * Request design from server using supplied ID. * @usage @@ -547,8 +547,12 @@ var callback:Function = Proxy.create(this,setDesign); Application.getInstance().getComms().getRequest('authoring/author.do?method=getLearningDesignDetails&learningDesignID='+designId,callback, false); } else { - var dataToSend:Object = getInsertPacket(workspaceResultDTO, false); // for now only using Case 1 Insert Learning Design Servlet See Authoring Flash To Java Communications + var dataToSend:Object = getInsertPacket(workspaceResultDTO, false); // for now only using Case 1 Insert Learning Design Servlet See Authoring Flash To Java Communications var callback:Function = Proxy.create(this, onInsertDesignResponse); + + if (_root.customCSV != null) { + dataToSend.customCSV = _root.customCSV; + } Application.getInstance().getComms().sendAndReceive(dataToSend,"servlet/authoring/insertLearningDesign", callback, false); } @@ -582,7 +586,7 @@ * Request imported design from server * * @usage -b * @param learningDesignID + * @param learningDesignID * @return */ @@ -864,7 +868,8 @@ public function doImportLaunch():Void{ var serverUrl = Config.getInstance().serverUrl; - JsPopup.getInstance().launchPopupWindow(serverUrl+'authoring/importToolContent.do?method=import', 'Import', 298, 800, true, true, false, false, false); + var importActionUrl:String = appendCustomCSVIfExists(serverUrl+'authoring/importToolContent.do?method=import'); + JsPopup.getInstance().launchPopupWindow(importActionUrl, 'Import', 298, 800, true, true, false, false, false); } /** Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasHelper.as =================================================================== diff -u -r5b44cd0646c0ee06e57059948a5d5f730040f431 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasHelper.as (.../CanvasHelper.as) (revision 5b44cd0646c0ee06e57059948a5d5f730040f431) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasHelper.as (.../CanvasHelper.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -485,12 +485,14 @@ public function setPastedItem(o:Object){ if(o.data instanceof CanvasActivity && o.data.activity.activityCategoryID != Activity.CATEGORY_SYSTEM){ Debugger.log('instance is CA',Debugger.GEN,'setPastedItem','Canvas'); - var callback:Function = Proxy.create(this, setNewContentID, o); - Application.getInstance().getComms().getRequest('authoring/author.do?method=copyToolContent&toolContentID='+o.data.activity.toolContentID+'&userID='+_root.userID,callback, false); + var callback:Function = Proxy.create(this, setNewContentID, o); + var copyActivityURL:String = appendCustomCSVIfExists('authoring/author.do?method=copyToolContent&toolContentID='+o.data.activity.toolContentID+'&userID='+_root.userID); + Application.getInstance().getComms().getRequest(copyActivityURL,callback, false); } else if(o.data instanceof ToolActivity){ Debugger.log('instance is Tool',Debugger.GEN,'setPastedItem','Canvas'); - var callback:Function = Proxy.create(this, setNewContentID, o); - Application.getInstance().getComms().getRequest('authoring/author.do?method=copyToolContent&toolContentID='+o.toolContentID+'&userID='+_root.userID,callback, false); + var callback:Function = Proxy.create(this, setNewContentID, o); + var copyActivityURL:String = appendCustomCSVIfExists('authoring/author.do?method=copyToolContent&toolContentID='+o.toolContentID+'&userID='+_root.userID); + Application.getInstance().getComms().getRequest(copyActivityURL,callback, false); } else if(o.data instanceof CanvasOptionalActivity || o.data instanceof CanvasParallelActivity || (o.data instanceof CanvasActivity && o.data.activity.isBranchingActivity())){ Debugger.log('instance is Complex', Debugger.GEN,'setPastedItem','Canvas'); var callback:Function = Proxy.create(this, setNewContents, o); @@ -502,6 +504,26 @@ } /** + * Appends the customCSV parameter passed from the external machine if it was passed + * This is required for tool adapter tools, so the learning design details returns the + * correct values + * + * @usage + * @param URL + * @return + */ + + public function appendCustomCSVIfExists(URL:String):String + { + var tempURL:String = new String(URL); + if (_root.customCSV != null) + { + tempURL = tempURL + "&customCSV=" + escape(_root.customCSV); + } + return tempURL; + } + + /** * Array of tool content IDs within the complex activity. * * @param ca Canvas object @@ -514,6 +536,10 @@ o.toolContentIDs = getAllToolContentIDs(ca.activity.activityUIID); Debugger.log('toolContentIDs: ' + o.toolContentIDs,Debugger.CRITICAL,'getToolContentArray','CanvasHelper'); + if (_root.customCSV != null) { + o.customCSV = _root.customCSV; + } + return o; } Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasModel.as =================================================================== diff -u -r32e74a06368ce184623336939382aa9fc6e8a7aa -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasModel.as (.../CanvasModel.as) (revision 32e74a06368ce184623336939382aa9fc6e8a7aa) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cv/CanvasModel.as (.../CanvasModel.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -1042,7 +1042,13 @@ }else{ url = cfg.serverUrl+ta.authoringURL + '?toolContentID='+ta.toolContentID+'&contentFolderID='+ddm.contentFolderID; } - + + // append customCSV if this is a tooladapter tool + if (ta.extLmsId != null && ta.extLmsId != undefined && _root.customCSV != null && _root.customCSV != undefined) + { + url = url + "&customCSV=" + escape(_root.customCSV); + } + // TODO: Maybe add learningDesignID and serverURL to window title to handle multiple LAMS(s) running in same browser session. JsPopup.getInstance().launchPopupWindow(url, 'ToolActivityContent_' + ta.toolContentID, 600, 800, true, true, false, false, false); Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/Toolkit.as =================================================================== diff -u -ra9608549c199d2aae45ee7729e4536f6545afe94 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/Toolkit.as (.../Toolkit.as) (revision a9608549c199d2aae45ee7729e4536f6545afe94) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/Toolkit.as (.../Toolkit.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -107,7 +107,7 @@ */ public function setToolkitLibraries(toolkits:Array):Void{ - Debugger.log('Recieved toolkits array length:'+toolkits.length,4,'setToolkitActivities','Toolkit'); + Debugger.log('Recieved toolkits array length:'+toolkits.length,4,'setToolkitLibraries','Toolkit'); //TODO: Validate if correct data? //go throught the recieved toolkits and make ToolActivities from them: for(var i=0; i< toolkits.length; i++){ @@ -125,7 +125,7 @@ //TODO - prune out non conforming activityTypeIDs //switch constructors based on the activityTypeID. - Debugger.log("in toolkit:"+toolkit.learningLibraryID+" Checking ACTIVITY_TYPE:"+ta.activityTypeID,4,'setToolkitActivities','Toolkit'); + Debugger.log("in toolkit:"+toolkit.learningLibraryID+" Checking ACTIVITY_TYPE:"+ta.activityTypeID,4,'setToolkitLibraries','Toolkit'); switch(ta.activityTypeID){ case Activity.TOOL_ACTIVITY_TYPE: var toolAct:ToolActivity = new ToolActivity(null); Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/ToolkitView.as =================================================================== diff -u -ra9608549c199d2aae45ee7729e4536f6545afe94 -r470bd43cd17fa6128a767fec948850a5815c1c55 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/ToolkitView.as (.../ToolkitView.as) (revision a9608549c199d2aae45ee7729e4536f6545afe94) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/tk/ToolkitView.as (.../ToolkitView.as) (revision 470bd43cd17fa6128a767fec948850a5815c1c55) @@ -264,6 +264,22 @@ //NOW we pass in the whole array, as complex activities are supprted in this way var activities:Array = learningLib.classInstanceRefs; //Debugger.log('toolActivity '+ta.title+'('+ta.activityID+')',4,'updateLibraries','ToolkitView'); + + // First condition true if is a native lams tool + var toolAct = ToolActivity(activities[0]); + if (toolAct.extLmsId == null || toolAct.extLmsId == undefined) { + Debugger.log('ToolActivity->Native tool: ' + toolAct.title, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + } + // Second condition true if it is an external tool adapter tool + else if (_root.extlmsid != undefined && _root.extlmsid !=null && _root.extlmsid == toolAct.extLmsId){ + Debugger.log('ToolActivity->External tool, external request: ' + toolAct.title, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + } + // Else is a tool adapter tool, but the call was not from external server, therefore disable + else{ + continue; + Debugger.log('ToolActivity->Externale tool, internal request: ' + toolAct.title, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + } + var templateActivity_mc = toolkitLibraries_sp.content.attachMovie("TemplateActivity","ta_"+learningLib.learningLibraryID,_depth++,{_activities:activities,_toolkitView:tkv, yPos:yPos}); //position it Index: lams_flash/src/central/flash/preloader.fla =================================================================== diff -u -r650209a0e9e93262a3bcac01d9336ebf8c5631e9 -r470bd43cd17fa6128a767fec948850a5815c1c55 Binary files differ