MT - fix AR-2023

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8111 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-01-29 09:50:42 +00:00
parent d27f0b557e
commit 6fea36b5cf
3 changed files with 22 additions and 3 deletions

View File

@@ -752,7 +752,10 @@
</property> </property>
<property name="internalNodeService"> <property name="internalNodeService">
<ref bean="nodeService" /> <ref bean="nodeService" />
</property> </property>
<property name="tenantService">
<ref bean="tenantService" />
</property>
</bean> </bean>
<!-- --> <!-- -->

View File

@@ -40,6 +40,7 @@ import org.alfresco.repo.policy.ClassPolicyDelegate;
import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.policy.PolicyScope; 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.AspectDefinition;
import org.alfresco.service.cmr.dictionary.AssociationDefinition; import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition; import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
@@ -100,6 +101,9 @@ public class CopyServiceImpl implements CopyService
/** Authentication service */ /** Authentication service */
private AuthenticationService authenticationService; private AuthenticationService authenticationService;
/** Tenant service */
private TenantService tenantService;
/** Policy delegates */ /** Policy delegates */
private ClassPolicyDelegate<CopyServicePolicies.OnCopyNodePolicy> onCopyNodeDelegate; private ClassPolicyDelegate<CopyServicePolicies.OnCopyNodePolicy> onCopyNodeDelegate;
@@ -184,6 +188,16 @@ public class CopyServiceImpl implements CopyService
{ {
this.authenticationService = authenticationService; this.authenticationService = authenticationService;
} }
/**
* Sets the tenant service
*
* @param tenantService the tenant service
*/
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
/** /**
* Initialise method * Initialise method
@@ -225,7 +239,8 @@ public class CopyServiceImpl implements CopyService
ParameterCheck.mandatory("Destination Parent", destinationParentRef); ParameterCheck.mandatory("Destination Parent", destinationParentRef);
ParameterCheck.mandatory("Destination Association Name", destinationQName); 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 // TODO We need to create a new node in the other store with the same id as the source

View File

@@ -470,7 +470,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
ChildAssoc oldAssoc = nodeDaoService.getPrimaryParentAssoc(nodeToMove); ChildAssoc oldAssoc = nodeDaoService.getPrimaryParentAssoc(nodeToMove);
ChildAssociationRef oldAssocRef = oldAssoc.getChildAssocRef(); 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 // data needed for policy invocation
QName nodeToMoveTypeQName = nodeToMove.getTypeQName(); QName nodeToMoveTypeQName = nodeToMove.getTypeQName();