mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V34 to HEAD:
Merged V33 to V34: 24440: ALF-6114: Rules for updated items are triggered before users commit any changes. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@24938 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,6 +52,7 @@ import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.CopyService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.rule.RuleService;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
@@ -129,6 +130,9 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
||||
*/
|
||||
private AuthenticationService authenticationService;
|
||||
|
||||
/** Rule service */
|
||||
private RuleService ruleService;
|
||||
|
||||
/**
|
||||
* The versionable aspect behaviour implementation
|
||||
*/
|
||||
@@ -223,6 +227,14 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ruleService rule service
|
||||
*/
|
||||
public void setRuleService(RuleService ruleService)
|
||||
{
|
||||
this.ruleService = ruleService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise method
|
||||
*/
|
||||
@@ -432,17 +444,25 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
// Update the working copy name
|
||||
this.nodeService.setProperty(workingCopy, ContentModel.PROP_NAME, copyName);
|
||||
ruleService.disableRules();
|
||||
try
|
||||
{
|
||||
// Update the working copy name
|
||||
this.nodeService.setProperty(workingCopy, ContentModel.PROP_NAME, copyName);
|
||||
|
||||
// Apply the working copy aspect to the working copy
|
||||
Map<QName, Serializable> workingCopyProperties = new HashMap<QName, Serializable>(1);
|
||||
workingCopyProperties.put(ContentModel.PROP_WORKING_COPY_OWNER, userName);
|
||||
this.nodeService.addAspect(workingCopy, ContentModel.ASPECT_WORKING_COPY, workingCopyProperties);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ruleService.enableRules();
|
||||
}
|
||||
|
||||
// Get the user
|
||||
String userName = getUserName();
|
||||
|
||||
// Apply the working copy aspect to the working copy
|
||||
Map<QName, Serializable> workingCopyProperties = new HashMap<QName, Serializable>(1);
|
||||
workingCopyProperties.put(ContentModel.PROP_WORKING_COPY_OWNER, userName);
|
||||
this.nodeService.addAspect(workingCopy, ContentModel.ASPECT_WORKING_COPY, workingCopyProperties);
|
||||
|
||||
// Lock the original node
|
||||
this.lockService.lock(nodeRef, LockType.READ_ONLY_LOCK);
|
||||
|
||||
|
Reference in New Issue
Block a user