org.dspace.app.xmlui.aspect.administrative
Class FlowResult

java.lang.Object
  extended by org.dspace.app.xmlui.aspect.administrative.FlowResult

public class FlowResult
extends Object

This class represents the results that may be generated during a flow script in this administrative section. Typicaly, some method preforms an operation and returns an object of type FlowResult, then the flow script can inspect the results object to determine what the next course of action is. Basicaly, this results object stores all the errors and contiunation states that need to be represented. There are four types of information stored: 1) Continuation, this is a simple boolean variable that indicates wheather the required operation is complete and the user may continue on to the next step. 2) Notice information, this is a simple encoding of a notice message to be displayed to the user on their next step. There are four parts: outcome, header, message, and characters. See each field for more description on each part. Note: either a message or characters are required. 3) Errors, this is a list of errors that were encountered during processing. Typical, it just consists of a list of errored fields. However occasionaly there may be other specialized errors listed. 4) Parameters, this is a map of attached parameters that may be relevnt to the result. This should be used for things such as generated id's when objects are newly created.

Author:
Scott Phillips

Constructor Summary
FlowResult()
           
 
Method Summary
 void addError(String newError)
          Add a new single error to the error list.
 String getCharacters()
          Return the notice characters
 boolean getContinue()
          Determine if the user should progress to the next step in the flow.
 List<String> getErrors()
          Return the current list of errors.
 String getErrorString()
          Return the list of errors in string form, i.e.
 String getHeader()
          Return the notice header
 String getMessage()
          return the notice message
 String getOutcome()
          Get the notice outcome in string form, either success or failure.
 Object getParameter(String name)
          Find the attached parameter with the given name.
 void setCharacters(String characters)
          Set the notice characters
 void setContinue(boolean continuep)
          Set the continuation parameter determining if the user should progress to the next step in the flow.
 void setErrors(List<String> errors)
          Set the results errors, note this will remove any previous errors.
 void setHeader(Message header)
          Set the notice header.
 void setMessage(Message message)
          Set the notice message This must be an i18n dictionary key
 void setOutcome(boolean success)
          Set the notice outcome to either success or failure.
 void setParameter(String name, Object value)
          Attatch a new parameter to this result object with the specified name & value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowResult

public FlowResult()
Method Detail

setContinue

public void setContinue(boolean continuep)
Set the continuation parameter determining if the user should progress to the next step in the flow.


getContinue

public boolean getContinue()
Determine if the user should progress to the next step in the flow.

Returns:
the continuation parameter

setOutcome

public void setOutcome(boolean success)
Set the notice outcome to either success or failure. Note, the default outcome is netural, once an outcome is set the netural outcome can never be atained again.

Parameters:
success - True for success, false for failure.

getOutcome

public String getOutcome()
Get the notice outcome in string form, either success or failure. If the outcome is netural then null is returned.


setHeader

public void setHeader(Message header)
Set the notice header. This must be an i18n dictionary key


getHeader

public String getHeader()
Return the notice header


setMessage

public void setMessage(Message message)
Set the notice message This must be an i18n dictionary key


getMessage

public String getMessage()
return the notice message


setCharacters

public void setCharacters(String characters)
Set the notice characters


getCharacters

public String getCharacters()
Return the notice characters


setErrors

public void setErrors(List<String> errors)
Set the results errors, note this will remove any previous errors.

Parameters:
errors - New error list.

addError

public void addError(String newError)
Add a new single error to the error list.

Parameters:
newError - New error.

getErrors

public List<String> getErrors()
Return the current list of errors.


getErrorString

public String getErrorString()
Return the list of errors in string form, i.e. a comma seperated list of errors. If there are no errors then null is returned.


setParameter

public void setParameter(String name,
                         Object value)
Attatch a new parameter to this result object with the specified name & value.

Parameters:
name - The parameter's name
value - The parameter's value.

getParameter

public Object getParameter(String name)
Find the attached parameter with the given name. If no parameter is found for the specified name then null is returned.

Parameters:
name - The parameter's name.
Returns:
The parameter's value.


Copyright © 2012 DuraSpace. All Rights Reserved.