mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1021: It's possible to create record for synced content in folder with create record updated rule
* improve stability when defining update rules in collab site git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.alfresco.enterprise.repo.sync.SyncModel;
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
||||||
@@ -161,6 +162,14 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
|||||||
logger.debug("Can not create record, because " + actionedUponNodeRef.toString() + " has previously been rejected.");
|
logger.debug("Can not create record, because " + actionedUponNodeRef.toString() + " has previously been rejected.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (nodeService.hasAspect(actionedUponNodeRef, SyncModel.ASPECT_SYNCED) == true)
|
||||||
|
{
|
||||||
|
// can't declare the record if the node is sync'ed
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug("Can't declare as record, because " + actionedUponNodeRef.toString() + " is synched content.");
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN);
|
NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN);
|
||||||
|
@@ -157,39 +157,42 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
|
|||||||
@Override
|
@Override
|
||||||
public void executeRule(final Rule rule, final NodeRef nodeRef, final Set<ExecutedRuleData> executedRules)
|
public void executeRule(final Rule rule, final NodeRef nodeRef, final Set<ExecutedRuleData> executedRules)
|
||||||
{
|
{
|
||||||
QName typeQName = nodeService.getType(nodeRef);
|
if (nodeService.exists(nodeRef) == true)
|
||||||
|
|
||||||
// check if this is a rm rule on a rm artifact
|
|
||||||
if (filePlanService.isFilePlanComponent(nodeRef) == true &&
|
|
||||||
isFilePlanComponentRule(rule) == true)
|
|
||||||
{
|
{
|
||||||
// ignore and
|
QName typeQName = nodeService.getType(nodeRef);
|
||||||
if (isIgnoredType(typeQName) == false)
|
|
||||||
{
|
// check if this is a rm rule on a rm artifact
|
||||||
if (runAsRmAdmin == true)
|
if (filePlanService.isFilePlanComponent(nodeRef) == true &&
|
||||||
{
|
isFilePlanComponentRule(rule) == true)
|
||||||
// run as rmadmin
|
{
|
||||||
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
|
// ignore and
|
||||||
{
|
if (isIgnoredType(typeQName) == false)
|
||||||
@Override
|
{
|
||||||
public Void doWork() throws Exception
|
if (runAsRmAdmin == true)
|
||||||
{
|
{
|
||||||
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
|
// run as rmadmin
|
||||||
return null;
|
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
|
||||||
}
|
{
|
||||||
});
|
@Override
|
||||||
}
|
public Void doWork() throws Exception
|
||||||
else
|
{
|
||||||
{
|
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
|
||||||
// run as current user
|
return null;
|
||||||
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
// run as current user
|
||||||
// just execute the rule as the current user
|
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
|
||||||
super.executeRule(rule, nodeRef, executedRules);
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// just execute the rule as the current user
|
||||||
|
super.executeRule(rule, nodeRef, executedRules);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user