Package org.dspace.xmlworkflow
Class XmlWorkflowFactoryImpl
- java.lang.Object
-
- org.dspace.xmlworkflow.XmlWorkflowFactoryImpl
-
- All Implemented Interfaces:
XmlWorkflowFactory
public class XmlWorkflowFactoryImpl extends Object implements XmlWorkflowFactory
The workflowfactory is responsible for parsing the workflow xml file and is used to retrieve info about the workflow: - the workflow for a certain collection - collections mapped to a certain workflow - collections not mapped to any workflow - configured workflows and the default workflow - workflow action by name- Author:
- Bram De Schouwer (bram.deschouwer at dot com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com), Maria Verdonck (Atmire) on 11/12/2019
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionServicecollectionServiceprotected HandleServicehandleServicestatic StringLEGACY_WORKFLOW_NAME
-
Constructor Summary
Constructors Constructor Description XmlWorkflowFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowActionConfiggetActionByName(String workflowActionName)Retrieves aWorkflowActionConfigobject based on its name, should correspond with bean id in workflow-actions.xmlList<Workflow>getAllConfiguredWorkflows()Creates a list of all configured workflows, or returns the cache of this if it was already createdList<Collection>getAllNonMappedCollectionsHandles(Context context)Returns list of collections that are not mapped to any configured workflow, and thus use the default workflowList<Collection>getCollectionHandlesMappedToWorklow(Context context, String workflowName)Return a list of collections that are mapped to the given workflow in the workflow configuration.WorkflowgetDefaultWorkflow()Gets the default workflow, i.e.StepgetStepByName(String workflowStepName)Retrieves aStepobject based on its name, should correspond with bean id in workflow.xmlWorkflowgetWorkflow(Collection collection)Retrieve the workflow configuration for a single collectionWorkflowgetWorkflowByName(String workflowName)Retrieves the workflow configuration by namebooleanisDefaultWorkflow(String workflowName)Check to see if the given workflowName is the workflow configured to be default for collectionsvoidsetWorkflowMapping(Map<String,Workflow> workflowMapping)booleanworkflowByThisNameExists(String workflowName)Check to see if there is a workflow configured by the given name
-
-
-
Field Detail
-
LEGACY_WORKFLOW_NAME
public static final String LEGACY_WORKFLOW_NAME
- See Also:
- Constant Field Values
-
collectionService
@Autowired protected CollectionService collectionService
-
handleService
@Autowired protected HandleService handleService
-
-
Method Detail
-
getWorkflow
public Workflow getWorkflow(Collection collection) throws WorkflowConfigurationException
Description copied from interface:XmlWorkflowFactoryRetrieve the workflow configuration for a single collection- Specified by:
getWorkflowin interfaceXmlWorkflowFactory- Parameters:
collection- the collection for which we want our workflow- Returns:
- the workflow configuration
- Throws:
WorkflowConfigurationException- occurs if there is a configuration error in the workflow
-
getWorkflowByName
public Workflow getWorkflowByName(String workflowName) throws WorkflowConfigurationException
Description copied from interface:XmlWorkflowFactoryRetrieves the workflow configuration by name- Specified by:
getWorkflowByNamein interfaceXmlWorkflowFactory- Parameters:
workflowName- the name for which we want our workflow- Returns:
- the workflow configuration
- Throws:
WorkflowConfigurationException- occurs if there is no workflow configured by that name
-
getDefaultWorkflow
public Workflow getDefaultWorkflow()
Description copied from interface:XmlWorkflowFactoryGets the default workflow, i.e. the workflow that is mapped to collection=default in workflow.xml- Specified by:
getDefaultWorkflowin interfaceXmlWorkflowFactory
-
getAllConfiguredWorkflows
public List<Workflow> getAllConfiguredWorkflows()
Description copied from interface:XmlWorkflowFactoryCreates a list of all configured workflows, or returns the cache of this if it was already created- Specified by:
getAllConfiguredWorkflowsin interfaceXmlWorkflowFactory- Returns:
- List of all configured workflows
-
getCollectionHandlesMappedToWorklow
public List<Collection> getCollectionHandlesMappedToWorklow(Context context, String workflowName)
Description copied from interface:XmlWorkflowFactoryReturn a list of collections that are mapped to the given workflow in the workflow configuration. * Makes use of a cache so it only retrieves the workflowName->Listif it's not cached - Specified by:
getCollectionHandlesMappedToWorklowin interfaceXmlWorkflowFactory- Parameters:
context- Dspace contextworkflowName- Name of workflow we want the collections of that are mapped to is- Returns:
- List of collections mapped to the requested workflow
-
getAllNonMappedCollectionsHandles
public List<Collection> getAllNonMappedCollectionsHandles(Context context)
Description copied from interface:XmlWorkflowFactoryReturns list of collections that are not mapped to any configured workflow, and thus use the default workflow- Specified by:
getAllNonMappedCollectionsHandlesin interfaceXmlWorkflowFactory- Returns:
- List of collections not mapped to any workflow
-
workflowByThisNameExists
public boolean workflowByThisNameExists(String workflowName)
Description copied from interface:XmlWorkflowFactoryCheck to see if there is a workflow configured by the given name- Specified by:
workflowByThisNameExistsin interfaceXmlWorkflowFactory- Parameters:
workflowName- Name of a possible configured workflow- Returns:
- True if there is a workflow configured by this name, false otherwise
-
isDefaultWorkflow
public boolean isDefaultWorkflow(String workflowName)
Description copied from interface:XmlWorkflowFactoryCheck to see if the given workflowName is the workflow configured to be default for collections- Specified by:
isDefaultWorkflowin interfaceXmlWorkflowFactory- Parameters:
workflowName- Name of workflow to check if default- Returns:
- True if given workflowName is the workflow mapped to default for collections, otherwise false
-
getActionByName
public WorkflowActionConfig getActionByName(String workflowActionName)
Description copied from interface:XmlWorkflowFactoryRetrieves aWorkflowActionConfigobject based on its name, should correspond with bean id in workflow-actions.xml- Specified by:
getActionByNamein interfaceXmlWorkflowFactory- Parameters:
workflowActionName- Name of workflow action we want to retrieve- Returns:
- Workflow action object corresponding to the given workflowActionName
-
getStepByName
public Step getStepByName(String workflowStepName)
Description copied from interface:XmlWorkflowFactoryRetrieves aStepobject based on its name, should correspond with bean id in workflow.xml- Specified by:
getStepByNamein interfaceXmlWorkflowFactory- Parameters:
workflowStepName- Name of workflow step we want to retrieve- Returns:
- Workflow step object corresponding to the given workflowStepName
-
-