diff --git a/config/alfresco/model-specific-services-context.xml b/config/alfresco/model-specific-services-context.xml
index 2ae11ec15d..ebf53a1f6d 100644
--- a/config/alfresco/model-specific-services-context.xml
+++ b/config/alfresco/model-specific-services-context.xml
@@ -12,6 +12,15 @@
+
+
+
+ /${spaces.company_home.childname}
+ /${spaces.company_home.childname}/${spaces.dictionary.childname}
+ /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.childname}
+ /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname}
+
+
diff --git a/source/java/org/alfresco/repo/model/filefolder/FileFolderServiceImpl.java b/source/java/org/alfresco/repo/model/filefolder/FileFolderServiceImpl.java
index bb797f8013..a717802b40 100644
--- a/source/java/org/alfresco/repo/model/filefolder/FileFolderServiceImpl.java
+++ b/source/java/org/alfresco/repo/model/filefolder/FileFolderServiceImpl.java
@@ -98,6 +98,9 @@ public class FileFolderServiceImpl implements FileFolderService
private ContentService contentService;
private MimetypeService mimetypeService;
+ // TODO: Replace this with a more formal means of identifying "system" folders (i.e. aspect or UUID)
+ private List systemPaths;
+
/**
* Default constructor
*/
@@ -140,6 +143,13 @@ public class FileFolderServiceImpl implements FileFolderService
this.mimetypeService = mimetypeService;
}
+ // TODO: Replace this with a more formal means of identifying "system" folders (i.e. aspect or UUID)
+ public void setSystemPaths(List systemPaths)
+ {
+ this.systemPaths = systemPaths;
+ }
+
+
public void init()
{
PARAMS_ANY_NAME[0] = new QueryParameterDefImpl(
@@ -481,13 +491,22 @@ public class FileFolderServiceImpl implements FileFolderService
NodeRef targetNodeRef = null;
if (move)
{
- // move the node so that the association moves as well
- ChildAssociationRef newAssocRef = nodeService.moveNode(
- sourceNodeRef,
- targetParentRef,
- assocRef.getTypeQName(),
- qname);
- targetNodeRef = newAssocRef.getChildRef();
+ // TODO: Replace this with a more formal means of identifying "system" folders (i.e. aspect or UUID)
+ if (!isSystemPath(sourceNodeRef))
+ {
+ // move the node so that the association moves as well
+ ChildAssociationRef newAssocRef = nodeService.moveNode(
+ sourceNodeRef,
+ targetParentRef,
+ assocRef.getTypeQName(),
+ qname);
+ targetNodeRef = newAssocRef.getChildRef();
+ }
+ else
+ {
+ // system path folders do not need to be moved
+ targetNodeRef = sourceNodeRef;
+ }
}
else
{
@@ -515,6 +534,21 @@ public class FileFolderServiceImpl implements FileFolderService
return afterFileInfo;
}
+ /**
+ * Determine if the specified node is a special "system" folder path based node
+ *
+ * TODO: Replace this with a more formal means of identifying "system" folders (i.e. aspect or UUID)
+ *
+ * @param nodeRef node to check
+ * @return true => system folder path based node
+ */
+ private boolean isSystemPath(NodeRef nodeRef)
+ {
+ Path path = nodeService.getPath(nodeRef);
+ String prefixedPath = path.toPrefixString(namespaceService);
+ return systemPaths.contains(prefixedPath);
+ }
+
public FileInfo create(NodeRef parentNodeRef, String name, QName typeQName) throws FileExistsException
{
// file or folder