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:
@@ -20,6 +20,7 @@ package org.alfresco.repo.rule;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -269,7 +270,26 @@ public class RuleServiceImplTest extends BaseRuleTest
|
||||
{
|
||||
System.out.println(" - Assoc index = " + ruleChildAssocRef.getNthSibling() + ", name = " +
|
||||
nodeService.getProperty(ruleChildAssocRef.getChildRef(), ContentModel.PROP_TITLE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<NodeRef> ruleNodeRefs = new ArrayList<NodeRef>(rules.size());
|
||||
for (Rule tempRule : rules)
|
||||
{
|
||||
ruleNodeRefs.add(0, tempRule.getNodeRef());
|
||||
}
|
||||
|
||||
Action action = actionService.createAction(ReorderRules.NAME);
|
||||
action.setParameterValue(ReorderRules.PARAM_RULES, (Serializable)ruleNodeRefs);
|
||||
|
||||
actionService.executeAction(action, nodeRef);
|
||||
|
||||
List<ChildAssociationRef> ruleChildAssocRefs = nodeService.getChildAssocs(ruleFolder, RegexQNamePattern.MATCH_ALL, ASSOC_NAME_RULES_REGEX);
|
||||
System.out.println("After execution of action ...");
|
||||
for (ChildAssociationRef ruleChildAssocRef : ruleChildAssocRefs)
|
||||
{
|
||||
System.out.println(" - Assoc index = " + ruleChildAssocRef.getNthSibling() + ", name = " +
|
||||
nodeService.getProperty(ruleChildAssocRef.getChildRef(), ContentModel.PROP_TITLE));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user