Package org.dspace.curate
Class WorkflowCuratorServiceImpl
- java.lang.Object
-
- org.dspace.curate.WorkflowCuratorServiceImpl
-
- All Implemented Interfaces:
WorkflowCuratorService
public class WorkflowCuratorServiceImpl extends Object implements WorkflowCuratorService
WorkflowCurator manages interactions between curation and workflow. Specifically, it is invoked in WorkflowManager to allow the performance of curation tasks during workflow.- Author:
- richardrodgers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classWorkflowCuratorServiceImpl.FlowStepprotected classWorkflowCuratorServiceImpl.Taskprotected classWorkflowCuratorServiceImpl.TaskSet
-
Field Summary
Fields Modifier and Type Field Description protected BasicWorkflowItemServicebasicWorkflowItemServiceprotected BasicWorkflowServicebasicWorkflowServiceprotected CollectionServicecollectionServiceprotected ConfigurationServiceconfigurationServiceprotected EPersonServiceePersonServiceprotected String[]flowStepsprotected GroupServicegroupServiceprotected Map<String,WorkflowCuratorServiceImpl.TaskSet>tsMapprotected WorkflowServiceFactoryworkflowServiceFactory
-
Constructor Summary
Constructors Modifier Constructor Description protectedWorkflowCuratorServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancurate(Curator curator, Context c, String wfId)Determines and executes curation of a Workflow item.booleancurate(Curator curator, Context c, BasicWorkflowItem wfi)Determines and executes curation of a Workflow item.booleandoCuration(Context c, BasicWorkflowItem wfi)Determines and executes curation on a Workflow item.protected WorkflowCuratorServiceImpl.FlowStepgetFlowStep(BasicWorkflowItem wfi)voidinit()Initialize the bean (after dependency injection has already taken place).protected voidloadTaskConfig(File cfgFile)booleanneedsCuration(BasicWorkflowItem wfi)protected voidnotifyContacts(Context c, BasicWorkflowItem wfi, WorkflowCuratorServiceImpl.Task task, String status, String action, String message)protected List<EPerson>resolveContacts(Context c, List<String> contacts, BasicWorkflowItem wfi)protected intstate2step(int state)protected intstepName2step(String name)
-
-
-
Field Detail
-
tsMap
protected Map<String,WorkflowCuratorServiceImpl.TaskSet> tsMap
-
flowSteps
protected final String[] flowSteps
-
collectionService
@Autowired(required=true) protected CollectionService collectionService
-
ePersonService
@Autowired(required=true) protected EPersonService ePersonService
-
groupService
@Autowired(required=true) protected GroupService groupService
-
basicWorkflowItemService
protected BasicWorkflowItemService basicWorkflowItemService
-
basicWorkflowService
protected BasicWorkflowService basicWorkflowService
-
workflowServiceFactory
@Autowired(required=true) protected WorkflowServiceFactory workflowServiceFactory
-
configurationService
@Autowired(required=true) protected ConfigurationService configurationService
-
-
Method Detail
-
init
public void init() throws ExceptionInitialize the bean (after dependency injection has already taken place). Ensures the configurationService is injected, so that we can read the settings from configuration Called by "init-method" in Spring config.- Throws:
Exception- ...
-
needsCuration
public boolean needsCuration(BasicWorkflowItem wfi)
- Specified by:
needsCurationin interfaceWorkflowCuratorService
-
doCuration
public boolean doCuration(Context c, BasicWorkflowItem wfi) throws AuthorizeException, IOException, SQLException
Description copied from interface:WorkflowCuratorServiceDetermines and executes curation on a Workflow item.- Specified by:
doCurationin interfaceWorkflowCuratorService- Parameters:
c- the contextwfi- the workflow item- Returns:
- true if curation was completed or not required, false if tasks were queued for later completion, or item was rejected
- Throws:
AuthorizeException- if authorization errorIOException- if IO errorSQLException- if database error
-
curate
public boolean curate(Curator curator, Context c, String wfId) throws AuthorizeException, IOException, SQLException
Description copied from interface:WorkflowCuratorServiceDetermines and executes curation of a Workflow item.- Specified by:
curatein interfaceWorkflowCuratorService- Parameters:
curator- the Curator objectc- the user contextwfId- the workflow id- Returns:
- true if curation was completed or not required, false if no workflow item found for id or item was rejected
- Throws:
AuthorizeException- if authorization errorIOException- if IO errorSQLException- if database error
-
curate
public boolean curate(Curator curator, Context c, BasicWorkflowItem wfi) throws AuthorizeException, IOException, SQLException
Description copied from interface:WorkflowCuratorServiceDetermines and executes curation of a Workflow item.- Specified by:
curatein interfaceWorkflowCuratorService- Parameters:
curator- the Curator objectc- the user contextwfi- the workflow item- Returns:
- true if curation was completed or not required, false if item was rejected
- Throws:
AuthorizeException- if authorization errorIOException- if IO errorSQLException- if database error
-
notifyContacts
protected void notifyContacts(Context c, BasicWorkflowItem wfi, WorkflowCuratorServiceImpl.Task task, String status, String action, String message) throws AuthorizeException, IOException, SQLException
-
resolveContacts
protected List<EPerson> resolveContacts(Context c, List<String> contacts, BasicWorkflowItem wfi) throws AuthorizeException, IOException, SQLException
-
getFlowStep
protected WorkflowCuratorServiceImpl.FlowStep getFlowStep(BasicWorkflowItem wfi)
-
state2step
protected int state2step(int state)
-
stepName2step
protected int stepName2step(String name)
-
loadTaskConfig
protected void loadTaskConfig(File cfgFile) throws IOException
- Throws:
IOException
-
-