Bug fixes to rename action for non-AVM objects

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4016 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-10-04 10:20:43 +00:00
parent 76fa148539
commit 82e76ede01
4 changed files with 169 additions and 21 deletions

View File

@@ -69,17 +69,16 @@ public class EditContentPropertiesDialog extends BaseDialogBean
NodeRef nodeRef = this.editableNode.getNodeRef();
Map<String, Object> editedProps = this.editableNode.getProperties();
// we deal with 'name' as a rename/move operation later
String name = (String)editedProps.get(ContentModel.PROP_NAME);
// get the name and move the node as necessary
String name = (String) editedProps.get(ContentModel.PROP_NAME);
if (name != null)
{
editedProps.remove(ContentModel.PROP_NAME);
fileFolderService.rename(nodeRef, name);
}
// we need to put all the properties from the editable bag back into
// the format expected by the repository
Map<QName, Serializable> repoProps = this.nodeService.getProperties(nodeRef);
repoProps.remove(ContentModel.PROP_NAME);
// but first extract and deal with the special mimetype property for ContentData
String mimetype = (String)editedProps.get(TEMP_PROP_MIMETYPE);
@@ -182,13 +181,6 @@ public class EditContentPropertiesDialog extends BaseDialogBean
}
}
// 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;
}