use of org.alfresco.repo.web.scripts.rule.ruleset.RuleRef in project alfresco-remote-api by Alfresco.
the class RulesGet method executeImpl.
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
Map<String, Object> model = new HashMap<String, Object>();
// get request parameters
NodeRef nodeRef = parseRequestForNodeRef(req);
String ruleType = req.getParameter("ruleType");
RuleType type = ruleService.getRuleType(ruleType);
if (type == null) {
ruleType = null;
}
// get all rules (excluding inherited) filtered by rule type
List<Rule> rules = ruleService.getRules(nodeRef, false, ruleType);
List<RuleRef> ruleRefs = new ArrayList<RuleRef>();
for (Rule rule : rules) {
ruleRefs.add(new RuleRef(rule, fileFolderService.getFileInfo(ruleService.getOwningNodeRef(rule))));
}
model.put("ruleRefs", ruleRefs);
return model;
}
Aggregations