mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
DM NodeService automatically adds aspects when properties or associations are added to a node
- AVM NodeService not covered. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14328 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
package org.alfresco.web.bean.spaces;
|
package org.alfresco.web.bean.spaces;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -97,14 +98,8 @@ public class EditSpaceDialog extends CreateSpaceDialog
|
|||||||
this.getFileFolderService().rename(nodeRef, name);
|
this.getFileFolderService().rename(nodeRef, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the current set of properties from the repository
|
// build the properties to add to the repository
|
||||||
Map<QName, Serializable> repoProps = this.getNodeService().getProperties(nodeRef);
|
Map<QName, Serializable> repoProps = new HashMap<QName, Serializable>(7);
|
||||||
|
|
||||||
// add the "uifacets" aspect if required, properties will get set below
|
|
||||||
if (this.getNodeService().hasAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS) == false)
|
|
||||||
{
|
|
||||||
this.getNodeService().addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// overwrite the current properties with the edited ones
|
// overwrite the current properties with the edited ones
|
||||||
Iterator<String> iterProps = editedProps.keySet().iterator();
|
Iterator<String> iterProps = editedProps.keySet().iterator();
|
||||||
@@ -136,8 +131,8 @@ public class EditSpaceDialog extends CreateSpaceDialog
|
|||||||
repoProps.put(qname, propValue);
|
repoProps.put(qname, propValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// send the properties back to the repository
|
// add the new properties back to the repository
|
||||||
this.getNodeService().setProperties(nodeRef, repoProps);
|
this.getNodeService().addProperties(nodeRef, repoProps);
|
||||||
|
|
||||||
// we also need to persist any association changes that may have been made
|
// we also need to persist any association changes that may have been made
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user