Search in sources :

Example 1 with ActionTypeInfo

use of com.manydesigns.portofino.upstairs.actions.support.ActionTypeInfo in project Portofino by ManyDesigns.

the class ActionsAction method getResourceActionTypes.

@Path(":types")
@GET
@RequiresPermissions(level = AccessLevel.NONE)
@Produces(MediaType.APPLICATION_JSON)
public Map<String, ActionTypeInfo> getResourceActionTypes() {
    Map<String, ActionTypeInfo> result = new HashMap<>();
    TextProvider textProvider = ElementsThreadLocals.getTextProvider();
    actionRegistry.iterator().forEachRemaining(a -> {
        String className = a.actionClass.getName();
        result.put(a.description, new ActionTypeInfo(className, a.getActionName(textProvider), textProvider.getTextOrNull(className + ".description"), a.supportsDetail));
    });
    return result;
}
Also used : ActionTypeInfo(com.manydesigns.portofino.upstairs.actions.support.ActionTypeInfo) HashMap(java.util.HashMap) TextProvider(com.manydesigns.elements.i18n.TextProvider) RequiresPermissions(com.manydesigns.portofino.security.RequiresPermissions)

Aggregations

TextProvider (com.manydesigns.elements.i18n.TextProvider)1 RequiresPermissions (com.manydesigns.portofino.security.RequiresPermissions)1 ActionTypeInfo (com.manydesigns.portofino.upstairs.actions.support.ActionTypeInfo)1 HashMap (java.util.HashMap)1