Search in sources :

Example 6 with RecordsManagementAction

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

the class ListOfValuesGet method createDispositionActionsModel.

/**
 * Creates the model for the list of disposition actions.
 *
 * @param baseUrl The base URL of the service
 * @return model of disposition actions list
 */
protected Map<String, Object> createDispositionActionsModel(String baseUrl) {
    // iterate over the disposition actions
    List<RecordsManagementAction> dispositionActions = this.rmActionService.getDispositionActions();
    List<Map<String, String>> items = new ArrayList<Map<String, String>>(dispositionActions.size());
    for (RecordsManagementAction dispositionAction : dispositionActions) {
        Map<String, String> item = new HashMap<String, String>(2);
        item.put("label", dispositionAction.getLabel());
        item.put("value", dispositionAction.getName());
        items.add(item);
    }
    // create the model
    Map<String, Object> model = new HashMap<String, Object>(2);
    model.put("url", baseUrl + "/dispositionactions");
    model.put("items", items);
    return model;
}
Also used : RecordsManagementAction(org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) HashMap(java.util.HashMap) Map(java.util.Map)

Example 7 with RecordsManagementAction

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

the class DispositionActionParameterConstraint method getAllowableValuesImpl.

/**
 * @see org.alfresco.service.cmr.action.ParameterConstraint#getAllowableValues()
 */
protected Map<String, String> getAllowableValuesImpl() {
    List<RecordsManagementAction> rmActions = rmActionService.getDispositionActions();
    Map<String, String> result = new HashMap<String, String>(rmActions.size());
    for (RecordsManagementAction rmAction : rmActions) {
        result.put(rmAction.getName(), rmAction.getLabel());
    }
    return result;
}
Also used : RecordsManagementAction(org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction) HashMap(java.util.HashMap)

Aggregations

RecordsManagementAction (org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction)7 HashMap (java.util.HashMap)4 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 AuthenticationUtil (org.alfresco.repo.security.authentication.AuthenticationUtil)1 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)1 ActionDefinition (org.alfresco.service.cmr.action.ActionDefinition)1