. Implemented 'rename' for AVM files/folders

- this has highlighted some interesting future issues with AVM NodeRef objects - as unlike the usual noderefs, they can change due to a rename or move!
. Fixed issue with navigating back to details and browse screens after a delete file/folder operation

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-10-03 11:49:37 +00:00
parent 1c6e3a68f0
commit 2d261f31f7
13 changed files with 615 additions and 427 deletions

View File

@@ -72,15 +72,16 @@ public class EditSpaceDialog extends CreateSpaceDialog
NodeRef nodeRef = this.editableNode.getNodeRef();
Map<String, Object> editedProps = this.editableNode.getProperties();
// handle the name property separately, perform a rename in case it changed
// we deal with 'name' as a rename/move operation later
String name = (String)editedProps.get(ContentModel.PROP_NAME);
if (name != null)
{
this.fileFolderService.rename(nodeRef, name);
editedProps.remove(ContentModel.PROP_NAME);
}
// get the current set of properties from the repository
Map<QName, Serializable> repoProps = this.nodeService.getProperties(nodeRef);
repoProps.remove(ContentModel.PROP_NAME);
// add the "uifacets" aspect if required, properties will get set below
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_UIFACETS) == false)
@@ -162,6 +163,13 @@ public class EditSpaceDialog extends CreateSpaceDialog
this.nodeService.removeChild(assoc.getParentRef(), assoc.getChildRef());
}
}
// get the name and move the node as necessary
if (name != null)
{
this.fileFolderService.rename(nodeRef, name);
this.editableNode.getProperties().put(ContentModel.PROP_NAME.toString(), name);
}
return outcome;
}