Index: lams_central/web/lams_authoring.swf =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring.swf,v diff -u -r1.526.2.22 -r1.526.2.23 Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring_library.swf,v diff -u -r1.426.2.22 -r1.426.2.23 Binary files differ Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as =================================================================== RCS file: /usr/local/cvsroot/lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as,v diff -u -r1.13.2.2 -r1.13.2.3 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as 8 May 2009 05:54:36 -0000 1.13.2.2 +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolActivity.as 3 Jun 2009 06:21:31 -0000 1.13.2.3 @@ -48,6 +48,8 @@ private var _extLmsId:String; //external LMS id for tool adapter tools + private var _mappedServers:Array; // list of possible servers + //flags to tell UI which to disable private var _supportsContribute:Boolean; private var _supportsDefineLater:Boolean; @@ -158,6 +160,13 @@ _gradebookToolOutputDefinitionName = _activityEvaluations[0]; } } + + if(!StringUtils.isWDDXNull(dto.mappedServers)) { + _mappedServers = new Array(); + for (var i=0; iNative 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 if (_root.extlmsid != undefined && _root.extlmsid != null) { + var mappedServers:Array = toolAct.mappedServers; + var found:Boolean = false; + + Debugger.log('FOR LUKE mappedServers length ' + mappedServers.length, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + + for (var j = 0; j < mappedServers.length; j++) { + Debugger.log('FOR LUKE mappedServers entry ' + mappedServers[j], Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + if (String(mappedServers[j]) == _root.extlmsid) { + found = true; + } + } + + // If the extlmsid is not matched against one of the mapped servers, the tool is invalid + if (!found) { + Debugger.log('ToolActivity->External tool, internal request: ' + toolAct.title, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); + continue; + } + // Else the extlmsid is matched against one of the mapped servers, the tool is valid + else { + 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{ + else { + Debugger.log('ToolActivity->External tool, internal request: ' + toolAct.title, Debugger.CRITICAL, 'updateLibraries', 'ToolView'); 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}); @@ -285,10 +305,10 @@ yPos += templateActivity_mc._height; - } + } _toolkitLoaded = true; - - //toolkitLibraries_sp.refreshPane(); + + //toolkitLibraries_sp.refreshPane(); } @@ -313,15 +333,15 @@ public function hideToolTip():Void{ _tip.CloseToolTip(); - } - + } + /** *The currently selected Template Activity * * @param o The model object that is broadcasting an update. - */ + */ private function updateSelectedTemplateActivity(o:Observable):Void{ - //_global.breakpoint(); + //_global.breakpoint(); //gett the model var tkm = ToolkitModel(o); //set the states of TKActs @@ -443,7 +463,7 @@ */ public function getModel():ToolkitModel{ return ToolkitModel(model); - } + } /** * Returns the default controller for this view (ToolkitController). * Overrides AbstractView.defaultController()