public class ActionServiceImpl extends Object implements ActionService, RuntimeActionService, org.springframework.context.ApplicationContextAware, CopyServicePolicies.OnCopyNodePolicy, CopyServicePolicies.OnCopyCompletePolicy
Policy.ArgARG_0, ARG_1, QNAMEQNAME| Constructor and Description |
|---|
ActionServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Action |
createAction(org.alfresco.service.cmr.repository.NodeRef actionNodeRef)
Create an action from the action node reference
|
Action |
createAction(String name)
Create a new action
|
Action |
createAction(String name,
Map<String,Serializable> params)
Create a new action specifying the initial set of parameter values
|
ActionCondition |
createActionCondition(String name)
Create an action condition
|
ActionCondition |
createActionCondition(String name,
Map<String,Serializable> params)
Create an action condition specifying the initial set of parameter values
|
org.alfresco.service.cmr.repository.NodeRef |
createActionNodeRef(Action action,
org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
org.alfresco.service.namespace.QName assocTypeName,
org.alfresco.service.namespace.QName assocName)
Create a action node reference
|
CompositeAction |
createCompositeAction()
Create a composite action
|
CompositeActionCondition |
createCompositeActionCondition()
Create a composite actionCondition
|
void |
directActionExecution(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Execute an action directly
|
boolean |
evaluateAction(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Evaluted the conditions set on an action.
|
boolean |
evaluateActionCondition(ActionCondition condition,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Evaluates the actions by finding corresponding actionEvaluators in
applicationContext (registered through Spring).
|
void |
executeAction(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
The actions conditions are always checked.
|
void |
executeAction(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
boolean checkConditions)
The action is executed based on the asynchronous attribute of the action.
|
void |
executeAction(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
boolean checkConditions,
boolean executeAsychronously)
Executes the specified action upon the node reference provided.
|
void |
executeActionImpl(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
boolean checkConditions,
boolean executedAsynchronously,
Set<String> actionChain)
Perform low-level action execution
|
Action |
getAction(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String actionId)
Gets an action stored against a given node reference.
|
ActionConditionDefinition |
getActionConditionDefinition(String name)
Get a named action condition definition
|
List<ActionConditionDefinition> |
getActionConditionDefinitions()
Get all the action condition definitions
|
ActionDefinition |
getActionDefinition(String name)
Get a named action definition
|
List<ActionDefinition> |
getActionDefinitions()
Get all the action definitions
|
List<ActionDefinition> |
getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get all the action definitions that are applicable for the given node, based on
its type and aspects.
|
List<Action> |
getActions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets all the actions currently saved on the given node reference.
|
CopyBehaviourCallback |
getCopyCallback(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Called for all types and aspects before copying a node.
|
ParameterConstraint |
getParameterConstraint(String name)
Get a named parameter constraint
|
List<ParameterConstraint> |
getParameterConstraints()
Get all the parameter constraints
|
void |
init() |
void |
onCopyComplete(org.alfresco.service.namespace.QName classRef,
org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef,
boolean copyToNewNode,
Map<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef> copyMap)
Ensures that d:noderef properties are repointed if the target was
also copied as part of the hierarchy.
|
boolean |
onLogException(Action action,
org.apache.commons.logging.Log logger,
Throwable t,
String message)
Optional logging of errors callback for the action executer
for the cases when the error might be ignored
or shown in a different manner for the action
|
void |
populateCompositeAction(org.alfresco.service.cmr.repository.NodeRef compositeNodeRef,
CompositeAction compositeAction)
Populates a composite action from a composite action node reference
|
void |
postCommit()
called by transaction service.
|
void |
registerActionConditionEvaluator(ActionConditionEvaluator actionConditionEvaluator)
Register an action condition evaluator
|
void |
registerActionExecuter(ActionExecuter actionExecuter)
Register an action executer
|
void |
registerAsynchronousActionExecutionQueue(String key,
AsynchronousActionExecutionQueue asyncExecQueue)
This method registers an
AsynchronousActionExecutionQueue with the ActionService. |
void |
registerParameterConstraint(ParameterConstraint parameterConstraint)
Register parameter constraint
|
void |
removeAction(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Action action)
Removes an action associated with a node reference.
|
void |
removeAllActions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Removes all actions associated with a node reference
|
void |
saveAction(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Action action)
Save an action against a node reference.
|
void |
saveActionImpl(org.alfresco.service.cmr.repository.NodeRef actionNodeRef,
Action action)
Save action, used internally to store the details of an action on the aciton node.
|
void |
setActionTrackingService(ActionTrackingService actionTrackingService)
Set the action tracking service
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Set the application context
|
void |
setAsynchronousActionExecutionQueues(Map<String,AsynchronousActionExecutionQueue> asynchronousActionExecutionQueues)
Deprecated.
Rather than inject a map, it is
preferable to inject individual
AsynchronousActionExecutionQueue instances
during bean initialisation in a spring init-method. |
void |
setAuthenticationContext(AuthenticationContext authenticationContext)
Set the authentication component
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service
|
void |
setMonitor(ActionServiceMonitor monitor) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set the search service
|
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - the application contextorg.springframework.beans.BeansExceptionpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService - the node servicepublic void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
searchService - the search servicepublic void setAuthenticationContext(AuthenticationContext authenticationContext)
authenticationContext - the authentication componentpublic void setActionTrackingService(ActionTrackingService actionTrackingService)
actionTrackingService - the action tracking servicepublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService - the dictionary servicepublic void setPolicyComponent(PolicyComponent policyComponent)
policyComponent - used to set up the action-based policy behaviourpublic void setMonitor(ActionServiceMonitor monitor)
monitor - used to monitor running actions and execution timespublic void setAsynchronousActionExecutionQueues(Map<String,AsynchronousActionExecutionQueue> asynchronousActionExecutionQueues)
AsynchronousActionExecutionQueue instances
during bean initialisation in a spring init-method.asynchronousActionExecutionQueues - the asynchronous action execution
queuespublic void registerAsynchronousActionExecutionQueue(String key, AsynchronousActionExecutionQueue asyncExecQueue)
AsynchronousActionExecutionQueue with the ActionService.key - StringasyncExecQueue - AsynchronousActionExecutionQueuepublic void init()
public ActionDefinition getActionDefinition(String name)
ActionServicegetActionDefinition in interface ActionServicename - the name of the action definitionActionService.getActionDefinition(java.lang.String)public List<ActionDefinition> getActionDefinitions()
ActionServicegetActionDefinitions in interface ActionServiceActionService.getActionDefinitions()public List<ActionDefinition> getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
ActionServicegetActionDefinitions in interface ActionServicenodeRef - the node referenceActionService.getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef)public ActionConditionDefinition getActionConditionDefinition(String name)
ActionServicegetActionConditionDefinition in interface ActionServicename - the name of the action condition definitionActionService.getActionConditionDefinition(java.lang.String)public List<ActionConditionDefinition> getActionConditionDefinitions()
ActionServicegetActionConditionDefinitions in interface ActionServiceActionService.getActionConditionDefinitions()public ParameterConstraint getParameterConstraint(String name)
ActionServicegetParameterConstraint in interface ActionServicename - the name of the parameter constraintActionService.getParameterConstraint(java.lang.String)public List<ParameterConstraint> getParameterConstraints()
ActionServicegetParameterConstraints in interface ActionServiceActionService.getParameterConstraints()public ActionCondition createActionCondition(String name)
ActionServicecreateActionCondition in interface ActionServicename - the action condition definition nameActionService.createActionCondition(java.lang.String)public ActionCondition createActionCondition(String name, Map<String,Serializable> params)
ActionServicecreateActionCondition in interface ActionServicename - the action condition definition nameparams - the parameter valuesActionService.createActionCondition(java.lang.String,
java.util.Map)public Action createAction(String name)
ActionServicecreateAction in interface ActionServicename - the action definition nameActionService.createAction(String)public Action createAction(String name, Map<String,Serializable> params)
ActionServicecreateAction in interface ActionServicename - the action definition nameparams - the parameter valuesActionService.createAction(java.lang.String,
java.util.Map)public CompositeAction createCompositeAction()
ActionServicecreateCompositeAction in interface ActionServiceActionService.createCompositeAction()public CompositeActionCondition createCompositeActionCondition()
ActionServicecreateCompositeActionCondition in interface ActionServiceActionService.createCompositeActionCondition()public boolean evaluateAction(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionServiceReturns true if the action has no conditions.
If the action has more than one condition their results are combined using the 'AND' logical operator.
evaluateAction in interface ActionServiceaction - the actionactionedUponNodeRef - the actioned upon node referenceActionService.evaluateAction(org.alfresco.service.cmr.action.Action,
org.alfresco.service.cmr.repository.NodeRef)public boolean evaluateActionCondition(ActionCondition condition, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
evaluateActionCondition in interface ActionServicecondition - the action conditionactionedUponNodeRef - the actioned upon node referenceActionService.evaluateActionCondition(org.alfresco.service.cmr.action.ActionCondition,
org.alfresco.service.cmr.repository.NodeRef)public void executeAction(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, boolean checkConditions)
ActionServiceexecuteAction in interface ActionServiceaction - the actionactionedUponNodeRef - the actioned upon node referencecheckConditions - indicates whether the conditions should be checkedActionService.executeAction(org.alfresco.service.cmr.action.Action,
org.alfresco.service.cmr.repository.NodeRef, boolean)public void executeAction(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, boolean checkConditions, boolean executeAsychronously)
ActionServiceIf specified that the conditions should be checked then any conditions set on the action are evaluated.
If the conditions fail then the action is not executed.
If an action has no conditions then the action will always be executed.
If the conditions are not checked then the action will always be executed.
executeAction in interface ActionServiceaction - the actionactionedUponNodeRef - the actioned upon node referencecheckConditions - indicates whether the conditions should be checked before
executing the actionexecuteAsychronously - indicates whether the action should be executed asychronously or not, this value overrides
the value set on the action its selfActionService.executeAction(org.alfresco.service.cmr.action.Action,
org.alfresco.service.cmr.repository.NodeRef, boolean)public void postCommit()
postCommit in interface RuntimeActionServicepublic void executeActionImpl(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, boolean checkConditions, boolean executedAsynchronously, Set<String> actionChain)
RuntimeActionServiceexecuteActionImpl in interface RuntimeActionServicepublic void directActionExecution(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
RuntimeActionServicedirectActionExecution in interface RuntimeActionServiceaction - the actionactionedUponNodeRef - the actioned upon node referenceRuntimeActionService.directActionExecution(org.alfresco.service.cmr.action.Action,
org.alfresco.service.cmr.repository.NodeRef)public void executeAction(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionServiceexecuteAction in interface ActionServiceaction - the actionactionedUponNodeRef - the actioned upon node referenceActionService.executeAction(org.alfresco.service.cmr.action.Action,
NodeRef)public void registerActionConditionEvaluator(ActionConditionEvaluator actionConditionEvaluator)
RuntimeActionServiceregisterActionConditionEvaluator in interface RuntimeActionServiceactionConditionEvaluator - action condition evaluatorRuntimeActionService.registerActionConditionEvaluator(org.alfresco.repo.action.evaluator.ActionConditionEvaluator)public void registerActionExecuter(ActionExecuter actionExecuter)
RuntimeActionServiceregisterActionExecuter in interface RuntimeActionServiceactionExecuter - action executerRuntimeActionService.registerActionExecuter(org.alfresco.repo.action.executer.ActionExecuter)public void registerParameterConstraint(ParameterConstraint parameterConstraint)
RuntimeActionServiceregisterParameterConstraint in interface RuntimeActionServiceparameterConstraint - parameter constraintRuntimeActionService.registerParameterConstraint(org.alfresco.service.cmr.action.ParameterConstraint)public void saveAction(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Action action)
ActionServiceThe node will be made configurable if it is not already.
If the action already exists then its details will be updated.
saveAction in interface ActionServicenodeRef - the node referenceaction - the actionActionService.saveAction(org.alfresco.service.cmr.repository.NodeRef,
org.alfresco.service.cmr.action.Action)public org.alfresco.service.cmr.repository.NodeRef createActionNodeRef(Action action, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName assocTypeName, org.alfresco.service.namespace.QName assocName)
RuntimeActionServicecreateActionNodeRef in interface RuntimeActionServiceaction - action objectparentNodeRef - parent node referenceassocTypeName - association type nameassocName - association namepublic void saveActionImpl(org.alfresco.service.cmr.repository.NodeRef actionNodeRef,
Action action)
RuntimeActionServicesaveActionImpl in interface RuntimeActionServiceactionNodeRef - the action node referenceaction - the actionRuntimeActionService.saveActionImpl(org.alfresco.service.cmr.repository.NodeRef,
org.alfresco.service.cmr.action.Action)public List<Action> getActions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
ActionServicegetActions in interface ActionServicenodeRef - the node referenceActionService.getActions(org.alfresco.service.cmr.repository.NodeRef)public Action createAction(org.alfresco.service.cmr.repository.NodeRef actionNodeRef)
createAction in interface RuntimeActionServiceactionNodeRef - the action node referencepublic void populateCompositeAction(org.alfresco.service.cmr.repository.NodeRef compositeNodeRef,
CompositeAction compositeAction)
compositeNodeRef - the composite action node referencecompositeAction - the composite actionpublic Action getAction(org.alfresco.service.cmr.repository.NodeRef nodeRef, String actionId)
ActionServiceReturns null if the action can not be found.
getAction in interface ActionServicenodeRef - the node referenceactionId - the action idActionService.getAction(org.alfresco.service.cmr.repository.NodeRef,
java.lang.String)public void removeAction(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Action action)
ActionServiceremoveAction in interface ActionServicenodeRef - the node referenceaction - the actionActionService.removeAction(org.alfresco.service.cmr.repository.NodeRef,
org.alfresco.service.cmr.action.Action)public void removeAllActions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
ActionServiceremoveAllActions in interface ActionServicenodeRef - the node referenceActionService.removeAllActions(org.alfresco.service.cmr.repository.NodeRef)public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicygetCopyCallback in interface CopyServicePolicies.OnCopyNodePolicyclassRef - the type or aspect qualified namecopyDetails - the details of the impending copyCopyBehaviourCallbackCopyServicePoliciespublic void onCopyComplete(org.alfresco.service.namespace.QName classRef,
org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef,
boolean copyToNewNode,
Map<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef> copyMap)
onCopyComplete in interface CopyServicePolicies.OnCopyCompletePolicyclassRef - the type of the node that was copiedsourceNodeRef - the original nodetargetNodeRef - the destination nodecopyMap - a map containing all the nodes that have been created during the copypublic boolean onLogException(Action action, org.apache.commons.logging.Log logger, Throwable t, String message)
RuntimeActionServiceonLogException in interface RuntimeActionServiceaction - the actionlogger - the loggert - the exception thrownmessage - the proposed message that will be loggedCopyright © 2005–2018 Alfresco Software. All rights reserved.