mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
SAIL-371 (SAIL-294): NodeDAO: RepoTransferReceiverImplTest.testJira_ALF_2772 (do not try to remove mandatory aspects on node update - see also r20654)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20703 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
class="org.alfresco.repo.transfer.DefaultManifestProcessorFactoryImpl">
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<property name="nodeResolverFactory" ref="transferNodeResolverFactory" />
|
||||
</bean>
|
||||
|
||||
|
@@ -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);
|
||||
@@ -77,6 +80,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
|
||||
*/
|
||||
|
@@ -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<NodeRef, List<ChildAssociationRef>> orphans = new HashMap<NodeRef, List<ChildAssociationRef>>(89);
|
||||
@@ -380,6 +383,13 @@ public class RepoPrimaryManifestProcessorImpl extends AbstractManifestProcessorB
|
||||
Set<QName> existingAspects = nodeService.getAspects(nodeToUpdate);
|
||||
Set<QName> aspectsToRemove = new HashSet<QName>(existingAspects);
|
||||
|
||||
// Add mandatory aspects to the supplied aspects (eg. should not explicitly remove auditable aspect from a folder - see also DMDeploymentTarget for similar)
|
||||
List<AspectDefinition> aspectDefs = dictionaryService.getType(nodeService.getType(nodeToUpdate)).getDefaultAspects(true);
|
||||
for (AspectDefinition aspectDef : aspectDefs)
|
||||
{
|
||||
suppliedAspects.add(aspectDef.getName());
|
||||
}
|
||||
|
||||
aspectsToRemove.removeAll(suppliedAspects);
|
||||
suppliedAspects.removeAll(existingAspects);
|
||||
|
||||
@@ -589,6 +599,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
|
||||
* the nodeResolver to set
|
||||
|
Reference in New Issue
Block a user