diff --git a/config/alfresco/core-services-context.xml b/config/alfresco/core-services-context.xml index 2abdb1369b..d52b3116f1 100644 --- a/config/alfresco/core-services-context.xml +++ b/config/alfresco/core-services-context.xml @@ -752,7 +752,10 @@ - + + + + diff --git a/source/java/org/alfresco/repo/copy/CopyServiceImpl.java b/source/java/org/alfresco/repo/copy/CopyServiceImpl.java index 00e4675fd3..8a6930db53 100644 --- a/source/java/org/alfresco/repo/copy/CopyServiceImpl.java +++ b/source/java/org/alfresco/repo/copy/CopyServiceImpl.java @@ -40,6 +40,7 @@ import org.alfresco.repo.policy.ClassPolicyDelegate; import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.PolicyScope; +import org.alfresco.repo.tenant.TenantService; import org.alfresco.service.cmr.dictionary.AspectDefinition; import org.alfresco.service.cmr.dictionary.AssociationDefinition; import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition; @@ -100,6 +101,9 @@ public class CopyServiceImpl implements CopyService /** Authentication service */ private AuthenticationService authenticationService; + + /** Tenant service */ + private TenantService tenantService; /** Policy delegates */ private ClassPolicyDelegate onCopyNodeDelegate; @@ -184,6 +188,16 @@ public class CopyServiceImpl implements CopyService { this.authenticationService = authenticationService; } + + /** + * Sets the tenant service + * + * @param tenantService the tenant service + */ + public void setTenantService(TenantService tenantService) + { + this.tenantService = tenantService; + } /** * Initialise method @@ -225,7 +239,8 @@ public class CopyServiceImpl implements CopyService ParameterCheck.mandatory("Destination Parent", destinationParentRef); ParameterCheck.mandatory("Destination Association Name", destinationQName); - if (sourceNodeRef.getStoreRef().equals(destinationParentRef.getStoreRef()) == false) + // AR-2023, need to push down + if (tenantService.getName(sourceNodeRef.getStoreRef()).equals(tenantService.getName(destinationParentRef.getStoreRef())) == false) { // TODO We need to create a new node in the other store with the same id as the source diff --git a/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java b/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java index 1ec89e41b2..058ded80ef 100644 --- a/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java +++ b/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java @@ -470,7 +470,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl ChildAssoc oldAssoc = nodeDaoService.getPrimaryParentAssoc(nodeToMove); ChildAssociationRef oldAssocRef = oldAssoc.getChildAssocRef(); - boolean movingStore = !nodeToMoveRef.getStoreRef().equals(newParentRef.getStoreRef()); + // AR-2023, need to push down + boolean movingStore = !tenantService.getName(nodeToMoveRef.getStoreRef()).equals(tenantService.getName(newParentRef.getStoreRef())); // data needed for policy invocation QName nodeToMoveTypeQName = nodeToMove.getTypeQName();