org.dspace.xmlworkflow.state.actions
Class Action

java.lang.Object
  extended by org.dspace.xmlworkflow.state.actions.Action
Direct Known Subclasses:
ProcessingAction, UserSelectionAction

public abstract class Action
extends Object

This abstract class represents an api action Each step in the xml workflow consists of a number of actions this abstract action contains some utility methods & the methods that each of these actions must implement including: activating, execution, ...

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
Action()
           
 
Method Summary
abstract  void activate(Context c, XmlWorkflowItem wf)
           
protected static void addErrorField(javax.servlet.http.HttpServletRequest request, String fieldName)
          Add a single UI field to the list of all error fields (which can later be retrieved using getErrorFields())
 void alertUsersOnActivation(Context c, XmlWorkflowItem wfi, RoleMembers members)
           
abstract  ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, javax.servlet.http.HttpServletRequest request)
           
static List getErrorFields(javax.servlet.http.HttpServletRequest request)
          Return a list of all UI fields which had errors that occurred during the workflow processing.
 WorkflowActionConfig getParent()
           
 String getProvenanceStartId()
           
abstract  boolean isAuthorized(Context context, javax.servlet.http.HttpServletRequest request, XmlWorkflowItem wfi)
           
 void setParent(WorkflowActionConfig parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Method Detail

activate

public abstract void activate(Context c,
                              XmlWorkflowItem wf)
                       throws SQLException,
                              IOException,
                              AuthorizeException,
                              WorkflowException
Throws:
SQLException
IOException
AuthorizeException
WorkflowException

execute

public abstract ActionResult execute(Context c,
                                     XmlWorkflowItem wfi,
                                     Step step,
                                     javax.servlet.http.HttpServletRequest request)
                              throws SQLException,
                                     AuthorizeException,
                                     IOException,
                                     WorkflowException
Throws:
SQLException
AuthorizeException
IOException
WorkflowException

getParent

public WorkflowActionConfig getParent()

setParent

public void setParent(WorkflowActionConfig parent)

getProvenanceStartId

public String getProvenanceStartId()

alertUsersOnActivation

public void alertUsersOnActivation(Context c,
                                   XmlWorkflowItem wfi,
                                   RoleMembers members)
                            throws SQLException,
                                   IOException
Throws:
SQLException
IOException

isAuthorized

public abstract boolean isAuthorized(Context context,
                                     javax.servlet.http.HttpServletRequest request,
                                     XmlWorkflowItem wfi)
                              throws SQLException,
                                     AuthorizeException,
                                     IOException,
                                     WorkflowConfigurationException
Throws:
SQLException
AuthorizeException
IOException
WorkflowConfigurationException

getErrorFields

public static List getErrorFields(javax.servlet.http.HttpServletRequest request)
Return a list of all UI fields which had errors that occurred during the workflow processing. This list is for usage in generating the appropriate error message(s) in the UI.

Parameters:
request - current servlet request object
Returns:
List of error fields (as Strings)

addErrorField

protected static void addErrorField(javax.servlet.http.HttpServletRequest request,
                                    String fieldName)
Add a single UI field to the list of all error fields (which can later be retrieved using getErrorFields())

Parameters:
request - current servlet request object
fieldName - the name of the field which had an error


Copyright © 2011 DuraSpace. All Rights Reserved.