mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD 7461: Reapply rules to children and other rule related fixes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8385 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -413,6 +413,9 @@
|
|||||||
<property name="ruleService">
|
<property name="ruleService">
|
||||||
<ref bean="RuleService" />
|
<ref bean="RuleService" />
|
||||||
</property>
|
</property>
|
||||||
|
<property name="runtimeRuleService">
|
||||||
|
<ref bean="ruleService" />
|
||||||
|
</property>
|
||||||
<property name="dictionaryService">
|
<property name="dictionaryService">
|
||||||
<ref bean="DictionaryService" />
|
<ref bean="DictionaryService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -28,6 +28,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||||
|
import org.alfresco.repo.rule.RuntimeRuleService;
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
import org.alfresco.service.cmr.action.ActionService;
|
import org.alfresco.service.cmr.action.ActionService;
|
||||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||||
@@ -62,6 +63,11 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
|||||||
*/
|
*/
|
||||||
private RuleService ruleService;
|
private RuleService ruleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The runtime rule service
|
||||||
|
*/
|
||||||
|
private RuntimeRuleService runtimeRuleService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The action service
|
* The action service
|
||||||
*/
|
*/
|
||||||
@@ -90,6 +96,16 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
|||||||
this.ruleService = ruleService;
|
this.ruleService = ruleService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the runtime rule service
|
||||||
|
*
|
||||||
|
* @param runtimeRuleService the runtime rule service
|
||||||
|
*/
|
||||||
|
public void setRuntimeRuleService(RuntimeRuleService runtimeRuleService)
|
||||||
|
{
|
||||||
|
this.runtimeRuleService = runtimeRuleService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the action service
|
* Set the action service
|
||||||
*
|
*
|
||||||
@@ -125,7 +141,7 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
|||||||
includeInherited = includeInheritedValue.booleanValue();
|
includeInherited = includeInheritedValue.booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the rules
|
// Get the rules
|
||||||
List<Rule> rules = this.ruleService.getRules(actionedUponNodeRef, includeInherited);
|
List<Rule> rules = this.ruleService.getRules(actionedUponNodeRef, includeInherited);
|
||||||
if (rules != null && rules.isEmpty() == false)
|
if (rules != null && rules.isEmpty() == false)
|
||||||
{
|
{
|
||||||
@@ -140,12 +156,17 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
|||||||
if (this.dictionaryService.isSubClass(this.nodeService.getType(child), ContentModel.TYPE_SYSTEM_FOLDER) == false)
|
if (this.dictionaryService.isSubClass(this.nodeService.getType(child), ContentModel.TYPE_SYSTEM_FOLDER) == false)
|
||||||
{
|
{
|
||||||
for (Rule rule : rules)
|
for (Rule rule : rules)
|
||||||
{
|
{
|
||||||
Action action = rule.getAction();
|
// Only reapply rules that are enabled
|
||||||
if (action != null)
|
if (rule.getRuleDisabled() == false)
|
||||||
{
|
{
|
||||||
this.actionService.executeAction(action, child);
|
Action action = rule.getAction();
|
||||||
}
|
if (action != null)
|
||||||
|
{
|
||||||
|
//this.actionService.executeAction(action, child);
|
||||||
|
this.runtimeRuleService.addRulePendingExecution(actionedUponNodeRef, child, rule);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ import org.alfresco.service.cmr.version.VersionService;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version opertaions service implementation
|
* Version operations service implementation
|
||||||
*
|
*
|
||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
*/
|
*/
|
||||||
@@ -105,6 +105,7 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
|||||||
/**
|
/**
|
||||||
* The versionable aspect behaviour implementation
|
* The versionable aspect behaviour implementation
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private VersionableAspect versionableAspect;
|
private VersionableAspect versionableAspect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -374,7 +375,6 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
|||||||
if (keepCheckedOut == false)
|
if (keepCheckedOut == false)
|
||||||
{
|
{
|
||||||
// Delete the working copy
|
// Delete the working copy
|
||||||
this.nodeService.removeAspect(workingCopyNodeRef, ContentModel.ASPECT_WORKING_COPY);
|
|
||||||
this.nodeService.deleteNode(workingCopyNodeRef);
|
this.nodeService.deleteNode(workingCopyNodeRef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -448,7 +448,6 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
|
|||||||
this.lockService.unlock(nodeRef);
|
this.lockService.unlock(nodeRef);
|
||||||
|
|
||||||
// Delete the working copy
|
// Delete the working copy
|
||||||
this.nodeService.removeAspect(workingCopyNodeRef, ContentModel.ASPECT_WORKING_COPY);
|
|
||||||
this.nodeService.deleteNode(workingCopyNodeRef);
|
this.nodeService.deleteNode(workingCopyNodeRef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user