magoffin.matt.ma2.web
Class AbstractForm

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by org.springframework.web.servlet.mvc.BaseCommandController
                      extended by org.springframework.web.servlet.mvc.AbstractFormController
                          extended by org.springframework.web.servlet.mvc.SimpleFormController
                              extended by magoffin.matt.ma2.web.AbstractForm
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.servlet.mvc.Controller
Direct Known Subclasses:
AddCommentForm, AlbumForm, CollectionForm, DownloadItemsForm, ForgotPasswordConfirmForm, ForgotPasswordForm, LogonForm, MoveItemsForm, PreferencesForm, SortAlbumsForm, SortMediaItemsForm, ThemeForm, UploadMediaForm, UserForm, ViewSettingsForm

public abstract class AbstractForm
extends org.springframework.web.servlet.mvc.SimpleFormController

Abstract base class for form controllers.

Version:
$Revision: 176 $ $Date: 2008-12-28 14:33:18 +1300 (Sun, 28 Dec 2008) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
static java.lang.String HTTP_USER_AGENT_HEADER
          The HTTP User-Agent header.
static java.lang.String PARAM_CANCEL
          Parameter triggering the cancel action.
 
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
AbstractForm()
           
 
Method Summary
protected  org.springframework.web.bind.ServletRequestDataBinder createBinder(javax.servlet.http.HttpServletRequest request, java.lang.Object command)
           
 magoffin.matt.xweb.util.ServletRequestDataBinderTemplate getBinderTemplate()
           
 java.lang.String getCancelView()
           
 DomainObjectFactory getDomainObjectFactory()
           
 SystemBiz getSystemBiz()
           
 WebHelper getWebHelper()
           
protected  void initApplicationContext()
           
protected  boolean isCancel(javax.servlet.http.HttpServletRequest request)
          Return if cancel action is specified in the request.
protected  org.springframework.web.servlet.ModelAndView processCancel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors)
          Perform a cancel form submit request.
protected  org.springframework.web.servlet.ModelAndView processFormSubmission(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors)
           
protected  void registerCalendarEditor(org.springframework.web.bind.ServletRequestDataBinder binder, BizContext context, magoffin.matt.util.ThreadSafeDateFormat format, java.util.TimeZone zone)
          Register a CalendarEditor property editor for Calendar bean properties.
 void setBinderTemplate(magoffin.matt.xweb.util.ServletRequestDataBinderTemplate binderTemplate)
           
 void setCancelView(java.lang.String cancelView)
           
 void setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
           
 void setSystemBiz(SystemBiz systemBiz)
           
 void setWebHelper(WebHelper webHelper)
           
 
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, onSubmit, referenceData, referenceData, setFormView, setSuccessView, showForm, showForm, suppressValidation
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm
 
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController
bindAndValidate, checkCommand, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, suppressBinding
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CANCEL

public static final java.lang.String PARAM_CANCEL
Parameter triggering the cancel action. Can be called from any wizard page!

See Also:
Constant Field Values

HTTP_USER_AGENT_HEADER

public static final java.lang.String HTTP_USER_AGENT_HEADER
The HTTP User-Agent header.

See Also:
Constant Field Values
Constructor Detail

AbstractForm

public AbstractForm()
Method Detail

initApplicationContext

protected void initApplicationContext()
Overrides:
initApplicationContext in class org.springframework.web.servlet.mvc.BaseCommandController

createBinder

protected org.springframework.web.bind.ServletRequestDataBinder createBinder(javax.servlet.http.HttpServletRequest request,
                                                                             java.lang.Object command)
                                                                      throws java.lang.Exception
Overrides:
createBinder in class org.springframework.web.servlet.mvc.BaseCommandController
Throws:
java.lang.Exception

registerCalendarEditor

protected void registerCalendarEditor(org.springframework.web.bind.ServletRequestDataBinder binder,
                                      BizContext context,
                                      magoffin.matt.util.ThreadSafeDateFormat format,
                                      java.util.TimeZone zone)
Register a CalendarEditor property editor for Calendar bean properties.

Parameters:
binder - the binder
context - the current context, or null to not use User's time zone
format - the date format to use
zone - the time zone to use, or null for default

isCancel

protected boolean isCancel(javax.servlet.http.HttpServletRequest request)
Return if cancel action is specified in the request.

Default implementation looks for "_cancel" parameter in the request.

Parameters:
request - current HTTP request
Returns:
true if user canceled action
See Also:
PARAM_CANCEL

processFormSubmission

protected org.springframework.web.servlet.ModelAndView processFormSubmission(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response,
                                                                             java.lang.Object command,
                                                                             org.springframework.validation.BindException errors)
                                                                      throws java.lang.Exception
Overrides:
processFormSubmission in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
java.lang.Exception

processCancel

protected org.springframework.web.servlet.ModelAndView processCancel(javax.servlet.http.HttpServletRequest request,
                                                                     javax.servlet.http.HttpServletResponse response,
                                                                     java.lang.Object command,
                                                                     org.springframework.validation.BindException errors)
Perform a cancel form submit request.

This method is called by processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException) if the isCancel(HttpServletRequest) method returns true.

Parameters:
request - the current request
response - the response
command - the command
errors - the errors
Returns:
a ModelAndView for handling the cancel request

getCancelView

public java.lang.String getCancelView()
Returns:
Returns the cancelView.

setCancelView

public void setCancelView(java.lang.String cancelView)
Parameters:
cancelView - The cancelView to set.

getDomainObjectFactory

public DomainObjectFactory getDomainObjectFactory()
Returns:
Returns the domainObjectFactory.

setDomainObjectFactory

public void setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
Parameters:
domainObjectFactory - The domainObjectFactory to set.

getSystemBiz

public SystemBiz getSystemBiz()
Returns:
Returns the systemBiz.

setSystemBiz

public void setSystemBiz(SystemBiz systemBiz)
Parameters:
systemBiz - The systemBiz to set.

getWebHelper

public WebHelper getWebHelper()
Returns:
Returns the webHelper.

setWebHelper

public void setWebHelper(WebHelper webHelper)
Parameters:
webHelper - The webHelper to set.

getBinderTemplate

public magoffin.matt.xweb.util.ServletRequestDataBinderTemplate getBinderTemplate()
Returns:
the binderTemplate

setBinderTemplate

public void setBinderTemplate(magoffin.matt.xweb.util.ServletRequestDataBinderTemplate binderTemplate)
Parameters:
binderTemplate - the binderTemplate to set