public class ActionService extends DefaultComponent implements ActionManager
Modifier and Type | Field and Description |
---|---|
static ComponentName |
ID |
protected com.codahale.metrics.MetricRegistry |
metrics |
lastModified
Constructor and Description |
---|
ActionService() |
Modifier and Type | Method and 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(Action action,
ActionContext context) |
protected boolean |
checkFilters(Action action,
List<String> filterIds,
ActionContext context) |
boolean |
checkFilters(List<String> filterIds,
ActionContext context)
Returns false if given filters evaluation is supposed to deny access when checking for this filter.
|
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 registry
|
List<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 registry
|
ActionFilter[] |
getFilters(String actionId) |
boolean |
isEnabled(Action action,
ActionContext context) |
boolean |
isEnabled(String actionId,
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 done
|
void |
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
|
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, stop, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final ComponentName ID
protected final com.codahale.metrics.MetricRegistry metrics
public ActionService()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
protected final ActionRegistry getActionRegistry()
protected final ActionFilterRegistry getFilterRegistry()
public boolean checkFilters(Action action, ActionContext context)
checkFilters
in interface ActionManager
public List<Action> getActions(String category, ActionContext context)
ActionManager
Only actions available in the given context are returned
getActions
in interface ActionManager
public List<Action> getAllActions(String category)
ActionManager
getAllActions
in interface ActionManager
public List<Action> getActions(String category, ActionContext context, boolean hideUnavailableActions)
ActionManager
If hideUnavailableActions, all actions of the category are returned but actions are flagged with an available flag depending on filters evaluation.
getActions
in interface ActionManager
protected boolean isTimeTracerLogEnabled()
public Action getAction(String actionId, ActionContext context, boolean hideUnavailableAction)
ActionManager
If hideUnavailableActions is false, the action is always returned but it is flagged with an available flag depending on filters evaluation.
getAction
in interface ActionManager
public Action getAction(String actionId)
getAction
in interface ActionManager
public boolean isRegistered(String actionId)
isRegistered
in interface ActionManager
public boolean isEnabled(String actionId, ActionContext context)
isEnabled
in interface ActionManager
public boolean isEnabled(Action action, ActionContext context)
public ActionFilter[] getFilters(String actionId)
getFilters
in interface ActionManager
public ActionFilter getFilter(String filterId)
getFilter
in interface ActionManager
ActionFilterRegistry.getFilter(String)
public boolean checkFilter(String filterId, ActionContext context)
ActionManager
checkFilter
in interface ActionManager
public boolean checkFilters(List<String> filterIds, ActionContext context)
ActionManager
checkFilters
in interface ActionManager
protected boolean checkFilters(Action action, List<String> filterIds, ActionContext context)
public void addAction(Action action)
addAction
in interface ActionManager
ActionRegistry.addAction(Action)
public Action removeAction(String actionId)
removeAction
in interface ActionManager
ActionRegistry.removeAction(String)
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
@Deprecated protected void registerFilterFactory(FilterFactory ff)
ff
- @Deprecated public void unregisterFilterFactory(FilterFactory ff)
ff
- public void remove()
ActionManager
remove
in interface ActionManager
Copyright © 2018 Nuxeo. All rights reserved.