org.riotfamily.website.form
Class AbstractMailFormController

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 org.riotfamily.website.form.AbstractMailFormController
All Implemented Interfaces:
InitializingBean, ApplicationContextAware, ServletContextAware, Controller

public abstract class AbstractMailFormController
extends SimpleFormController
implements InitializingBean

Simple controller that sends data collected from a from via email.


Field Summary
 
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
AbstractMailFormController()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  ServletRequestDataBinder createBinder(HttpServletRequest request, Object command)
           
protected abstract  String getMailText(HttpServletRequest request, Map<String,String> data)
           
protected  void initBinder(HttpServletRequest request, ServletRequestDataBinder binder)
           
protected  ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
           
protected  void prepareMail(SimpleMailMessage mail, Map<String,String> data)
          This method can be overridden in order to manipulate the mail before it is being sent.
 void setBcc(String[] bcc)
           
 void setFrom(String from)
           
 void setMailSender(MailSender mailSender)
           
 void setRequiredFields(String[] requiredFields)
           
 void setSubject(String subject)
           
 void setTo(String to)
           
 
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, processFormSubmission, 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, getWebBindingInitializer, initApplicationContext, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess
 
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, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
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
 

Constructor Detail

AbstractMailFormController

public AbstractMailFormController()
Method Detail

createBinder

protected ServletRequestDataBinder createBinder(HttpServletRequest request,
                                                Object command)
                                         throws Exception
Overrides:
createBinder in class BaseCommandController
Throws:
Exception

setTo

public void setTo(String to)

setBcc

public void setBcc(String[] bcc)

setFrom

public void setFrom(String from)

setSubject

public void setSubject(String subject)

setMailSender

public void setMailSender(MailSender mailSender)

setRequiredFields

public void setRequiredFields(String[] requiredFields)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

initBinder

protected void initBinder(HttpServletRequest request,
                          ServletRequestDataBinder binder)
                   throws Exception
Overrides:
initBinder in class BaseCommandController
Throws:
Exception

onSubmit

protected ModelAndView onSubmit(HttpServletRequest request,
                                HttpServletResponse response,
                                Object command,
                                BindException errors)
                         throws Exception
Overrides:
onSubmit in class SimpleFormController
Throws:
Exception

getMailText

protected abstract String getMailText(HttpServletRequest request,
                                      Map<String,String> data)
                               throws Exception
Throws:
Exception

prepareMail

protected void prepareMail(SimpleMailMessage mail,
                           Map<String,String> data)
This method can be overridden in order to manipulate the mail before it is being sent.