org.dspace.xmlworkflow
Class XmlWorkflowManager

java.lang.Object
  extended by org.dspace.xmlworkflow.XmlWorkflowManager

public class XmlWorkflowManager
extends Object

When an item is submitted and is somewhere in a workflow, it has a row in the WorkflowItem table pointing to it. Once the item has completed the workflow it will be archived

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)

Constructor Summary
XmlWorkflowManager()
           
 
Method Summary
static WorkspaceItem abort(Context c, XmlWorkflowItem wi, EPerson e)
           
static void alertUsersOnTaskActivation(Context c, XmlWorkflowItem wfi, String emailTemplate, List<EPerson> epa, String... arguments)
           
static Item archive(Context c, XmlWorkflowItem wfi)
          Commit the contained item to the main archive.
static void createOwnedTask(Context c, XmlWorkflowItem wi, Step step, WorkflowActionConfig action, EPerson e)
           
static void createPoolTasks(Context context, XmlWorkflowItem wi, RoleMembers assignees, Step step, WorkflowActionConfig action)
           
static void deleteAllPooledTasks(Context c, XmlWorkflowItem wi)
           
static void deleteAllTasks(Context c, XmlWorkflowItem wi)
          Deletes all tasks from this workflowflowitem
static void deleteClaimedTask(Context c, XmlWorkflowItem wi, ClaimedTask task)
           
static void deletePooledTask(Context c, XmlWorkflowItem wi, PoolTask task)
           
static WorkflowActionConfig doState(Context c, EPerson user, javax.servlet.http.HttpServletRequest request, int workflowItemId, Workflow workflow, WorkflowActionConfig currentActionConfig)
           
static String getEPersonName(EPerson e)
           
static String getMyDSpaceLink()
           
protected static void logWorkflowEvent(Context c, String workflowId, String previousStepId, String previousActionConfigId, XmlWorkflowItem wfi, EPerson actor, Step newStep, WorkflowActionConfig newActionConfig)
           
static WorkflowActionConfig processOutcome(Context c, EPerson user, Workflow workflow, Step currentStep, WorkflowActionConfig currentActionConfig, ActionResult currentOutcome, XmlWorkflowItem wfi, boolean enteredNewStep)
           
static WorkspaceItem sendWorkflowItemBackSubmission(Context c, XmlWorkflowItem wi, EPerson e, String provenance, String rejection_message)
          rejects an item - rejection means undoing a submit - WorkspaceItem is created, and the WorkflowItem is removed, user is emailed rejection_message.
static XmlWorkflowItem start(Context context, WorkspaceItem wsi)
           
static XmlWorkflowItem 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlWorkflowManager

public XmlWorkflowManager()
Method Detail

start

public static XmlWorkflowItem start(Context context,
                                    WorkspaceItem wsi)
                             throws SQLException,
                                    AuthorizeException,
                                    IOException,
                                    WorkflowConfigurationException,
                                    javax.mail.MessagingException,
                                    WorkflowException
Throws:
SQLException
AuthorizeException
IOException
WorkflowConfigurationException
javax.mail.MessagingException
WorkflowException

startWithoutNotify

public static XmlWorkflowItem startWithoutNotify(Context c,
                                                 WorkspaceItem wsi)
                                          throws SQLException,
                                                 AuthorizeException,
                                                 IOException,
                                                 WorkflowException,
                                                 WorkflowConfigurationException,
                                                 javax.mail.MessagingException
startWithoutNotify() starts the workflow normally, but disables notifications (useful for large imports,) for the first workflow step - subsequent notifications happen normally

Throws:
SQLException
AuthorizeException
IOException
WorkflowException
WorkflowConfigurationException
javax.mail.MessagingException

alertUsersOnTaskActivation

public static void alertUsersOnTaskActivation(Context c,
                                              XmlWorkflowItem wfi,
                                              String emailTemplate,
                                              List<EPerson> epa,
                                              String... arguments)
                                       throws IOException,
                                              SQLException,
                                              javax.mail.MessagingException
Throws:
IOException
SQLException
javax.mail.MessagingException

doState

public static WorkflowActionConfig doState(Context c,
                                           EPerson user,
                                           javax.servlet.http.HttpServletRequest request,
                                           int workflowItemId,
                                           Workflow workflow,
                                           WorkflowActionConfig currentActionConfig)
                                    throws SQLException,
                                           AuthorizeException,
                                           IOException,
                                           javax.mail.MessagingException,
                                           WorkflowConfigurationException,
                                           WorkflowException
Throws:
SQLException
AuthorizeException
IOException
javax.mail.MessagingException
WorkflowConfigurationException
WorkflowException

processOutcome

public static WorkflowActionConfig processOutcome(Context c,
                                                  EPerson user,
                                                  Workflow workflow,
                                                  Step currentStep,
                                                  WorkflowActionConfig currentActionConfig,
                                                  ActionResult currentOutcome,
                                                  XmlWorkflowItem wfi,
                                                  boolean enteredNewStep)
                                           throws IOException,
                                                  WorkflowConfigurationException,
                                                  AuthorizeException,
                                                  SQLException,
                                                  WorkflowException
Throws:
IOException
WorkflowConfigurationException
AuthorizeException
SQLException
WorkflowException

logWorkflowEvent

protected static void logWorkflowEvent(Context c,
                                       String workflowId,
                                       String previousStepId,
                                       String previousActionConfigId,
                                       XmlWorkflowItem wfi,
                                       EPerson actor,
                                       Step newStep,
                                       WorkflowActionConfig newActionConfig)
                                throws SQLException
Throws:
SQLException

archive

public static Item archive(Context c,
                           XmlWorkflowItem wfi)
                    throws SQLException,
                           IOException,
                           AuthorizeException
Commit the contained item to the main archive. The item is associated with the relevant collection, added to the search index, and any other tasks such as assigning dates are performed.

Returns:
the fully archived item.
Throws:
SQLException
IOException
AuthorizeException

deleteAllTasks

public static void deleteAllTasks(Context c,
                                  XmlWorkflowItem wi)
                           throws SQLException,
                                  AuthorizeException
Deletes all tasks from this workflowflowitem

Parameters:
c - the dspace context
wi - the workflow item for whom we are to delete the tasks
Throws:
SQLException - ...
AuthorizeException - ...

deleteAllPooledTasks

public static void deleteAllPooledTasks(Context c,
                                        XmlWorkflowItem wi)
                                 throws SQLException,
                                        AuthorizeException
Throws:
SQLException
AuthorizeException

deletePooledTask

public static void deletePooledTask(Context c,
                                    XmlWorkflowItem wi,
                                    PoolTask task)
                             throws SQLException,
                                    AuthorizeException
Throws:
SQLException
AuthorizeException

deleteClaimedTask

public static void deleteClaimedTask(Context c,
                                     XmlWorkflowItem wi,
                                     ClaimedTask task)
                              throws SQLException,
                                     AuthorizeException
Throws:
SQLException
AuthorizeException

createPoolTasks

public static void createPoolTasks(Context context,
                                   XmlWorkflowItem wi,
                                   RoleMembers assignees,
                                   Step step,
                                   WorkflowActionConfig action)
                            throws SQLException,
                                   AuthorizeException
Throws:
SQLException
AuthorizeException

createOwnedTask

public static void createOwnedTask(Context c,
                                   XmlWorkflowItem wi,
                                   Step step,
                                   WorkflowActionConfig action,
                                   EPerson e)
                            throws SQLException,
                                   AuthorizeException
Throws:
SQLException
AuthorizeException

sendWorkflowItemBackSubmission

public static WorkspaceItem sendWorkflowItemBackSubmission(Context c,
                                                           XmlWorkflowItem wi,
                                                           EPerson e,
                                                           String provenance,
                                                           String rejection_message)
                                                    throws SQLException,
                                                           AuthorizeException,
                                                           IOException
rejects an item - rejection means undoing a submit - WorkspaceItem is created, and the WorkflowItem is removed, user is emailed rejection_message.

Parameters:
c - Context
wi - WorkflowItem to operate on
e - EPerson doing the operation
provenance - the provenance message
rejection_message - message to email to user (if null no email is sent)
Returns:
the workspace item that is created
Throws:
IOException - ...
SQLException - ...
AuthorizeException - ...

abort

public static WorkspaceItem abort(Context c,
                                  XmlWorkflowItem wi,
                                  EPerson e)
                           throws AuthorizeException,
                                  SQLException,
                                  IOException
Throws:
AuthorizeException
SQLException
IOException

getEPersonName

public static String getEPersonName(EPerson e)
                             throws SQLException
Throws:
SQLException

getMyDSpaceLink

public static String getMyDSpaceLink()


Copyright © 2012 DuraSpace. All Rights Reserved.