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

@@ -753,6 +753,9 @@
<property name="internalNodeService">
<ref bean="nodeService" />
</property>
<property name="tenantService">
<ref bean="tenantService" />
</property>
</bean>
<!-- -->

View File

@@ -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;
@@ -101,6 +102,9 @@ public class CopyServiceImpl implements CopyService
/** Authentication service */
private AuthenticationService authenticationService;
/** Tenant service */
private TenantService tenantService;
/** Policy delegates */
private ClassPolicyDelegate<CopyServicePolicies.OnCopyNodePolicy> onCopyNodeDelegate;
private ClassPolicyDelegate<CopyServicePolicies.OnCopyCompletePolicy> onCopyCompleteDelegate;
@@ -185,6 +189,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

View File

@@ -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();