Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -rac91d998f1c39e6163cf8e581d9fc58a863b0125 -ra14258831fcc72b00a6ff5c93654133a620bdc4c Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -rac91d998f1c39e6163cf8e581d9fc58a863b0125 -ra14258831fcc72b00a6ff5c93654133a620bdc4c Binary files differ Index: lams_common/src/flash/org/lamsfoundation/lams/common/comms/Communication.as =================================================================== diff -u -r696c0f8499e5090ff6832e9214aa2f9c2bdf0b39 -ra14258831fcc72b00a6ff5c93654133a620bdc4c --- lams_common/src/flash/org/lamsfoundation/lams/common/comms/Communication.as (.../Communication.as) (revision 696c0f8499e5090ff6832e9214aa2f9c2bdf0b39) +++ lams_common/src/flash/org/lamsfoundation/lams/common/comms/Communication.as (.../Communication.as) (revision a14258831fcc72b00a6ff5c93654133a620bdc4c) @@ -207,20 +207,15 @@ //user friendly error var e = new LFError(responseObj.messageValue,"onServerResponse",this); dispatchToHandlerByID(queueID,e); - //var somemsg =" this is just a test so please ignore as i am testing the max number of" + var sendMsg:String = Dictionary.getValue('sys_error_msg_start')+"\n\n"+Dictionary.getValue('sys_error_msg_finish')+"\n\n\n"; - //LFMessage.showMessageAlert(responseObj.messageValue, null, null); + LFError.showSendErrorRequest(sendMsg, 'sys_error', Debugger.crashDataDump, null); - //TODO: Make sure that things that have requested server responses can handle an error object - //showAlert("Oops", responseObj.body, "sad"); + }else if(responseObj.messageType == SYSTEM_ERROR_CODE){ - //var somemsg =" this is just a test so please ignore as i am testing the max number of character possible to show in the alert window. Hope I will be able to get success if this task." - //var sendMsg:String = Dictionary.getValue('sys_error_msg_start')+"/n"+somemsg+"/n"+Dictionary.getValue('sys_error_msg_finish'); var sendMsg:String = Dictionary.getValue('sys_error_msg_start')+"\n\n"+Dictionary.getValue('sys_error_msg_finish'); - //LFMessage.showMessageAlert(responseObj.messageValue, null, null); LFError.showSendErrorRequest(sendMsg, 'sys_error', Debugger.crashDataDump, null); - //showAlert("System error", "

Sorry there has been a system error, please try the operation again. If the problem persistes please contact support

Additional information:"+responseObj.body+"

", "sad"); - }else{ + }else{ //Everything is fine so lookup callback handler on queue if(responseObj.messageValue != null){ dispatchToHandlerByID(queueID,responseObj.messageValue); @@ -232,9 +227,7 @@ //Now delete the XML delete wrappedPacketXML; }else { - //TODO DI 12/04/05 Handle onLoad error - //showAlert("System error", "

Communication Error

", "sad"); - Debugger.log("XML Load failed",Debugger.CRITICAL,'onServerResponse','Communication'); + Debugger.log("XML Load failed",Debugger.CRITICAL,'onServerResponse','Communication'); var e = new LFError("Communication with the server has failed. \nPlease check you are connected to the internet and/or LAMS server","onServerResponse",this,'Server URL:'+_serverURL); e.showMessageConfirm(); Index: lams_common/src/flash/org/lamsfoundation/lams/common/ws/Workspace.as =================================================================== diff -u -re3aef7ebcf8ea4fcf581d5f5588b17001c3b8482 -ra14258831fcc72b00a6ff5c93654133a620bdc4c --- lams_common/src/flash/org/lamsfoundation/lams/common/ws/Workspace.as (.../Workspace.as) (revision e3aef7ebcf8ea4fcf581d5f5588b17001c3b8482) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ws/Workspace.as (.../Workspace.as) (revision a14258831fcc72b00a6ff5c93654133a620bdc4c) @@ -154,8 +154,8 @@ public function generalWorkspaceOperationResponseHandler(dto:Object){ if(dto instanceof LFError){ dto.showErrorAlert(); - } + //make a copy as the function deletes it after its finished. var toRefresh = workspaceModel.folderIDPendingRefresh; Debugger.log('reponse ID:'+dto,Debugger.GEN,'generalWorkspaceOperationResponseHandler','Workspace'); Index: lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as =================================================================== diff -u -r59a2049ea4b5eaf795be9795ac349f02c52ab5d0 -ra14258831fcc72b00a6ff5c93654133a620bdc4c --- lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as (.../WorkspaceController.as) (revision 59a2049ea4b5eaf795be9795ac349f02c52ab5d0) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as (.../WorkspaceController.as) (revision a14258831fcc72b00a6ff5c93654133a620bdc4c) @@ -315,9 +315,11 @@ } }else if(tgt.indexOf("delete_btn") != -1){ - //find out the selected folderID: - //get the selected node: + + if(isUserPrivateFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; } + var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data; + if(snodeData != null){ //TODO Check permission code to make sure we can do this! //check if we can write to this folder @@ -334,7 +336,8 @@ } }else if(tgt.indexOf("new_btn") != -1){ //check we can create a folder here - var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data; + var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data; + if(snodeData != null){ @@ -352,7 +355,11 @@ //_workspaceModel.getWorkspace().requestCreateFolder(); }else if(tgt.indexOf("rename_btn") != -1){ - //check we can create a folder here + //check we can rename a folder here + + if(isUserPrivateFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; } + + var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data; if(snodeData != null){ //check if we can write to this folder @@ -409,6 +416,21 @@ _workspaceModel.folderIDPendingRefresh = selectedFolderID; //TODO: Validate is allowed name _workspaceModel.getWorkspace().requestNewFolder(selectedFolderID,newName); + } + + /** + * Determine if node is representing the user's private folder + * + * @param snode Node to check + * @return + */ + + private function isUserPrivateFolder(snode:XMLNode) { + if(_workspaceModel.getWorkspaceResource(_workspaceModel.RT_FOLDER + "_" + WorkspaceModel.ROOT_VFOLDER).firstChild == snode) { + return true; + } else { + return false; + } } public function setBusy(){