From a20914fa8ee87d3c125d327408fb4133db5c8264 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Fri, 15 May 2009 04:15:40 +0000 Subject: [PATCH] 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 --- .../alfresco/web/bean/spaces/EditSpaceDialog.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java index 342bba5f84..9b94d820eb 100644 --- a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java @@ -25,6 +25,7 @@ package org.alfresco.web.bean.spaces; import java.io.Serializable; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -97,14 +98,8 @@ public class EditSpaceDialog extends CreateSpaceDialog this.getFileFolderService().rename(nodeRef, name); } - // get the current set of properties from the repository - Map repoProps = this.getNodeService().getProperties(nodeRef); - - // 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); - } + // build the properties to add to the repository + Map repoProps = new HashMap(7); // overwrite the current properties with the edited ones Iterator iterProps = editedProps.keySet().iterator(); @@ -136,8 +131,8 @@ public class EditSpaceDialog extends CreateSpaceDialog repoProps.put(qname, propValue); } - // send the properties back to the repository - this.getNodeService().setProperties(nodeRef, repoProps); + // add the new properties back to the repository + this.getNodeService().addProperties(nodeRef, repoProps); // we also need to persist any association changes that may have been made