public class ActionServiceImpl extends Object implements ActionService, RuntimeActionService, org.springframework.context.ApplicationContextAware, CopyServicePolicies.OnCopyNodePolicy, CopyServicePolicies.OnCopyCompletePolicy
Policy.Arg
ARG_0, ARG_1, QNAME
QNAME
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.ApplicationContextAware
applicationContext
- the application contextorg.springframework.beans.BeansException
public 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)
ActionService
getActionDefinition
in interface ActionService
name
- the name of the action definitionActionService.getActionDefinition(java.lang.String)
public List<ActionDefinition> getActionDefinitions()
ActionService
getActionDefinitions
in interface ActionService
ActionService.getActionDefinitions()
public List<ActionDefinition> getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
ActionService
getActionDefinitions
in interface ActionService
nodeRef
- the node referenceActionService.getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef)
public ActionConditionDefinition getActionConditionDefinition(String name)
ActionService
getActionConditionDefinition
in interface ActionService
name
- the name of the action condition definitionActionService.getActionConditionDefinition(java.lang.String)
public List<ActionConditionDefinition> getActionConditionDefinitions()
ActionService
getActionConditionDefinitions
in interface ActionService
ActionService.getActionConditionDefinitions()
public ParameterConstraint getParameterConstraint(String name)
ActionService
getParameterConstraint
in interface ActionService
name
- the name of the parameter constraintActionService.getParameterConstraint(java.lang.String)
public List<ParameterConstraint> getParameterConstraints()
ActionService
getParameterConstraints
in interface ActionService
ActionService.getParameterConstraints()
public ActionCondition createActionCondition(String name)
ActionService
createActionCondition
in interface ActionService
name
- the action condition definition nameActionService.createActionCondition(java.lang.String)
public ActionCondition createActionCondition(String name, Map<String,Serializable> params)
ActionService
createActionCondition
in interface ActionService
name
- the action condition definition nameparams
- the parameter valuesActionService.createActionCondition(java.lang.String,
java.util.Map)
public Action createAction(String name)
ActionService
createAction
in interface ActionService
name
- the action definition nameActionService.createAction(String)
public Action createAction(String name, Map<String,Serializable> params)
ActionService
createAction
in interface ActionService
name
- the action definition nameparams
- the parameter valuesActionService.createAction(java.lang.String,
java.util.Map)
public CompositeAction createCompositeAction()
ActionService
createCompositeAction
in interface ActionService
ActionService.createCompositeAction()
public CompositeActionCondition createCompositeActionCondition()
ActionService
createCompositeActionCondition
in interface ActionService
ActionService.createCompositeActionCondition()
public boolean evaluateAction(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionService
Returns 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 ActionService
action
- 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 ActionService
condition
- 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)
ActionService
executeAction
in interface ActionService
action
- 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)
ActionService
If 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 ActionService
action
- 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 RuntimeActionService
public void executeActionImpl(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, boolean checkConditions, boolean executedAsynchronously, Set<String> actionChain)
RuntimeActionService
executeActionImpl
in interface RuntimeActionService
public void directActionExecution(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
RuntimeActionService
directActionExecution
in interface RuntimeActionService
action
- 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)
ActionService
executeAction
in interface ActionService
action
- the actionactionedUponNodeRef
- the actioned upon node referenceActionService.executeAction(org.alfresco.service.cmr.action.Action,
NodeRef)
public void registerActionConditionEvaluator(ActionConditionEvaluator actionConditionEvaluator)
RuntimeActionService
registerActionConditionEvaluator
in interface RuntimeActionService
actionConditionEvaluator
- action condition evaluatorRuntimeActionService.registerActionConditionEvaluator(org.alfresco.repo.action.evaluator.ActionConditionEvaluator)
public void registerActionExecuter(ActionExecuter actionExecuter)
RuntimeActionService
registerActionExecuter
in interface RuntimeActionService
actionExecuter
- action executerRuntimeActionService.registerActionExecuter(org.alfresco.repo.action.executer.ActionExecuter)
public void registerParameterConstraint(ParameterConstraint parameterConstraint)
RuntimeActionService
registerParameterConstraint
in interface RuntimeActionService
parameterConstraint
- parameter constraintRuntimeActionService.registerParameterConstraint(org.alfresco.service.cmr.action.ParameterConstraint)
public void saveAction(org.alfresco.service.cmr.repository.NodeRef nodeRef, Action action)
ActionService
The node will be made configurable if it is not already.
If the action already exists then its details will be updated.
saveAction
in interface ActionService
nodeRef
- 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)
RuntimeActionService
createActionNodeRef
in interface RuntimeActionService
action
- action objectparentNodeRef
- parent node referenceassocTypeName
- association type nameassocName
- association namepublic void saveActionImpl(org.alfresco.service.cmr.repository.NodeRef actionNodeRef, Action action)
RuntimeActionService
saveActionImpl
in interface RuntimeActionService
actionNodeRef
- 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)
ActionService
getActions
in interface ActionService
nodeRef
- the node referenceActionService.getActions(org.alfresco.service.cmr.repository.NodeRef)
public Action createAction(org.alfresco.service.cmr.repository.NodeRef actionNodeRef)
createAction
in interface RuntimeActionService
actionNodeRef
- 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)
ActionService
Returns null if the action can not be found.
getAction
in interface ActionService
nodeRef
- 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)
ActionService
removeAction
in interface ActionService
nodeRef
- 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)
ActionService
removeAllActions
in interface ActionService
nodeRef
- the node referenceActionService.removeAllActions(org.alfresco.service.cmr.repository.NodeRef)
public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicy
getCopyCallback
in interface CopyServicePolicies.OnCopyNodePolicy
classRef
- the type or aspect qualified namecopyDetails
- the details of the impending copyCopyBehaviourCallback
CopyServicePolicies
public 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.OnCopyCompletePolicy
classRef
- 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)
RuntimeActionService
onLogException
in interface RuntimeActionService
action
- the actionlogger
- the loggert
- the exception thrownmessage
- the proposed message that will be loggedCopyright © 2005–2017 Alfresco Software. All rights reserved.