mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:
42843: ALF-16346: Preventing contention on packages system folder when creating workflow git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42844 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
<property name="namespaceService" ref="namespaceService"/>
|
<property name="namespaceService" ref="namespaceService"/>
|
||||||
<property name="tenantService" ref="tenantService"/>
|
<property name="tenantService" ref="tenantService"/>
|
||||||
<property name="messageService" ref="messageService"/>
|
<property name="messageService" ref="messageService"/>
|
||||||
|
<property name="policyBehaviourFilter" ref="policyBehaviourFilter"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="workflowInterpreter" class="org.alfresco.repo.workflow.WorkflowInterpreter" parent="interpreterBase">
|
<bean id="workflowInterpreter" class="org.alfresco.repo.workflow.WorkflowInterpreter" parent="interpreterBase">
|
||||||
|
@@ -27,6 +27,7 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.repo.i18n.MessageService;
|
import org.alfresco.repo.i18n.MessageService;
|
||||||
import org.alfresco.repo.importer.ImporterBootstrap;
|
import org.alfresco.repo.importer.ImporterBootstrap;
|
||||||
import org.alfresco.repo.node.SystemNodeUtils;
|
import org.alfresco.repo.node.SystemNodeUtils;
|
||||||
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.tenant.TenantService;
|
import org.alfresco.repo.tenant.TenantService;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -60,6 +61,7 @@ public class WorkflowPackageImpl implements WorkflowPackageComponent
|
|||||||
private NodeRef systemWorkflowContainer = null;
|
private NodeRef systemWorkflowContainer = null;
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
private MessageService messageService;
|
private MessageService messageService;
|
||||||
|
private BehaviourFilter policyBehaviourFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bootstrap the importer bootstrap for the store to place workflow
|
* @param bootstrap the importer bootstrap for the store to place workflow
|
||||||
@@ -115,6 +117,13 @@ public class WorkflowPackageImpl implements WorkflowPackageComponent
|
|||||||
this.messageService = messageService;
|
this.messageService = messageService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param policyBehaviourFilter the behaviourFilter to set
|
||||||
|
*/
|
||||||
|
public void setPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter) {
|
||||||
|
this.policyBehaviourFilter = policyBehaviourFilter;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@@ -146,6 +155,9 @@ public class WorkflowPackageImpl implements WorkflowPackageComponent
|
|||||||
NodeRef packages = findOrCreatePackagesFolder();
|
NodeRef packages = findOrCreatePackagesFolder();
|
||||||
String packageId = "pkg_" + GUID.generate();
|
String packageId = "pkg_" + GUID.generate();
|
||||||
QName packageName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, packageId);
|
QName packageName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, packageId);
|
||||||
|
|
||||||
|
try {
|
||||||
|
policyBehaviourFilter.disableBehaviour(packages, ContentModel.ASPECT_AUDITABLE);
|
||||||
ChildAssociationRef packageAssoc = nodeService.createNode(packages, ContentModel.ASSOC_CONTAINS, packageName,
|
ChildAssociationRef packageAssoc = nodeService.createNode(packages, ContentModel.ASSOC_CONTAINS, packageName,
|
||||||
WorkflowModel.TYPE_PACKAGE);
|
WorkflowModel.TYPE_PACKAGE);
|
||||||
NodeRef packageContainer = packageAssoc.getChildRef();
|
NodeRef packageContainer = packageAssoc.getChildRef();
|
||||||
@@ -154,6 +166,11 @@ public class WorkflowPackageImpl implements WorkflowPackageComponent
|
|||||||
PermissionService.ALL_PERMISSIONS, true);
|
PermissionService.ALL_PERMISSIONS, true);
|
||||||
return packageContainer;
|
return packageContainer;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
policyBehaviourFilter.enableBehaviour(packages, ContentModel.ASPECT_AUDITABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the system folder in which all packages are stored. If this folder
|
* Finds the system folder in which all packages are stored. If this folder
|
||||||
|
Reference in New Issue
Block a user