Index: lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as =================================================================== diff -u -ra0225170da7933a9a3512c86966cb1feea19acba -r2501a361c240d19d51f71b97bdf71e46c4e1417b --- lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as (.../WorkspaceController.as) (revision a0225170da7933a9a3512c86966cb1feea19acba) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as (.../WorkspaceController.as) (revision 2501a361c240d19d51f71b97bdf71e46c4e1417b) @@ -20,7 +20,8 @@ * http://www.gnu.org/licenses/gpl.txt * ************************************************************************ */ - + +import org.lamsfoundation.lams.authoring.Application; import org.lamsfoundation.lams.common.ws.* import org.lamsfoundation.lams.common.mvc.* import org.lamsfoundation.lams.common.util.* @@ -74,9 +75,17 @@ //note this function registeres the dialog to recieve view updates evt.target.scrollContent.setUpContent(); //populate the licenses drop down - _workspaceModel.populateLicenseDetails(); + _workspaceModel.populateLicenseDetails(); + //select the right tab, dont pass anything to show the default tab - _workspaceModel.showTab(_workspaceModel.currentTab); + _workspaceModel.showTab(_workspaceModel.currentTab); + + // show details of current saved LD - Authoring only + if(_workspaceModel.currentMode == 'SAVEAS'){ + _workspaceModel.currentOpenNode = Application.getInstance().getCanvas().ddm.getDesignForWorkspace(); + trace('current open node (ltext): ' + _workspaceModel.currentOpenNode); + _workspaceModel.showCurrentDetails(_workspaceModel.currentOpenNode); + } }else { //TODO DI 25/05/05 raise wrong event type error } Index: lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as =================================================================== diff -u -rb7d80ff3b520faceebd9da2b1590b813ea2a9f92 -r2501a361c240d19d51f71b97bdf71e46c4e1417b --- lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as (.../WorkspaceDialog.as) (revision b7d80ff3b520faceebd9da2b1590b813ea2a9f92) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as (.../WorkspaceDialog.as) (revision 2501a361c240d19d51f71b97bdf71e46c4e1417b) @@ -221,6 +221,7 @@ setUpTreeview(); itemSelected(treeview.selectedNode); + } /** @@ -239,6 +240,7 @@ switch (event.updateType){ case 'POPULATE_LICENSE_DETAILS' : populateAvailableLicenses(event.data, wm); + break; case 'REFRESH_TREE' : refreshTree(wm); break; @@ -261,6 +263,9 @@ case 'SHOW_TAB' : showTab(event.data,wm); break; + case 'UPDATED_PROP_DETAILS' : + populatePropDetails(event.data, wm); + break; case 'SET_UP_BRANCHES_INIT' : setUpBranchesInit(); break; @@ -361,15 +366,29 @@ private function itemSelected(newSelectedNode:XMLNode,wm:WorkspaceModel){ //update the UI with the new info: //_global.breakpoint(); + //Only update the details if the node if its a resource:a var nodeData = newSelectedNode.attributes.data; + if(nodeData.resourceType == _workspaceModel.RT_FOLDER){ + resourceTitle_txi.text = ""; - resourceDesc_txa.text = ""; - + + if(wm.currentMode != 'SAVEAS'){ + resourceDesc_txa.text = ""; + license_txa.text = ""; + licenseID_cmb.selectedIndex = 0; + } + }else{ + resourceTitle_txi.text = nodeData.name; - resourceDesc_txa.text = nodeData.description; + if(StringUtils.isNull(nodeData.description)){ + resourceDesc_txa.text = ""; + } else { + resourceDesc_txa.text = nodeData.description; + } + Debugger.log('nodeData.licenseID:'+nodeData.licenseID,Debugger.GEN,'itemSelected','org.lamsfoundation.lams.ws.WorkspaceDialog'); //find the SI of the license we need: //check if a license ID has been selected: @@ -379,20 +398,50 @@ licenseID_cmb.selectedIndex = i; } } - license_txa.text = nodeData.licenseText; + onLicenseComboSelect(); + }else{ licenseID_cmb.selectedIndex = 0; } + if(StringUtils.isNull(nodeData.licenseText)){ + license_txa.text = ""; + } else { + license_txa.text = nodeData.licenseText; + } + + } + + } + + private function populatePropDetails(details:Object){ + Debugger.log('Populating properties details:'+details,Debugger.GEN,'populatePropDetails','org.lamsfoundation.lams.ws.WorkspaceDialog'); + + if(details == null){ + Debugger.log('Error - empty details:'+details,Debugger.GEN,'populatePropDetails','org.lamsfoundation.lams.ws.WorkspaceDialog'); + + } + + resourceDesc_txa.text = details.description; + if(details.licenseID > 0){ - //TODO These Items must also be in the FolderContentsDTO - /* - license_txa.text = ; - licenseID_cmb.value = ; - */ + for(var i=0; i