org.dspace.app.webui.submit
Class JSPStepManager

java.lang.Object
  extended by org.dspace.app.webui.submit.JSPStepManager

public class JSPStepManager
extends java.lang.Object

Manages and processes all JSP-UI classes for DSpace Submission steps.

This manager is utilized by the SubmissionController to appropriately load each JSP-UI step, and process any information returned by each step

Version:
$Revision: 5845 $
Author:
Tim Donohue
See Also:
AbstractProcessingStep, SubmissionController, JSPStep

Constructor Summary
JSPStepManager()
           
 
Method Summary
protected  boolean completeStep(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          This method completes the processing of this "step" and forwards the request back to the SubmissionController (so that the next step can be called).
static java.lang.String getLastJSPDisplayed(javax.servlet.http.HttpServletRequest request)
          Retrieves the context path of the last JSP that was displayed to the user.
static int getPageReached(SubmissionInfo subInfo)
          Find out which page a user has reached in this particular step.
 java.lang.String getReviewJSP(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Return the URL path (e.g.
protected  boolean hasMorePages(javax.servlet.http.HttpServletRequest request, SubmissionInfo subInfo, int pageNumber)
          Checks to see if there are more pages in the current step after the specified page
static JSPStepManager loadStep(SubmissionStepConfig stepConfig)
          Initialize the current JSPStepManager object, by loading the specified step class.
 boolean processStep(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo)
          Initialize the current JSPStepManager object, to prepare for processing of this step.
static void showJSP(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SubmissionInfo subInfo, java.lang.String pathToJSP)
          This method actually displays a JSP page for this "step".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSPStepManager

public JSPStepManager()
Method Detail

loadStep

public static JSPStepManager loadStep(SubmissionStepConfig stepConfig)
                               throws java.lang.Exception
Initialize the current JSPStepManager object, by loading the specified step class.

Parameters:
stepConfig - the SubmissionStepConfig object which describes this step's configuration in the item-submission.xml
Throws:
java.lang.Exception - if the JSPStep cannot be loaded or the class specified doesn't implement the JSPStep interface

processStep

public final boolean processStep(Context context,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 SubmissionInfo subInfo)
                          throws javax.servlet.ServletException,
                                 java.io.IOException,
                                 java.sql.SQLException,
                                 AuthorizeException
Initialize the current JSPStepManager object, to prepare for processing of this step. This method is called by the SubmissionController, and its job is to determine which "page" of the step the current user is on.

Once the page has been determined, this method also determines whether the user is completing this page (i.e. there is user input data that needs to be saved to the database) or beginning this page (i.e. the user needs to be sent to the JSP for this page).

Parameters:
context - a DSpace Context object
request - the HTTP request
response - the HTTP response
subInfo - submission info object
Returns:
true if step is completed (successfully), false otherwise
Throws:
javax.servlet.ServletException - if a general error occurs
java.io.IOException - if a i/o error occurs
java.sql.SQLException - if a database error occurs
AuthorizeException - if some authorization error occurs

showJSP

public static final void showJSP(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 SubmissionInfo subInfo,
                                 java.lang.String pathToJSP)
                          throws javax.servlet.ServletException,
                                 java.io.IOException,
                                 java.sql.SQLException
This method actually displays a JSP page for this "step". This method can be called from "doPostProcessing()" to display an error page, etc.

Parameters:
request - current servlet request object
response - current servlet response object
subInfo - submission info object
pathToJSP - context path to the JSP to display
Throws:
javax.servlet.ServletException
java.io.IOException
java.sql.SQLException

completeStep

protected final boolean completeStep(Context context,
                                     javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     SubmissionInfo subInfo)
                              throws javax.servlet.ServletException,
                                     java.io.IOException,
                                     java.sql.SQLException,
                                     AuthorizeException
This method completes the processing of this "step" and forwards the request back to the SubmissionController (so that the next step can be called).

Parameters:
context - current DSpace context
request - current servlet request object
response - current servlet response object
subInfo - submission info object
Returns:
true if step completed (successfully), false otherwise
Throws:
javax.servlet.ServletException
java.io.IOException
java.sql.SQLException
AuthorizeException

hasMorePages

protected final boolean hasMorePages(javax.servlet.http.HttpServletRequest request,
                                     SubmissionInfo subInfo,
                                     int pageNumber)
                              throws javax.servlet.ServletException
Checks to see if there are more pages in the current step after the specified page

Parameters:
request - The HTTP Request object
subInfo - The current submission information object
pageNumber - The current page
Throws:
javax.servlet.ServletException - if there are no more pages in this step

getPageReached

public static final int getPageReached(SubmissionInfo subInfo)
Find out which page a user has reached in this particular step.

Parameters:
subInfo - Submission information
Returns:
page reached

getLastJSPDisplayed

public static final java.lang.String getLastJSPDisplayed(javax.servlet.http.HttpServletRequest request)
Retrieves the context path of the last JSP that was displayed to the user. This is useful in the "doPostProcessing()" method to determine which JSP has just submitted form information.

Parameters:
request - current servlet request object
Returns:
pathToJSP The context path to the JSP page (e.g. "/submit/select-collection.jsp")

getReviewJSP

public java.lang.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 the currently loaded 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.

Parameters:
context - current DSpace context
request - current servlet request object
response - current servlet response object
subInfo - submission info object


Copyright © 2010 DuraSpace. All Rights Reserved.