org.riotfamily.forms.factory
Class RepositoryFormController

java.lang.Object
  extended by org.riotfamily.forms.controller.AbstractFormController
      extended by org.riotfamily.forms.controller.AjaxFormController
          extended by org.riotfamily.forms.factory.RepositoryFormController
All Implemented Interfaces:
MessageSourceAware, Controller
Direct Known Subclasses:
AbstractFrontOfficeFormController, BaseFormController

public abstract class RepositoryFormController
extends AjaxFormController

FormController that creates forms using a FormRepository.

Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
protected static String DEFAULT_FORM_ID_PARAM
           
 
Fields inherited from class org.riotfamily.forms.controller.AbstractFormController
BUTTON_CONTAINER_ID, FORM_SUBMISSION_HANDLER, log
 
Constructor Summary
RepositoryFormController(FormRepository formRepository)
           
 
Method Summary
protected  Form createForm(HttpServletRequest request)
          Subclasses must implement this method and return a fresh Form instance.
protected  String getFormId(HttpServletRequest request)
          Returns the id of the form to be used.
protected  String getFormIdParam()
           
protected  FormRepository getFormRepository()
           
protected  String getSessionAttribute(HttpServletRequest request)
          Returns the name of the attribute under which the Form is stored in the HTTP session.
 void setFormIdParam(String formIdParam)
           
 
Methods inherited from class org.riotfamily.forms.controller.AjaxFormController
handleFormRequest, initForm, isEventRequest, isInitialRequest, processAjaxRequest, processEventRequest, renderForm, setMessageSource
 
Methods inherited from class org.riotfamily.forms.controller.AbstractFormController
createAndInitForm, createModelAndView, getForm, getFormBackingObject, getWriter, handleContentRequest, handleFormSubmission, handleRequest, initController, isContentRequest, isExclusiveRequest, populateForm, processForm, removeFormFromSession, setFormContextFactory, setProcessNewForms, showForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORM_ID_PARAM

protected static final String DEFAULT_FORM_ID_PARAM
See Also:
Constant Field Values
Constructor Detail

RepositoryFormController

public RepositoryFormController(FormRepository formRepository)
Method Detail

getFormRepository

protected FormRepository getFormRepository()

getFormIdParam

protected String getFormIdParam()

setFormIdParam

public void setFormIdParam(String formIdParam)

getSessionAttribute

protected String getSessionAttribute(HttpServletRequest request)
Returns the name of the attribute under which the Form is stored in the HTTP session. This implementation returns the formId with the controller's class name as prefix.

Overrides:
getSessionAttribute in class AbstractFormController

getFormId

protected String getFormId(HttpServletRequest request)
Returns the id of the form to be used. The default implementation returns the value of the formIdParam request parameter.


createForm

protected Form createForm(HttpServletRequest request)
Description copied from class: AbstractFormController
Subclasses must implement this method and return a fresh Form instance.

Specified by:
createForm in class AbstractFormController