org.dspace.app.xmlui.aspect.workflow
Class FlowUtils

java.lang.Object
  extended by org.dspace.app.xmlui.aspect.workflow.FlowUtils

public class FlowUtils
extends Object

This is a utility class to aid in the workflow flow scripts. Since data validation is cumbersome inside a flow script this is a collection of methods to perform processing at each step of the flow, the flow script will ties these operations together in a meaningful order but all actually processing is done through these various processes.

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
FlowUtils()
           
 
Method Summary
static void authorizeWorkflowItem(Context context, String workflowItemId)
          Verifies if the currently logged in user has proper rights to perform the workflow task on the item
static WorkflowItem findWorkflow(Context context, String inProgressSubmissionID)
          Return the workflow identified by the given id, the id should be prepended with the character S to signify that it is a workflow instead of a workspace.
static boolean processApproveTask(Context context, String id)
          Update the provided workflowItem to advance to the next workflow step.
static void processClaimTask(Context context, String id)
          Claim this task from the pool of unclaimed task so that this user may preform the task by either approving or rejecting it.
static String processRejectTask(Context context, String id, org.apache.cocoon.environment.Request request)
          Reject the given task for the given reason.
static void processUnclaimTask(Context context, String id)
          Return the given task back to the pool of unclaimed tasks for another user to select and preform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowUtils

public FlowUtils()
Method Detail

processApproveTask

public static boolean processApproveTask(Context context,
                                         String id)
                                  throws SQLException,
                                         UIException,
                                         javax.servlet.ServletException,
                                         AuthorizeException,
                                         IOException
Update the provided workflowItem to advance to the next workflow step. If this was the last thing needed before the item is committed to the repository then return true, otherwise false.

Parameters:
context - The current DSpace content
id - The unique ID of the current workflow
Throws:
SQLException
UIException
javax.servlet.ServletException
AuthorizeException
IOException

processUnclaimTask

public static void processUnclaimTask(Context context,
                                      String id)
                               throws SQLException,
                                      UIException,
                                      javax.servlet.ServletException,
                                      AuthorizeException,
                                      IOException
Return the given task back to the pool of unclaimed tasks for another user to select and preform.

Parameters:
context - The current DSpace content
id - The unique ID of the current workflow
Throws:
SQLException
UIException
javax.servlet.ServletException
AuthorizeException
IOException

processClaimTask

public static void processClaimTask(Context context,
                                    String id)
                             throws SQLException,
                                    UIException,
                                    javax.servlet.ServletException,
                                    AuthorizeException,
                                    IOException
Claim this task from the pool of unclaimed task so that this user may preform the task by either approving or rejecting it.

Parameters:
context - The current DSpace content
id - The unique ID of the current workflow
Throws:
SQLException
UIException
javax.servlet.ServletException
AuthorizeException
IOException

authorizeWorkflowItem

public static void authorizeWorkflowItem(Context context,
                                         String workflowItemId)
                                  throws AuthorizeException,
                                         SQLException
Verifies if the currently logged in user has proper rights to perform the workflow task on the item

Parameters:
context - the current dspace context
workflowItemId - the identifier of the workflow item
Throws:
AuthorizeException - thrown if the user doesn't have sufficient rights to perform the task at hand
SQLException - is thrown when something is wrong with the database

processRejectTask

public static String processRejectTask(Context context,
                                       String id,
                                       org.apache.cocoon.environment.Request request)
                                throws SQLException,
                                       UIException,
                                       javax.servlet.ServletException,
                                       AuthorizeException,
                                       IOException
Reject the given task for the given reason. If the user did not provide a reason then an error is generated placing that field in error.

Parameters:
context - The current DSpace content
id - The unique ID of the current workflow
request - The current request object
Throws:
SQLException
UIException
javax.servlet.ServletException
AuthorizeException
IOException

findWorkflow

public static WorkflowItem findWorkflow(Context context,
                                        String inProgressSubmissionID)
                                 throws SQLException,
                                        AuthorizeException,
                                        IOException
Return the workflow identified by the given id, the id should be prepended with the character S to signify that it is a workflow instead of a workspace.

Parameters:
context -
inProgressSubmissionID -
Returns:
The found workflowitem or null if none found.
Throws:
SQLException
AuthorizeException
IOException


Copyright © 2012 DuraSpace. All Rights Reserved.