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 ComponentName
ID
protected io.dropwizard.metrics5.MetricRegistry
metrics
-
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 void
activate(ComponentContext context)
Activates the component.void
addAction(Action action)
boolean
checkFilter(String filterId, ActionContext context)
Returns false if given filter evaluation is supposed to deny access when checking for this filter.boolean
checkFilters(List<String> filterIds, ActionContext context)
Returns false if given filters evaluation is supposed to deny access when checking for this filter.protected boolean
checkFilters(Action action, List<String> filterIds, ActionContext context)
boolean
checkFilters(Action action, ActionContext context)
void
deactivate(ComponentContext context)
Deactivates the component.Action
getAction(String actionId)
Action
getAction(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 ActionRegistry
getActionRegistry()
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).ActionFilter
getFilter(String filterId)
protected ActionFilterRegistry
getFilterRegistry()
Return the action filter registryActionFilter[]
getFilters(String actionId)
boolean
isEnabled(String actionId, ActionContext context)
boolean
isEnabled(Action action, ActionContext context)
boolean
isRegistered(String actionId)
protected boolean
isTimeTracerLogEnabled()
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
protected void
registerFilterFactory(FilterFactory ff)
Deprecated.seems not used in Nuxeo - should be removed - and anyway the merge is not donevoid
remove()
Cleanup method.Action
removeAction(String actionId)
void
start(ComponentContext context)
Start the component.void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
unregisterFilterFactory(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:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in 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:
checkFilters
in interfaceActionManager
-
getActions
public List<Action> getActions(String category, ActionContext context)
Description copied from interface:ActionManager
Gets actions for a category (filters are evaluated).Only actions available in the given context are returned
- Specified by:
getActions
in interfaceActionManager
-
getAllActions
public List<Action> getAllActions(String category)
Description copied from interface:ActionManager
Gets all actions in a category (filters are NOT evaluated).- Specified by:
getAllActions
in interfaceActionManager
-
getActions
public List<Action> getActions(String category, ActionContext context, boolean hideUnavailableActions)
Description copied from interface:ActionManager
Gets 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:
getActions
in interfaceActionManager
-
isTimeTracerLogEnabled
protected boolean isTimeTracerLogEnabled()
-
getAction
public Action getAction(String actionId, ActionContext context, boolean hideUnavailableAction)
Description copied from interface:ActionManager
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.If hideUnavailableActions is false, the action is always returned but it is flagged with an available flag depending on filters evaluation.
- Specified by:
getAction
in interfaceActionManager
-
getAction
public Action getAction(String actionId)
- Specified by:
getAction
in interfaceActionManager
-
isRegistered
public boolean isRegistered(String actionId)
- Specified by:
isRegistered
in interfaceActionManager
-
isEnabled
public boolean isEnabled(String actionId, ActionContext context)
- Specified by:
isEnabled
in interfaceActionManager
-
isEnabled
public boolean isEnabled(Action action, ActionContext context)
-
getFilters
public ActionFilter[] getFilters(String actionId)
- Specified by:
getFilters
in interfaceActionManager
-
getFilter
public ActionFilter getFilter(String filterId)
- Specified by:
getFilter
in interfaceActionManager
- See Also:
ActionFilterRegistry.getFilter(String)
-
checkFilter
public boolean checkFilter(String filterId, ActionContext context)
Description copied from interface:ActionManager
Returns false if given filter evaluation is supposed to deny access when checking for this filter.- Specified by:
checkFilter
in interfaceActionManager
-
checkFilters
public boolean checkFilters(List<String> filterIds, ActionContext context)
Description copied from interface:ActionManager
Returns false if given filters evaluation is supposed to deny access when checking for this filter.- Specified by:
checkFilters
in interfaceActionManager
-
checkFilters
protected boolean checkFilters(Action action, List<String> filterIds, ActionContext context)
-
addAction
public void addAction(Action action)
- Specified by:
addAction
in interfaceActionManager
- See Also:
ActionRegistry.addAction(Action)
-
removeAction
public Action removeAction(String actionId)
- Specified by:
removeAction
in interfaceActionManager
- See Also:
ActionRegistry.removeAction(String)
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in 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:ActionManager
Cleanup method.- Specified by:
remove
in interfaceActionManager
-
-