Package org.ametys.cms.workflow
Class InitializeContentWorkflowAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
-
- org.ametys.plugins.workflow.cocoon.InitializeWorkflowAction
-
- org.ametys.cms.workflow.InitializeContentWorkflowAction
-
- All Implemented Interfaces:
Initializable
,Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
AddOrgUnitAction
public class InitializeContentWorkflowAction extends InitializeWorkflowAction
Action for initializing a transition on a content's workflow.The following parameters are supported:
- workflowName
- the name of the workflow to instantiate
- actionId
- the id of the action to fire
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__CONTENT_TYPE_KEY
Constant for storing the content type to use into the transient variables map.private static String
_CONTENT_MIXINS_KEY
Constant for storing the content type to use into the transient variables map.private static String
REQUEST_PARAMETER_PREFIX
-
Fields inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_workflowProvider
-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description InitializeContentWorkflowAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map
_act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs)
Initialize or act on a workflow instance.protected Map<String,Object>
_getInputs(Redirector redirector, Map objectModel, String source, Parameters parameters)
Provide the inputs to use.protected Map<String,Object>
_getParameters(Map objectModel)
Return a map of parameters needed by the workflow that will create the contentprotected String
_getWorkflowName(Map objectModel, String source, Parameters parameters)
Provides the workflow name to use.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
.-
Methods inherited from class org.ametys.plugins.workflow.cocoon.InitializeWorkflowAction
_getActionResult, _getExceptionContext
-
Methods inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_getActionId, _getFailConditions, _getWorkflowErrors, _getWorkflowWarns, _processInvalidActionException, act, initialize
-
Methods inherited from class org.apache.cocoon.acting.ServiceableAction
service
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
__CONTENT_TYPE_KEY
private static final String __CONTENT_TYPE_KEY
Constant for storing the content type to use into the transient variables map.
-
_CONTENT_MIXINS_KEY
private static final String _CONTENT_MIXINS_KEY
Constant for storing the content type to use into the transient variables map.
-
REQUEST_PARAMETER_PREFIX
private static final String REQUEST_PARAMETER_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InitializeContentWorkflowAction
public InitializeContentWorkflowAction()
-
-
Method Detail
-
_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:AbstractWorkflowAction
Initialize or act on a workflow instance.- Overrides:
_act
in classInitializeWorkflowAction
- 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.
-
_getInputs
protected Map<String,Object> _getInputs(Redirector redirector, Map objectModel, String source, Parameters parameters) throws Exception
Description copied from class:AbstractWorkflowAction
Provide the inputs to use.Default implementation provide the redirector.
- Overrides:
_getInputs
in 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.
-
_getWorkflowName
protected String _getWorkflowName(Map objectModel, String source, Parameters parameters)
Description copied from class:InitializeWorkflowAction
Provides the workflow name to use.- Overrides:
_getWorkflowName
in classInitializeWorkflowAction
- Parameters:
objectModel
- the current object model.source
- the current source.parameters
- the current parameters.- Returns:
- the workflow name.
-
_getParameters
protected Map<String,Object> _getParameters(Map objectModel)
Return a map of parameters needed by the workflow that will create the content- Parameters:
objectModel
- The cocoon object model- Returns:
- the map with parameters
-
_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:AbstractWorkflowAction
Called when the current action has thrown aWorkflowException
.Default implementation throw an exception.
- Overrides:
_processWorkflowException
in 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.
-
-