|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.submit.AbstractProcessingStep
public abstract class AbstractProcessingStep
Abstract processing class for DSpace Submission Steps. This defines the base methods which are required for any Step processing class.
This abstract class defines the base methods which are used by both the Manakin XML UI and the JSP UI to perform submission step processing.
This includes the following methods:
If you are using the JSP UI (with the SubmissionController servlet) you should extend the org.dspace.submit.SubmissionStep class, which defines additional methods used to maintain the context of the submission within a JSP environment!
JSPStepManager,
SubmissionController,
SubmissionConfig,
SubmissionStepConfig| Field Summary | |
|---|---|
static String |
CANCEL_BUTTON
Constant - Name of the "Cancel/Save" button |
static int |
LAST_PAGE_REACHED
Flag which specifies that the LAST PAGE of a step has been reached. |
static String |
NEXT_BUTTON
Constant - Name of the "Next->" button |
static String |
PREVIOUS_BUTTON
Constant - Name of the "<-Previous" button |
static String |
PROGRESS_BAR_PREFIX
Constant - Prefix of all buttons in the Progress Bar |
static int |
STATUS_COMPLETE
STATUS / ERROR FLAGS (returned by doProcessing() if an error occurs or additional user interaction may be required) |
| Constructor Summary | |
|---|---|
AbstractProcessingStep()
|
|
| Method Summary | |
|---|---|
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()) |
protected void |
addErrorMessage(int errorFlag,
String errorMessage)
Add an error message to the internal map for this step. |
protected static void |
clearErrorFields(javax.servlet.http.HttpServletRequest request)
Clears the list of all fields that errored out during the previous step's processing. |
abstract int |
doProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
Do any processing of the information input by the user, and/or perform step processing (if no user interaction required) |
static int |
getCurrentPage(javax.servlet.http.HttpServletRequest request)
Find out which page a user is currently viewing |
static List |
getErrorFields(javax.servlet.http.HttpServletRequest request)
Return a list of all UI fields which had errors that occurred during the step processing. |
String |
getErrorMessage(int errorFlag)
Return the text of an error message based on the passed in error flag. |
abstract int |
getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
Retrieves the number of pages that this "step" extends over. |
static void |
setCurrentPage(javax.servlet.http.HttpServletRequest request,
int pageNumber)
Set which page a user is currently viewing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String PREVIOUS_BUTTON
public static String NEXT_BUTTON
public static String CANCEL_BUTTON
public static String PROGRESS_BAR_PREFIX
public static int LAST_PAGE_REACHED
public static int STATUS_COMPLETE
| Constructor Detail |
|---|
public AbstractProcessingStep()
| Method Detail |
|---|
public abstract int doProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
throws javax.servlet.ServletException,
IOException,
SQLException,
AuthorizeException
It is this method's job to save any data to the underlying database, as necessary, and return error messages (if any) which can then be processed by the doPostProcessing() method.
NOTE: If this step is a non-interactive step (i.e. requires no UI), then it should perform *all* of its processing in this method!
context - current DSpace contextrequest - current servlet request objectresponse - current servlet response objectsubInfo - submission info object
javax.servlet.ServletException
IOException
SQLException
AuthorizeExceptionpublic static final List getErrorFields(javax.servlet.http.HttpServletRequest request)
The list of fields which had errors should be set by the AbstractProcessingStep's doProcessing() method, so that it can be accessed later by whatever UI is generated.
request - current servlet request object
protected static final void addErrorField(javax.servlet.http.HttpServletRequest request,
String fieldName)
The list of fields which had errors should be set by the AbstractProcessingStep's doProcessing() method, so that it can be accessed later by whatever UI is generated.
fieldName - the name of the field which had an errorprotected static final void clearErrorFields(javax.servlet.http.HttpServletRequest request)
request - current servlet request objectpublic final String getErrorMessage(int errorFlag)
Since each step can define its own error messages and flags, this method depends on all the error messages being initialized by using the "addErrorMessage()" method within the constructor for the step class!
errorFlag - The error flag defined in this step which represents an error
message.
protected final void addErrorMessage(int errorFlag,
String errorMessage)
This method associates a specific error message with an error flag defined in this step.
This is extremely useful to define the error message which will be logged for a non-interactive step.
fieldName - the name of the field which had an error
public abstract int getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
throws javax.servlet.ServletException
This method may just return 1 for most steps (since most steps consist of a single page). But, it should return a number greater than 1 for any "step" which spans across a number of HTML pages. For example, the configurable "Describe" step (configured using input-forms.xml) overrides this method to return the number of pages that are defined by its configuration file.
Steps which are non-interactive (i.e. they do not display an interface to the user) should return a value of 1, so that they are only processed once!
request - The HTTP RequestsubInfo - The current submission information object
javax.servlet.ServletExceptionpublic static final int getCurrentPage(javax.servlet.http.HttpServletRequest request)
request - HTTP request
public static final void setCurrentPage(javax.servlet.http.HttpServletRequest request,
int pageNumber)
request - HTTP requestpageNumber - new current page
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||