Search in sources :

Example 1 with RecordsManagementActionCondition

use of org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionCondition in project records-management by Alfresco.

the class RmActionConditionDefinitionsGet method executeImpl.

/**
 * @see org.springframework.extensions.webscripts.DeclarativeWebScript#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
 */
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
    List<ActionConditionDefinition> dmDefs = actionService.getActionConditionDefinitions();
    List<RecordsManagementActionCondition> conditions = recordsManagementActionService.getRecordsManagementActionConditions();
    List<ActionConditionDefinition> defs = new ArrayList<ActionConditionDefinition>(dmDefs.size() + conditions.size());
    defs.addAll(dmDefs);
    for (RecordsManagementActionCondition condition : conditions) {
        if (condition.isPublicCondition()) {
            defs.add(condition.getRecordsManagementActionConditionDefinition());
        }
    }
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("actionconditiondefinitions", defs);
    return model;
}
Also used : HashMap(java.util.HashMap) ActionConditionDefinition(org.alfresco.service.cmr.action.ActionConditionDefinition) ArrayList(java.util.ArrayList) RecordsManagementActionCondition(org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionCondition)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 RecordsManagementActionCondition (org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionCondition)1 ActionConditionDefinition (org.alfresco.service.cmr.action.ActionConditionDefinition)1