mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added reordering action
- the actioned upon node is the node that has the rules - the rule nodes are provided as a multi-value property (list of node refs) and then reordered in the order found on the list - additional existance checks where added to the link/unlink actions git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18934 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -70,16 +70,19 @@ public class UnlinkRules extends ActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// Check that the actioned upon node has the rules aspect applied
|
||||
if (nodeService.hasAspect(actionedUponNodeRef, RuleModel.ASPECT_RULES) == true)
|
||||
{
|
||||
// Get the rule node the actioned upon node is linked to
|
||||
NodeRef linkedToNode = ((RuleService)ruleService).getLinkedToRuleNode(actionedUponNodeRef);
|
||||
if (linkedToNode != null)
|
||||
{
|
||||
NodeRef ruleFolder = ruleService.getSavedRuleFolderAssoc(linkedToNode).getChildRef();
|
||||
nodeService.removeChild(actionedUponNodeRef, ruleFolder);
|
||||
nodeService.removeAspect(actionedUponNodeRef, RuleModel.ASPECT_RULES);
|
||||
if (nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Check that the actioned upon node has the rules aspect applied
|
||||
if (nodeService.hasAspect(actionedUponNodeRef, RuleModel.ASPECT_RULES) == true)
|
||||
{
|
||||
// Get the rule node the actioned upon node is linked to
|
||||
NodeRef linkedToNode = ((RuleService)ruleService).getLinkedToRuleNode(actionedUponNodeRef);
|
||||
if (linkedToNode != null)
|
||||
{
|
||||
NodeRef ruleFolder = ruleService.getSavedRuleFolderAssoc(linkedToNode).getChildRef();
|
||||
nodeService.removeChild(actionedUponNodeRef, ruleFolder);
|
||||
nodeService.removeAspect(actionedUponNodeRef, RuleModel.ASPECT_RULES);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user