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
Modifier and TypeClassDescriptionstatic class
Local workflow to an ametys objectstatic class
The External worklfowstatic class
The Generic worklfow -
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolverprotected Context
Cocoon contextprotected CurrentUserProvider
Current user provider.protected WorkflowProvider.GenericWorkflow
Generic workflow instanceprotected static Logger
Logger available to subclasses.protected ServiceManager
Service manager.protected javax.jcr.Repository
The repositoryprotected SourceResolver
The source resolverprotected com.opensymphony.workflow.TypeResolver
Type resolverprotected com.opensymphony.workflow.WorkflowContext
Workflow contextprotected com.opensymphony.workflow.loader.WorkflowFactory
Workflow factoryprotected WorkflowHelper
The workflow helperstatic final String
Avalon role. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AmetysObjectWorkflowStore
_createAmetysObjectWorkflowStore
(WorkflowAwareAmetysObject ametysObject, boolean preserveHistory) Provide an ametys object workflow store instanceprotected GenericWorkflowStore
Provide the generic workflow storevoid
contextualize
(Context ctx) void
dispose()
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.getAmetysObjectWorkflow
(boolean preserveHistory) Provide a local workflow to an Ametys object Must be used to initialize a workflow that will create an ametys object.getAmetysObjectWorkflow
(WorkflowAwareAmetysObject ametysObject) Provide a local workflow to an Ametys object which do not preserve history on workflow completegetAmetysObjectWorkflow
(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
Provides the generic workflowvoid
void
service
(ServiceManager manager)
-
Field Details
-
ROLE
Avalon role. -
_logger
Logger available to subclasses. -
_manager
Service manager. -
_currentUserProvider
Current user provider. -
_repository
The repository -
_workflowHelper
The workflow helper -
_cocoonContext
Cocoon context -
_workflowContext
Workflow context -
_workflowFactory
Workflow factory -
_typeResolver
Type resolver -
_genericWorkflow
Generic workflow instance -
_resolver
The source resolver -
_ametysObjectResolver
The ametys object resolver
-
-
Constructor Details
-
WorkflowProvider
public WorkflowProvider()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
getGenericWorkflow
Provides the generic workflow- Returns:
- The generic workflow
-
_createGenericWorkflowStore
Provide the generic workflow store- Returns:
- The generic workflow store
-
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
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
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
-