Package org.ametys.cms.workflow
Class ContentWorkflowAction
- All Implemented Interfaces:
Initializable,Component,LogEnabled,Serviceable,Action
- Direct Known Subclasses:
ArchiveContentAction,UnarchiveContentAction
Action for firing a transition on a content's workflow.
The following parameters are supported:
- actionId
- the id of the action to fire
-
Field Summary
FieldsFields inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_workflowProviderFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map_act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs) Initialize or act on a workflow instance.protected WorkflowAwareContent_getContent(Map objectModel) Retrieve the content to use.protected long_getCurrentStep(Map objectModel) Get the content current stepprotected String_getExceptionContext(Map objectModel, String source, Parameters parameters) Provides the exception context for a more friendly error message._getInputs(Redirector redirector, Map objectModel, String source, Parameters parameters) Provide the inputs to use.protected UserIdentityRetrieve the user responsible of the call.protected long_getWorkflowId(Map objectModel, String source, Parameters parameters) Provide the workflow id.protected Map_processWorkflowException(Redirector redirector, Map objectModel, String source, Parameters parameters, long actionId, com.opensymphony.workflow.WorkflowException e) Called when the current action has thrown aWorkflowException.voidMethods inherited from class org.ametys.plugins.workflow.cocoon.WorkflowAction
_getActionResultMethods inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_getActionId, _getFailConditions, _getWorkflowErrors, _getWorkflowWarns, _processInvalidActionException, actMethods inherited from class org.apache.cocoon.acting.ServiceableAction
serviceMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_userProvider
Component to get the current user
-
-
Constructor Details
-
ContentWorkflowAction
public ContentWorkflowAction()
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAbstractWorkflowAction- Throws:
Exception
-
_act
protected Map _act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs) throws com.opensymphony.workflow.InvalidInputException, com.opensymphony.workflow.WorkflowException Description copied from class:AbstractWorkflowActionInitialize or act on a workflow instance.- Overrides:
_actin classWorkflowAction- Parameters:
redirector- the redirector.objectModel- the current object model.source- the current source.parameters- the current parameters.actionId- the action id to use.inputs- the inputs to use- Returns:
- the action result.
- Throws:
com.opensymphony.workflow.InvalidInputException- if the action id is not valid.com.opensymphony.workflow.WorkflowException- if the action failed.
-
_getWorkflowId
Description copied from class:WorkflowActionProvide the workflow id.Default implementation uses parameter
workflowId.- Overrides:
_getWorkflowIdin classWorkflowAction- Parameters:
objectModel- the current object model.source- the current source.parameters- the current parameters.- Returns:
- the workflow id.
-
_getInputs
protected Map<String,Object> _getInputs(Redirector redirector, Map objectModel, String source, Parameters parameters) throws Exception Description copied from class:AbstractWorkflowActionProvide the inputs to use. Default implementation provide the redirector.- Overrides:
_getInputsin classAbstractWorkflowAction- Parameters:
redirector- the redirector.objectModel- the current object model.source- the current source.parameters- the current parameters.- Returns:
- the inputs to use.
- Throws:
Exception- if an error occurs.
-
_getContent
Retrieve the content to use.- Parameters:
objectModel- the object model.- Returns:
- the content found.
-
_getUser
Retrieve the user responsible of the call.- Parameters:
objectModel- the object model.- Returns:
- the user responsible of the call.
-
_processWorkflowException
protected Map _processWorkflowException(Redirector redirector, Map objectModel, String source, Parameters parameters, long actionId, com.opensymphony.workflow.WorkflowException e) throws Exception Description copied from class:AbstractWorkflowActionCalled when the current action has thrown aWorkflowException. Default implementation throw an exception.- Overrides:
_processWorkflowExceptionin classAbstractWorkflowAction- Parameters:
redirector- the redirector.objectModel- the current object model.source- the current source.parameters- the current parameters.actionId- the invalid action id.e- the workflow exception.- Returns:
- the action result.
- Throws:
Exception- in order to stop the current pipeline.
-
_getExceptionContext
Description copied from class:AbstractWorkflowActionProvides the exception context for a more friendly error message.- Overrides:
_getExceptionContextin classWorkflowAction- Parameters:
objectModel- the current object model.source- the current source.parameters- the current parameters.- Returns:
- the message describing the exception context.
-
_getCurrentStep
Get the content current step- Parameters:
objectModel- The object model- Returns:
- The content current step as
-