diff --git a/config/alfresco/transfer-service-context.xml b/config/alfresco/transfer-service-context.xml
index f106b85de3..0e40f5b7b3 100644
--- a/config/alfresco/transfer-service-context.xml
+++ b/config/alfresco/transfer-service-context.xml
@@ -98,6 +98,7 @@
class="org.alfresco.repo.transfer.DefaultManifestProcessorFactoryImpl">
+
diff --git a/source/java/org/alfresco/repo/transfer/DefaultManifestProcessorFactoryImpl.java b/source/java/org/alfresco/repo/transfer/DefaultManifestProcessorFactoryImpl.java
index ed687a4e53..30cc83d072 100644
--- a/source/java/org/alfresco/repo/transfer/DefaultManifestProcessorFactoryImpl.java
+++ b/source/java/org/alfresco/repo/transfer/DefaultManifestProcessorFactoryImpl.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import org.alfresco.repo.transfer.manifest.TransferManifestProcessor;
+import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.transfer.TransferReceiver;
@@ -35,6 +36,7 @@ public class DefaultManifestProcessorFactoryImpl implements ManifestProcessorFac
{
private NodeService nodeService;
private ContentService contentService;
+ private DictionaryService dictionaryService;
private CorrespondingNodeResolverFactory nodeResolverFactory;
/*
@@ -51,6 +53,7 @@ public class DefaultManifestProcessorFactoryImpl implements ManifestProcessorFac
primaryProcessor.setContentService(contentService);
primaryProcessor.setNodeResolver(nodeResolver);
primaryProcessor.setNodeService(nodeService);
+ primaryProcessor.setDictionaryService(dictionaryService);
processors.add(primaryProcessor);
RepoSecondaryManifestProcessorImpl secondaryProcessor = new RepoSecondaryManifestProcessorImpl(receiver, transferId);
@@ -76,6 +79,15 @@ public class DefaultManifestProcessorFactoryImpl implements ManifestProcessorFac
{
this.contentService = contentService;
}
+
+ /**
+ * @param dictionaryService
+ * the dictionaryService to set
+ */
+ public void setDictionaryService(DictionaryService dictionaryService)
+ {
+ this.dictionaryService = dictionaryService;
+ }
/**
* @param nodeResolverFactory the nodeResolverFactory to set
diff --git a/source/java/org/alfresco/repo/transfer/RepoPrimaryManifestProcessorImpl.java b/source/java/org/alfresco/repo/transfer/RepoPrimaryManifestProcessorImpl.java
index 48994b7707..195108cf49 100644
--- a/source/java/org/alfresco/repo/transfer/RepoPrimaryManifestProcessorImpl.java
+++ b/source/java/org/alfresco/repo/transfer/RepoPrimaryManifestProcessorImpl.java
@@ -34,6 +34,8 @@ import org.alfresco.repo.transfer.manifest.TransferManifestDeletedNode;
import org.alfresco.repo.transfer.manifest.TransferManifestHeader;
import org.alfresco.repo.transfer.manifest.TransferManifestNode;
import org.alfresco.repo.transfer.manifest.TransferManifestNormalNode;
+import org.alfresco.service.cmr.dictionary.AspectDefinition;
+import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentService;
@@ -72,6 +74,7 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
private NodeService nodeService;
private ContentService contentService;
+ private DictionaryService dictionaryService;
private CorrespondingNodeResolver nodeResolver;
private Map> orphans = new HashMap>(89);
@@ -379,7 +382,14 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
Set suppliedAspects = new HashSet(node.getAspects());
Set existingAspects = nodeService.getAspects(nodeToUpdate);
Set aspectsToRemove = new HashSet(existingAspects);
-
+
+ // Add mandatory aspects to the supplied aspects (eg. should not explicitly remove auditable aspect from a folder - see also DMDeploymentTarget for similar)
+ List aspectDefs = dictionaryService.getType(nodeService.getType(nodeToUpdate)).getDefaultAspects(true);
+ for (AspectDefinition aspectDef : aspectDefs)
+ {
+ suppliedAspects.add(aspectDef.getName());
+ }
+
aspectsToRemove.removeAll(suppliedAspects);
suppliedAspects.removeAll(existingAspects);
@@ -588,6 +598,15 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
{
this.contentService = contentService;
}
+
+ /**
+ * @param dictionaryService
+ * the dictionaryService to set
+ */
+ public void setDictionaryService(DictionaryService dictionaryService)
+ {
+ this.dictionaryService = dictionaryService;
+ }
/**
* @param nodeResolver