Package org.nuxeo.ecm.platform.actions
Class ActionService
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.actions.ActionService
-
- All Implemented Interfaces:
Serializable,ActionManager,Adaptable,Component,Extensible,TimestampedService
public class ActionService extends DefaultComponent implements ActionManager
- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ComponentNameIDprotected io.dropwizard.metrics5.MetricRegistrymetrics-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description ActionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.voidaddAction(Action action)booleancheckFilter(String filterId, ActionContext context)Returns false if given filter evaluation is supposed to deny access when checking for this filter.booleancheckFilters(List<String> filterIds, ActionContext context)Returns false if given filters evaluation is supposed to deny access when checking for this filter.protected booleancheckFilters(Action action, List<String> filterIds, ActionContext context)booleancheckFilters(Action action, ActionContext context)voiddeactivate(ComponentContext context)Deactivates the component.ActiongetAction(String actionId)ActiongetAction(String actionId, ActionContext context, boolean hideUnavailableAction)Returns action with given id, evaluating its filters in given context, and returning null if filters evaluation denies access or if action is not found.protected ActionRegistrygetActionRegistry()Return the action registryList<Action>getActions(String category, ActionContext context)Gets actions for a category (filters are evaluated).List<Action>getActions(String category, ActionContext context, boolean hideUnavailableActions)Gets actions for a category (filters are evaluated).List<Action>getAllActions(String category)Gets all actions in a category (filters are NOT evaluated).ActionFiltergetFilter(String filterId)protected ActionFilterRegistrygetFilterRegistry()Return the action filter registryActionFilter[]getFilters(String actionId)booleanisEnabled(String actionId, ActionContext context)booleanisEnabled(Action action, ActionContext context)booleanisRegistered(String actionId)protected booleanisTimeTracerLogEnabled()voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)protected voidregisterFilterFactory(FilterFactory ff)Deprecated.seems not used in Nuxeo - should be removed - and anyway the merge is not donevoidremove()Cleanup method.ActionremoveAction(String actionId)voidstart(ComponentContext context)Start the component.voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidunregisterFilterFactory(FilterFactory ff)Deprecated.seems not used in Nuxeo - should be removed - and anyway the merge is not done-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
ID
public static final ComponentName ID
-
metrics
protected final io.dropwizard.metrics5.MetricRegistry metrics
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
getActionRegistry
protected final ActionRegistry getActionRegistry()
Return the action registry
-
getFilterRegistry
protected final ActionFilterRegistry getFilterRegistry()
Return the action filter registry
-
checkFilters
public boolean checkFilters(Action action, ActionContext context)
- Specified by:
checkFiltersin interfaceActionManager
-
getActions
public List<Action> getActions(String category, ActionContext context)
Description copied from interface:ActionManagerGets actions for a category (filters are evaluated).Only actions available in the given context are returned
- Specified by:
getActionsin interfaceActionManager
-
getAllActions
public List<Action> getAllActions(String category)
Description copied from interface:ActionManagerGets all actions in a category (filters are NOT evaluated).- Specified by:
getAllActionsin interfaceActionManager
-
getActions
public List<Action> getActions(String category, ActionContext context, boolean hideUnavailableActions)
Description copied from interface:ActionManagerGets actions for a category (filters are evaluated).If hideUnavailableActions, all actions of the category are returned but actions are flagged with an available flag depending on filters evaluation.
- Specified by:
getActionsin interfaceActionManager
-
isTimeTracerLogEnabled
protected boolean isTimeTracerLogEnabled()
-
getAction
public Action getAction(String actionId, ActionContext context, boolean hideUnavailableAction)
Description copied from interface:ActionManagerReturns action with given id, evaluating its filters in given context, and returning null if filters evaluation denies access or if action is not found.If hideUnavailableActions is false, the action is always returned but it is flagged with an available flag depending on filters evaluation.
- Specified by:
getActionin interfaceActionManager
-
getAction
public Action getAction(String actionId)
- Specified by:
getActionin interfaceActionManager
-
isRegistered
public boolean isRegistered(String actionId)
- Specified by:
isRegisteredin interfaceActionManager
-
isEnabled
public boolean isEnabled(String actionId, ActionContext context)
- Specified by:
isEnabledin interfaceActionManager
-
isEnabled
public boolean isEnabled(Action action, ActionContext context)
-
getFilters
public ActionFilter[] getFilters(String actionId)
- Specified by:
getFiltersin interfaceActionManager
-
getFilter
public ActionFilter getFilter(String filterId)
- Specified by:
getFilterin interfaceActionManager- See Also:
ActionFilterRegistry.getFilter(String)
-
checkFilter
public boolean checkFilter(String filterId, ActionContext context)
Description copied from interface:ActionManagerReturns false if given filter evaluation is supposed to deny access when checking for this filter.- Specified by:
checkFilterin interfaceActionManager
-
checkFilters
public boolean checkFilters(List<String> filterIds, ActionContext context)
Description copied from interface:ActionManagerReturns false if given filters evaluation is supposed to deny access when checking for this filter.- Specified by:
checkFiltersin interfaceActionManager
-
checkFilters
protected boolean checkFilters(Action action, List<String> filterIds, ActionContext context)
-
addAction
public void addAction(Action action)
- Specified by:
addActionin interfaceActionManager- See Also:
ActionRegistry.addAction(Action)
-
removeAction
public Action removeAction(String actionId)
- Specified by:
removeActionin interfaceActionManager- See Also:
ActionRegistry.removeAction(String)
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
registerFilterFactory
@Deprecated protected void registerFilterFactory(FilterFactory ff)
Deprecated.seems not used in Nuxeo - should be removed - and anyway the merge is not done
-
unregisterFilterFactory
@Deprecated public void unregisterFilterFactory(FilterFactory ff)
Deprecated.seems not used in Nuxeo - should be removed - and anyway the merge is not done
-
remove
public void remove()
Description copied from interface:ActionManagerCleanup method.- Specified by:
removein interfaceActionManager
-
-