Package org.dlese.dpc.suggest.action
Class SuggestAction
java.lang.Object
org.apache.struts.action.Action
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:
- Presents form for user input
- Validates input. if there are errors returns user to form, otherwise presents confirmation page.
- User can elect to re-edit the form, or "submit" it.
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SuggestionRecordcreateRecord(org.apache.struts.action.ActionForm form) Update the SuggestionRecord (managed by SuggestResourceHelper) with values from the form beanorg.apache.struts.action.ActionForwardexecute(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 SchemaHelperGets the schemaHelper attribute of the SuggestAction objectprotected abstract SuggestHelperGets the suggestHelper attribute of the SuggestAction objectprotected abstract org.apache.struts.action.ActionForwardhandleCancelCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) NOT YET DOCUMENTEDprotected abstract org.apache.struts.action.ActionForwardhandleDoneCommand(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.ActionForwardhandleEditCommand(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.ActionForwardhandleOtherCommands(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) NOT YET DOCUMENTEDprotected org.apache.struts.action.ActionForwardhandleStaleData(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 formprotected abstract org.apache.struts.action.ActionForwardhandleSubmitCommand(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.ActionForwardinitializeSuggestor(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) NOT YET DOCUMENTEDstatic voidsetDebug(boolean db) Sets the debug attribute of the SuggestAction classprotected abstract org.apache.struts.action.ActionErrorsvalidateSuggestForm(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, instNameMethods 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
-
Constructor Details
-
SuggestAction
public SuggestAction()
-
-
Method Details
-
getSuggestHelper
Gets the suggestHelper attribute of the SuggestAction object- Returns:
- The suggestHelper value
- Throws:
ServletException- NOT YET DOCUMENTED
-
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 anActionForwardinstance 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:
executein classorg.apache.struts.action.Action- Parameters:
mapping- Description of the Parameterform- Description of the Parameterrequest- Description of the Parameterresponse- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
IOException- Description of the ExceptionServletException- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 DOCUMENTEDform- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTEDresponse- 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 Parameterform- NOT YET DOCUMENTEDrequest- Description of the Parameter- 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:
form- NOT YET DOCUMENTEDmapping- Description of the Parameterrequest- Description of the Parameter- 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
-