org.dspace.app.webui.submit.step
Class JSPSampleStep
java.lang.Object
org.dspace.app.webui.submit.JSPStep
org.dspace.app.webui.submit.step.JSPSampleStep
public class JSPSampleStep
- extends JSPStep
This is a Sample Step class which can be used as template for creating new
custom JSP-UI Step classes!
Please Note: This class works in conjunction with the
org.dspace.submit.step.SampleStep , which is a sample step
processing class!
This step can be added to any Submission process (for testing purposes) by
adding the following to the appropriate tag in the
/config/item-submission.xml:
Sample
org.dspace.submit.step.SampleStep
org.dspace.app.webui.submit.step.JSPSampleStep
true
The following methods are called in this order:
- Call doPreProcessing() method
- If showJSP() was specified from doPreProcessing(), then the JSP
specified will be displayed
- If showJSP() was not specified from doPreProcessing(), then the
doProcessing() method is called an the step completes immediately
- Call doProcessing() method on appropriate AbstractProcessingStep after the user returns from the JSP, in order
to process the user input
- Call doPostProcessing() method to determine if more user interaction is
required, and if further JSPs need to be called.
- If there are more "pages" in this step then, the process begins again
(for the new page).
- Once all pages are complete, control is forwarded back to the
SubmissionController, and the next step is called.
- Version:
- $Revision$
- Author:
- Tim Donohue
- See Also:
SubmissionController,
JSPStep,
SampleStep
| Fields inherited from class org.dspace.app.webui.submit.JSPStep |
NO_JSP |
|
Method Summary |
void |
doPostProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo,
int status)
Do any post-processing after the step's backend processing occurred (in
the doProcessing() method). |
void |
doPreProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
Do any pre-processing to determine which JSP (if any) is used to generate
the UI for this step. |
int |
getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
Retrieves the number of pages that this "step" extends over. |
String |
getReviewJSP(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
Return the URL path (e.g. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSPSampleStep
public JSPSampleStep()
doPreProcessing
public void doPreProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
throws javax.servlet.ServletException,
IOException,
SQLException,
AuthorizeException
- Do any pre-processing to determine which JSP (if any) is used to generate
the UI for this step. This method should include the gathering and
validating of all data required by the JSP. In addition, if the JSP
requires any variable to passed to it on the Request, this method should
set those variables.
If this step requires user interaction, then this method must call the
JSP to display, using the "showJSP()" method of the JSPStepManager class.
If this step doesn't require user interaction OR you are solely using
Manakin for your user interface, then this method may be left EMPTY,
since all step processing should occur in the doProcessing() method.
- Specified by:
doPreProcessing in class JSPStep
- Parameters:
context - current DSpace contextrequest - current servlet request objectresponse - current servlet response objectsubInfo - submission info object
- Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException
doPostProcessing
public void doPostProcessing(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo,
int status)
throws javax.servlet.ServletException,
IOException,
SQLException,
AuthorizeException
- Do any post-processing after the step's backend processing occurred (in
the doProcessing() method).
It is this method's job to determine whether processing completed
successfully, or display another JSP informing the users of any potential
problems/errors.
If this step doesn't require user interaction OR you are solely using
Manakin for your user interface, then this method may be left EMPTY,
since all step processing should occur in the doProcessing() method.
- Specified by:
doPostProcessing in class JSPStep
- Parameters:
context - current DSpace contextrequest - current servlet request objectresponse - current servlet response objectsubInfo - submission info objectstatus - any status/errors reported by doProcessing() method
- Throws:
javax.servlet.ServletException
IOException
SQLException
AuthorizeException
getNumberOfPages
public int getNumberOfPages(javax.servlet.http.HttpServletRequest request,
SubmissionInfo subInfo)
throws javax.servlet.ServletException
- Retrieves the number of pages that this "step" extends over. This method
is used by the SubmissionController to build the progress bar.
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!
- Parameters:
request - The HTTP RequestsubInfo - The current submission information object
- Returns:
- the number of pages in this step
- Throws:
javax.servlet.ServletException
getReviewJSP
public String getReviewJSP(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SubmissionInfo subInfo)
- Return the URL path (e.g. /submit/review-metadata.jsp) of the JSP
which will review the information that was gathered in this Step.
This Review JSP is loaded by the 'Verify' Step, in order to dynamically
generate a submission verification page consisting of the information
gathered in all the enabled submission steps.
- Specified by:
getReviewJSP in class JSPStep
- Parameters:
context - current DSpace contextrequest - current servlet request objectresponse - current servlet response objectsubInfo - submission info object
Copyright © 2013 DuraSpace. All Rights Reserved.