Class WorkflowProvider
- java.lang.Object
-
- org.ametys.plugins.workflow.support.WorkflowProvider
-
- All Implemented Interfaces:
Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
- Direct Known Subclasses:
WebWorkflowProvider
public class WorkflowProvider extends Object implements Component, Serviceable, Contextualizable, Initializable, Disposable
Component able to provide several workflow objects.- The generic workflow: A standalone workflow which can be used for various purposes. All entries are stored under a global workflow root node in the JCR repository.
- Dedicated ametys object workflows: A workflow specific to an ametys object. The workflow is stored under the ametys object node the JCR repository.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkflowProvider.AmetysObjectWorkflow
Local workflow to an ametys objectstatic class
WorkflowProvider.ExternalWorkflow
The External worklfowstatic class
WorkflowProvider.GenericWorkflow
The Generic worklfow
-
Field Summary
Fields Modifier and Type Field Description protected Context
_cocoonContext
Cocoon contextprotected CurrentUserProvider
_currentUserProvider
Current user provider.protected WorkflowProvider.GenericWorkflow
_genericWorkflow
Generic workflow instanceprotected static org.slf4j.Logger
_logger
Logger available to subclasses.protected ServiceManager
_manager
Service manager.protected Repository
_repository
The repositoryprotected SourceResolver
_resolver
The source resolverprotected com.opensymphony.workflow.TypeResolver
_typeResolver
Type resolverprotected com.opensymphony.workflow.WorkflowContext
_workflowContext
Workflow contextprotected com.opensymphony.workflow.loader.WorkflowFactory
_workflowFactory
Workflow factoryprotected WorkflowHelper
_workflowHelper
The workflow helperstatic String
ROLE
Avalon role.
-
Constructor Summary
Constructors Constructor Description WorkflowProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AmetysObjectWorkflowStore
_createAmetysObjectWorkflowStore(WorkflowAwareAmetysObject ametysObject, boolean preserveHistory)
Provide an ametys object workflow store instanceprotected GenericWorkflowStore
_createGenericWorkflowStore()
Provide the generic workflow storevoid
contextualize(Context ctx)
void
dispose()
WorkflowProvider.AmetysObjectWorkflow
getAmetysObjectWorkflow()
Provide a local workflow to an Ametys object which do not preserve history on workflow complete Must be used to initialize a workflow that will create an ametys object.WorkflowProvider.AmetysObjectWorkflow
getAmetysObjectWorkflow(boolean preserveHistory)
Provide a local workflow to an Ametys object Must be used to initialize a workflow that will create an ametys object.WorkflowProvider.AmetysObjectWorkflow
getAmetysObjectWorkflow(WorkflowAwareAmetysObject ametysObject)
Provide a local workflow to an Ametys object which do not preserve history on workflow completeWorkflowProvider.AmetysObjectWorkflow
getAmetysObjectWorkflow(WorkflowAwareAmetysObject ametysObject, boolean preserveHistory)
Provide a local workflow to an Ametys objectcom.opensymphony.workflow.Workflow
getExternalWorkflow(com.opensymphony.workflow.spi.WorkflowStore workflowStore)
Provides an external workflowcom.opensymphony.workflow.Workflow
getExternalWorkflow(String workflowStoreRole)
Provides an external workflowcom.opensymphony.workflow.Workflow
getGenericWorkflow()
Provides the generic workflowvoid
initialize()
void
service(ServiceManager manager)
-
-
-
Field Detail
-
_logger
protected static org.slf4j.Logger _logger
Logger available to subclasses.
-
_manager
protected ServiceManager _manager
Service manager.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
Current user provider.
-
_repository
protected Repository _repository
The repository
-
_workflowHelper
protected WorkflowHelper _workflowHelper
The workflow helper
-
_cocoonContext
protected Context _cocoonContext
Cocoon context
-
_workflowContext
protected com.opensymphony.workflow.WorkflowContext _workflowContext
Workflow context
-
_workflowFactory
protected com.opensymphony.workflow.loader.WorkflowFactory _workflowFactory
Workflow factory
-
_typeResolver
protected com.opensymphony.workflow.TypeResolver _typeResolver
Type resolver
-
_genericWorkflow
protected WorkflowProvider.GenericWorkflow _genericWorkflow
Generic workflow instance
-
_resolver
protected SourceResolver _resolver
The source resolver
-
-
Constructor Detail
-
WorkflowProvider
public WorkflowProvider()
-
-
Method Detail
-
contextualize
public void contextualize(Context ctx) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
getGenericWorkflow
public com.opensymphony.workflow.Workflow getGenericWorkflow()
Provides the generic workflow- Returns:
- The generic workflow
-
_createGenericWorkflowStore
protected GenericWorkflowStore _createGenericWorkflowStore()
Provide the generic workflow store- Returns:
- The generic workflow store
-
getAmetysObjectWorkflow
public WorkflowProvider.AmetysObjectWorkflow getAmetysObjectWorkflow()
Provide a local workflow to an Ametys object which do not preserve history on workflow complete Must be used to initialize a workflow that will create an ametys object.WorkflowProvider.AmetysObjectWorkflow.getAmetysObject()
could then be used to directly retrieves the ametys object.- Returns:
- The local workflow
-
getAmetysObjectWorkflow
public WorkflowProvider.AmetysObjectWorkflow getAmetysObjectWorkflow(boolean preserveHistory)
Provide a local workflow to an Ametys object Must be used to initialize a workflow that will create an ametys object.WorkflowProvider.AmetysObjectWorkflow.getAmetysObject()
could then be used to directly retrieves the ametys object.- Parameters:
preserveHistory
- true if the history should be preserve when workflow is complete- Returns:
- The local workflow
-
getAmetysObjectWorkflow
public WorkflowProvider.AmetysObjectWorkflow getAmetysObjectWorkflow(WorkflowAwareAmetysObject ametysObject)
Provide a local workflow to an Ametys object which do not preserve history on workflow complete- Parameters:
ametysObject
- The ametys object (can be null in case of initialization)- Returns:
- the local workflow to an Ametys object
-
getAmetysObjectWorkflow
public WorkflowProvider.AmetysObjectWorkflow getAmetysObjectWorkflow(WorkflowAwareAmetysObject ametysObject, boolean preserveHistory)
Provide a local workflow to an Ametys object- Parameters:
ametysObject
- The ametys object (can be null in case of initialization)preserveHistory
- true if the history steps should be preserve when workflow is complete- Returns:
- the local workflow to an Ametys object
-
_createAmetysObjectWorkflowStore
protected AmetysObjectWorkflowStore _createAmetysObjectWorkflowStore(WorkflowAwareAmetysObject ametysObject, boolean preserveHistory)
Provide an ametys object workflow store instance- Parameters:
ametysObject
- The ametys object bound to this store (can be null in case of initialization)preserveHistory
- true if the history steps should be preserve when workflow is complete- Returns:
- the local workflow store of an Ametys object
-
getExternalWorkflow
public com.opensymphony.workflow.Workflow getExternalWorkflow(String workflowStoreRole)
Provides an external workflow- Parameters:
workflowStoreRole
- The component role of the workflow store to use.- Returns:
- The external workflow
-
getExternalWorkflow
public com.opensymphony.workflow.Workflow getExternalWorkflow(com.opensymphony.workflow.spi.WorkflowStore workflowStore)
Provides an external workflow- Parameters:
workflowStore
- An (already initialized) workflow store- Returns:
- The external workflow
-
-