DLESE Tools
v1.6.0

org.dlese.dpc.suggest.action
Class SuggestAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.dlese.dpc.suggest.action.SuggestAction
Direct Known Subclasses:
SuggestCommentAction, SuggestResourceAction

public abstract class SuggestAction
extends org.apache.struts.action.Action

Abstract controller for a Suggestor Client. Implements the following flow of control:

  1. Presents form for user input
  2. Validates input. if there are errors returns user to form, otherwise presents confirmation page.
  3. User can elect to re-edit the form, or "submit" it.
  4. confirmation page is displayed upon submission

Version:
$Id: SuggestAction.java,v 1.2 2009/03/20 23:34:00 jweather Exp $
Author:
ostwald

$Id $


Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
SuggestAction()
           
 
Method Summary
protected abstract  SuggestionRecord createRecord(org.apache.struts.action.ActionForm form)
          Update the SuggestionRecord (managed by SuggestResourceHelper) with values from the form bean
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it.
protected  SchemaHelper getSchemaHelper()
          Gets the schemaHelper attribute of the SuggestAction object
protected abstract  SuggestHelper getSuggestHelper()
          Gets the suggestHelper attribute of the SuggestAction object
protected abstract  org.apache.struts.action.ActionForward handleCancelCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          NOT YET DOCUMENTED
protected abstract  org.apache.struts.action.ActionForward handleDoneCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Validate information supplied by user, return to edit form if there are errors, or display confirmation page if there are no errors.
protected abstract  org.apache.struts.action.ActionForward handleEditCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Populate SuggestionForm, and forward user to edit-form.
protected  org.apache.struts.action.ActionForward handleOtherCommands(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          NOT YET DOCUMENTED
protected  org.apache.struts.action.ActionForward handleStaleData(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request)
          Return user to suggestor front page and show message explaining that they were apparently trying to edit or submit data from a cancelled form
protected abstract  org.apache.struts.action.ActionForward handleSubmitCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Attempt to write the suggestion to a DCS instance, forward user to confirmation page.
protected abstract  org.apache.struts.action.ActionForward initializeSuggestor(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          NOT YET DOCUMENTED
static void setDebug(boolean db)
          Sets the debug attribute of the SuggestAction class
protected abstract  org.apache.struts.action.ActionErrors validateSuggestForm(org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping, HttpServletRequest request)
          The required fields for suggest-a-url are: url, nameFirst, nameLast, emailPrimary, instName
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuggestAction

public SuggestAction()
Method Detail

getSuggestHelper

protected abstract SuggestHelper getSuggestHelper()
                                           throws ServletException
Gets the suggestHelper attribute of the SuggestAction object

Returns:
The suggestHelper value
Throws:
ServletException - NOT YET DOCUMENTED

getSchemaHelper

protected SchemaHelper getSchemaHelper()
Gets the schemaHelper attribute of the SuggestAction object

Returns:
The schemaHelper value

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      HttpServletRequest request,
                                                      HttpServletResponse response)
                                               throws IOException,
                                                      ServletException
Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it. Returns an ActionForward instance that maps to the Struts forwarding name "xxx.xxx," which must be configured in struts-config.xml to forward to the JSP page that will handle the request.

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - Description of the Parameter
form - Description of the Parameter
request - Description of the Parameter
response - Description of the Parameter
Returns:
Description of the Return Value
Throws:
IOException - Description of the Exception
ServletException - Description of the Exception

initializeSuggestor

protected abstract org.apache.struts.action.ActionForward initializeSuggestor(org.apache.struts.action.ActionMapping mapping,
                                                                              org.apache.struts.action.ActionForm form,
                                                                              HttpServletRequest request,
                                                                              HttpServletResponse response)
                                                                       throws ServletException
NOT YET DOCUMENTED

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED
Throws:
ServletException - NOT YET DOCUMENTED

handleOtherCommands

protected org.apache.struts.action.ActionForward handleOtherCommands(org.apache.struts.action.ActionMapping mapping,
                                                                     org.apache.struts.action.ActionForm form,
                                                                     HttpServletRequest request,
                                                                     HttpServletResponse response)
                                                              throws ServletException
NOT YET DOCUMENTED

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED
Throws:
ServletException - NOT YET DOCUMENTED

handleEditCommand

protected abstract org.apache.struts.action.ActionForward handleEditCommand(org.apache.struts.action.ActionMapping mapping,
                                                                            org.apache.struts.action.ActionForm form,
                                                                            HttpServletRequest request,
                                                                            HttpServletResponse response)
                                                                     throws Exception
Populate SuggestionForm, and forward user to edit-form.

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED
Throws:
Exception - if SuggestionForm cannot be populated with required info.

handleCancelCommand

protected abstract org.apache.struts.action.ActionForward handleCancelCommand(org.apache.struts.action.ActionMapping mapping,
                                                                              org.apache.struts.action.ActionForm form,
                                                                              HttpServletRequest request,
                                                                              HttpServletResponse response)
NOT YET DOCUMENTED

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

handleDoneCommand

protected abstract org.apache.struts.action.ActionForward handleDoneCommand(org.apache.struts.action.ActionMapping mapping,
                                                                            org.apache.struts.action.ActionForm form,
                                                                            HttpServletRequest request,
                                                                            HttpServletResponse response)
Validate information supplied by user, return to edit form if there are errors, or display confirmation page if there are no errors.

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

handleSubmitCommand

protected abstract org.apache.struts.action.ActionForward handleSubmitCommand(org.apache.struts.action.ActionMapping mapping,
                                                                              org.apache.struts.action.ActionForm form,
                                                                              HttpServletRequest request,
                                                                              HttpServletResponse response)
Attempt to write the suggestion to a DCS instance, forward user to confirmation page.

Parameters:
mapping - NOT YET DOCUMENTED
form - NOT YET DOCUMENTED
request - NOT YET DOCUMENTED
response - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

handleStaleData

protected org.apache.struts.action.ActionForward handleStaleData(org.apache.struts.action.ActionMapping mapping,
                                                                 org.apache.struts.action.ActionForm form,
                                                                 HttpServletRequest request)
Return user to suggestor front page and show message explaining that they were apparently trying to edit or submit data from a cancelled form

Parameters:
mapping - Description of the Parameter
request - Description of the Parameter
form - NOT YET DOCUMENTED
Returns:
Description of the Return Value

validateSuggestForm

protected abstract org.apache.struts.action.ActionErrors validateSuggestForm(org.apache.struts.action.ActionForm form,
                                                                             org.apache.struts.action.ActionMapping mapping,
                                                                             HttpServletRequest request)
The required fields for suggest-a-url are: url, nameFirst, nameLast, emailPrimary, instName

Parameters:
mapping - Description of the Parameter
request - Description of the Parameter
form - NOT YET DOCUMENTED
Returns:
Description of the Return Value

createRecord

protected abstract SuggestionRecord createRecord(org.apache.struts.action.ActionForm form)
                                          throws Exception
Update the SuggestionRecord (managed by SuggestResourceHelper) with values from the form bean

Parameters:
form - NOT YET DOCUMENTED
Throws:
Exception - Description of the Exception

setDebug

public static void setDebug(boolean db)
Sets the debug attribute of the SuggestAction class

Parameters:
db - The new debug value

DLESE Tools
v1.6.0