Resolve ALF-4739 Transfer of an item with a rule defined against it (without its associated rule) causes data corruption on destination repository

- transfer definition now allows aspects to be excluded from the transfer (setExcludedAspects)
- manifest builder is sensitive to excluded aspects
- replication definition excludes rule:rules for now

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22513 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-09-14 14:59:12 +00:00
parent 652680d56a
commit 9e4ec6276f
7 changed files with 123 additions and 24 deletions

View File

@@ -27,6 +27,7 @@ import org.alfresco.repo.action.ActionCancelledException;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.repo.lock.JobLockService;
import org.alfresco.repo.lock.LockAcquisitionException;
import org.alfresco.repo.rule.RuleModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transfer.ChildAssociatedNodeFinder;
import org.alfresco.repo.transfer.ContentClassFilter;
@@ -169,14 +170,19 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
* replication to be run.
*/
protected TransferDefinition buildTransferDefinition(
ReplicationDefinition replicationDef, Set<NodeRef> toTransfer
) {
ReplicationDefinition replicationDef, Set<NodeRef> toTransfer)
{
TransferDefinition transferDefinition =
new TransferDefinition();
transferDefinition.setNodes(toTransfer);
transferDefinition.setSync(true);
transferDefinition.setReadOnly(true);
// Exclude aspects from transfer
// NOTE: this list of aspects should be synced up with the NodeCrawler in expandPayload to
// ensure a coherent set of nodes are transferred
transferDefinition.setExcludedAspects(RuleModel.ASPECT_RULES);
return transferDefinition;
}
@@ -209,10 +215,6 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
throw new ReplicationServiceException("Unable to execute a disabled replication definition");
}
// Clear the previous transfer report references
// replicationDef.setLocalTransferReport(null);
// replicationDef.setRemoteTransferReport(null);
// Lock the service - only one instance of the replication
// should occur at a time
ReplicationDefinitionLockExtender lock =