public class BasicWorkflowServiceImpl extends Object implements BasicWorkflowService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected CollectionService |
collectionService |
protected ConfigurationService |
configurationService |
protected GroupService |
groupService |
protected HandleService |
handleService |
protected InstallItemService |
installItemService |
protected ItemService |
itemService |
protected Map<UUID,Boolean> |
noEMail |
protected TaskListItemService |
taskListItemService |
protected WorkflowCuratorService |
workflowCuratorService |
protected BasicWorkflowItemService |
workflowItemService |
protected String[] |
workflowText
Symbolic names of workflow steps.
|
protected WorkspaceItemService |
workspaceItemService |
WFSTATE_ARCHIVE, WFSTATE_STEP1, WFSTATE_STEP1POOL, WFSTATE_STEP2, WFSTATE_STEP2POOL, WFSTATE_STEP3, WFSTATE_STEP3POOL, WFSTATE_SUBMIT| Modifier | Constructor and Description |
|---|---|
protected |
BasicWorkflowServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
WorkspaceItem |
abort(Context context,
BasicWorkflowItem workflowItem,
EPerson e)
abort() aborts a workflow, completely deleting it (administrator do this)
(it will basically do a reject from any state - the item ends up back in
the user's PersonalWorkspace
|
void |
advance(Context context,
BasicWorkflowItem workflowItem,
EPerson e)
advance() sends an item forward in the workflow (reviewers,
approvers, and editors all do an 'approve' to move the item forward) if
the item arrives at the submit state, then remove the WorkflowItem and
call the archive() method to put it in the archive, and email notify the
submitter of a successful submission
|
boolean |
advance(Context context,
BasicWorkflowItem workflowItem,
EPerson e,
boolean curate,
boolean record)
advance() sends an item forward in the workflow (reviewers,
approvers, and editors all do an 'approve' to move the item forward) if
the item arrives at the submit state, then remove the WorkflowItem and
call the archive() method to put it in the archive, and email notify the
submitter of a successful submission
|
protected Item |
archive(Context context,
BasicWorkflowItem workflowItem)
Commit the contained item to the main archive.
|
protected void |
assignToReviewer(Context context,
BasicWorkflowItem workflowItem,
int step,
EPerson newowner)
Helper method to take an item out of the pool, to assign it to a reviewer and to deal with reviewer policies.
|
void |
claim(Context context,
BasicWorkflowItem workflowItem,
EPerson e)
claim() claims a workflow task for an EPerson
|
protected void |
createTasks(Context c,
BasicWorkflowItem wi,
List<EPerson> epa) |
void |
deleteCollection(Context context,
Collection collection) |
protected boolean |
doState(Context context,
BasicWorkflowItem workflowItem,
int newstate,
EPerson newowner) |
List<String> |
getEPersonDeleteConstraints(Context context,
EPerson ePerson) |
protected String |
getEPersonName(EPerson e) |
List<String> |
getFlywayMigrationLocations() |
String |
getItemTitle(BasicWorkflowItem wi)
get the title of the item in this workflow
|
String |
getMyDSpaceLink() |
List<BasicWorkflowItem> |
getOwnedTasks(Context context,
EPerson e)
getOwnedTasks() returns a List of WorkflowItems containing the tasks
claimed and owned by an EPerson.
|
List<BasicWorkflowItem> |
getPooledTasks(Context context,
EPerson e)
getPooledTasks() returns a List of WorkflowItems an EPerson could claim
(as a reviewer, etc.) for display on a user's MyDSpace page.
|
String |
getSubmitterName(BasicWorkflowItem wi)
get the name of the eperson who started this workflow
|
int |
getWorkflowID(String state)
Translate symbolic name of workflow state into number.
|
Group |
getWorkflowRoleGroup(Context context,
Collection collection,
String roleName,
Group roleGroup) |
String |
getWorkflowText(int state)
Get the text representing the given workflow state
|
protected void |
grantReviewerPolicies(Context context,
BasicWorkflowItem wfi,
EPerson reviewer)
This methods grants the appropriate permissions to reviewers so that they
can read and edit metadata and read files and edit files if allowed by
configuration.
|
protected void |
logWorkflowEvent(Context context,
Item item,
BasicWorkflowItem workflowItem,
EPerson actor,
int newstate,
EPerson newOwner,
Collection mycollection,
int oldState,
Group newOwnerGroup) |
protected void |
notifyGroupOfTask(Context c,
BasicWorkflowItem wi,
Group mygroup,
List<EPerson> epa) |
protected void |
notifyOfArchive(Context context,
Item item,
Collection coll)
notify the submitter that the item is archived
|
void |
notifyOfCuration(Context c,
BasicWorkflowItem wi,
List<EPerson> ePeople,
String taskName,
String action,
String message) |
protected void |
notifyOfReject(Context context,
BasicWorkflowItem workflowItem,
EPerson e,
String reason) |
protected boolean |
pool(Context context,
BasicWorkflowItem workflowItem,
int step)
Helper method that manages state, policies, owner, notifies, tasklistitems and so on whenever an WorkflowItem
should be added to a workflow step pool.
|
protected void |
recordApproval(Context context,
BasicWorkflowItem workflowItem,
EPerson e) |
protected void |
recordStart(Context context,
Item myitem) |
protected WorkspaceItem |
returnToWorkspace(Context c,
BasicWorkflowItem wfi)
Return the workflow item to the workspace of the submitter.
|
protected void |
revokeReviewerPolicies(Context context,
Item item)
This methods revokes any permission granted by the basic workflow systems
on the item specified as attribute.
|
WorkspaceItem |
sendWorkflowItemBackSubmission(Context context,
BasicWorkflowItem workflowItem,
EPerson ePerson,
String provenancePrefix,
String rejection_message) |
BasicWorkflowItem |
start(Context context,
WorkspaceItem wsi)
startWorkflow() begins a workflow - in a single transaction do away with
the PersonalWorkspace entry and turn it into a WorkflowItem.
|
BasicWorkflowItem |
startWithoutNotify(Context c,
WorkspaceItem wsi)
startWithoutNotify() starts the workflow normally, but disables
notifications (useful for large imports,) for the first workflow step -
subsequent notifications happen normally
|
void |
unclaim(Context context,
BasicWorkflowItem workflowItem,
EPerson e)
unclaim() returns an owned task/item to the pool
|
@Autowired(required=true) protected AuthorizeService authorizeService
@Autowired(required=true) protected CollectionService collectionService
@Autowired(required=true) protected GroupService groupService
@Autowired(required=true) protected HandleService handleService
@Autowired(required=true) protected InstallItemService installItemService
@Autowired(required=true) protected ItemService itemService
@Autowired(required=true) protected TaskListItemService taskListItemService
@Autowired(required=true) protected WorkflowCuratorService workflowCuratorService
@Autowired(required=true) protected BasicWorkflowItemService workflowItemService
@Autowired(required=true) protected WorkspaceItemService workspaceItemService
@Autowired(required=true) protected ConfigurationService configurationService
protected final String[] workflowText
public int getWorkflowID(String state)
BasicWorkflowServicegetWorkflowID in interface BasicWorkflowServicestate - symbolic name of workflow state, must be one of
the elements of workflowText array.protected void grantReviewerPolicies(Context context, BasicWorkflowItem wfi, EPerson reviewer) throws SQLException, AuthorizeException
context - wfi - While all policies are granted on item, bundle or bitstream
level, this method takes an workflowitem for convenience and
uses wfi.getItem() to get the actual item.reviewer - EPerson to grant the rights to.SQLExceptionAuthorizeExceptionprotected void revokeReviewerPolicies(Context context, Item item) throws SQLException, AuthorizeException
grantReviewerPolicies(org.dspace.core.Context, org.dspace.workflowbasic.BasicWorkflowItem, org.dspace.eperson.EPerson).
In most cases this method must be called within a try-finally-block that
temporary disables the authentication system. This is not done by this
method as it should be done carefully and only in contexts in which
revoking the permissions is authorized by some previous checks.context - item - SQLExceptionAuthorizeExceptionpublic BasicWorkflowItem start(Context context, WorkspaceItem wsi) throws SQLException, AuthorizeException, IOException
WorkflowServicestart in interface WorkflowService<BasicWorkflowItem>context - Contextwsi - The WorkspaceItem to convert to a workflow itemSQLExceptionAuthorizeExceptionIOExceptionpublic BasicWorkflowItem startWithoutNotify(Context c, WorkspaceItem wsi) throws SQLException, AuthorizeException, IOException
WorkflowServicestartWithoutNotify in interface WorkflowService<BasicWorkflowItem>SQLExceptionAuthorizeExceptionIOExceptionpublic List<BasicWorkflowItem> getOwnedTasks(Context context, EPerson e) throws SQLException
BasicWorkflowServicegetOwnedTasks in interface BasicWorkflowServicee - The EPerson we want to fetch owned tasks for.SQLExceptionpublic List<BasicWorkflowItem> getPooledTasks(Context context, EPerson e) throws SQLException
BasicWorkflowServicegetPooledTasks in interface BasicWorkflowServicee - The Eperson we want to fetch the pooled tasks for.SQLExceptionpublic void claim(Context context, BasicWorkflowItem workflowItem, EPerson e) throws SQLException, IOException, AuthorizeException
BasicWorkflowServiceclaim in interface BasicWorkflowServiceworkflowItem - WorkflowItem to do the claim one - The EPerson doing the claimSQLExceptionIOExceptionAuthorizeExceptionpublic void advance(Context context, BasicWorkflowItem workflowItem, EPerson e) throws SQLException, IOException, AuthorizeException
BasicWorkflowServiceadvance in interface BasicWorkflowServicecontext - ContextworkflowItem - WorkflowItem do do the approval one - EPerson doing the approvalSQLExceptionIOExceptionAuthorizeExceptionpublic boolean advance(Context context, BasicWorkflowItem workflowItem, EPerson e, boolean curate, boolean record) throws SQLException, IOException, AuthorizeException
BasicWorkflowServiceadvance in interface BasicWorkflowServicecontext - ContextworkflowItem - WorkflowItem do do the approval one - EPerson doing the approvalcurate - boolean indicating whether curation tasks should be donerecord - boolean indicating whether to record actionSQLExceptionIOExceptionAuthorizeExceptionpublic void unclaim(Context context, BasicWorkflowItem workflowItem, EPerson e) throws SQLException, IOException, AuthorizeException
BasicWorkflowServiceunclaim in interface BasicWorkflowServicecontext - ContextworkflowItem - WorkflowItem to operate one - EPerson doing the operationSQLExceptionIOExceptionAuthorizeExceptionpublic WorkspaceItem abort(Context context, BasicWorkflowItem workflowItem, EPerson e) throws SQLException, AuthorizeException, IOException
WorkflowServiceabort in interface WorkflowService<BasicWorkflowItem>context - ContextworkflowItem - WorkflowItem to operate one - EPerson doing the operationSQLExceptionAuthorizeExceptionIOExceptionprotected boolean doState(Context context, BasicWorkflowItem workflowItem, int newstate, EPerson newowner) throws SQLException, IOException, AuthorizeException
protected void assignToReviewer(Context context, BasicWorkflowItem workflowItem, int step, EPerson newowner) throws AuthorizeException, SQLException
start(Context, WorkspaceItem) to start a workflow and
claim(Context, BasicWorkflowItem, EPerson) as those methods handles the internal states and checks for
the appropriate permissions.context - DSpace context objectworkflowItem - The item that shall be pooled.step - The step (1-3) of the pool the item should be put to.newowner - The EPerson that should do the review.SQLExceptionAuthorizeExceptionIOExceptionIllegalArgumentException - If param has another value than either 1, 2, or 3.protected boolean pool(Context context, BasicWorkflowItem workflowItem, int step) throws SQLException, AuthorizeException, IOException
unclaim(Context, BasicWorkflowItem, EPerson) if the item is claimed,
start(Context, WorkspaceItem) to start the workflow or advance(Context, BasicWorkflowItem, EPerson)
to move an item to the next state.context - DSpace context objectworkflowItem - The item that shall be pooled.step - The step (1-3) of the pool the item should be put to.SQLExceptionAuthorizeExceptionIOExceptionIllegalArgumentException - If param has another value than either 1, 2, or 3.protected void logWorkflowEvent(Context context, Item item, BasicWorkflowItem workflowItem, EPerson actor, int newstate, EPerson newOwner, Collection mycollection, int oldState, Group newOwnerGroup)
public String getWorkflowText(int state)
BasicWorkflowServicegetWorkflowText in interface BasicWorkflowServicestate - the workflow stateprotected Item archive(Context context, BasicWorkflowItem workflowItem) throws SQLException, IOException, AuthorizeException
SQLExceptionIOExceptionAuthorizeExceptionprotected void notifyOfArchive(Context context, Item item, Collection coll) throws SQLException, IOException
SQLExceptionIOExceptionprotected WorkspaceItem returnToWorkspace(Context c, BasicWorkflowItem wfi) throws SQLException, IOException, AuthorizeException
c - Contextwfi - WorkflowItem to be 'dismantled'SQLExceptionIOExceptionAuthorizeExceptionpublic WorkspaceItem sendWorkflowItemBackSubmission(Context context, BasicWorkflowItem workflowItem, EPerson ePerson, String provenancePrefix, String rejection_message) throws SQLException, AuthorizeException, IOException
sendWorkflowItemBackSubmission in interface WorkflowService<BasicWorkflowItem>SQLExceptionAuthorizeExceptionIOExceptionprotected void createTasks(Context c, BasicWorkflowItem wi, List<EPerson> epa) throws SQLException
SQLExceptionpublic void notifyOfCuration(Context c, BasicWorkflowItem wi, List<EPerson> ePeople, String taskName, String action, String message) throws SQLException, IOException
notifyOfCuration in interface BasicWorkflowServiceSQLExceptionIOExceptionprotected void notifyGroupOfTask(Context c, BasicWorkflowItem wi, Group mygroup, List<EPerson> epa) throws SQLException, IOException
SQLExceptionIOExceptionpublic String getMyDSpaceLink()
getMyDSpaceLink in interface WorkflowService<BasicWorkflowItem>protected void notifyOfReject(Context context, BasicWorkflowItem workflowItem, EPerson e, String reason)
public String getItemTitle(BasicWorkflowItem wi) throws SQLException
BasicWorkflowServicegetItemTitle in interface BasicWorkflowServicewi - the workflow item objectSQLExceptionpublic String getSubmitterName(BasicWorkflowItem wi) throws SQLException
BasicWorkflowServicegetSubmitterName in interface BasicWorkflowServicewi - the workflow itemSQLExceptionprotected String getEPersonName(EPerson e) throws SQLException
SQLExceptionprotected void recordApproval(Context context, BasicWorkflowItem workflowItem, EPerson e) throws SQLException, IOException, AuthorizeException
protected void recordStart(Context context, Item myitem) throws SQLException, IOException, AuthorizeException
public void deleteCollection(Context context, Collection collection) throws SQLException, IOException, AuthorizeException
deleteCollection in interface WorkflowService<BasicWorkflowItem>SQLExceptionIOExceptionAuthorizeExceptionpublic List<String> getEPersonDeleteConstraints(Context context, EPerson ePerson) throws SQLException
getEPersonDeleteConstraints in interface WorkflowService<BasicWorkflowItem>SQLExceptionpublic Group getWorkflowRoleGroup(Context context, Collection collection, String roleName, Group roleGroup) throws SQLException, AuthorizeException
getWorkflowRoleGroup in interface WorkflowService<BasicWorkflowItem>SQLExceptionAuthorizeExceptionpublic List<String> getFlywayMigrationLocations()
getFlywayMigrationLocations in interface WorkflowService<BasicWorkflowItem>Copyright © 2017 DuraSpace. All rights reserved.