info.magnolia.module.form.templates.components
Class AbstractFormEngine

java.lang.Object
  extended by info.magnolia.module.form.engine.FormEngine
      extended by info.magnolia.module.form.templates.components.AbstractFormEngine
Direct Known Subclasses:
StartStepFormEngine, SubStepFormEngine

public abstract class AbstractFormEngine
extends FormEngine

Implements common functionality used by both the first step and subsequent steps.


Field Summary
 
Fields inherited from class info.magnolia.module.form.engine.FormEngine
context, redirectWithParams
 
Constructor Summary
protected AbstractFormEngine(javax.jcr.Node configurationNode, FormParagraph configurationParagraph, info.magnolia.rendering.context.RenderingContext context)
           
 
Method Summary
protected  void executeProcessors(Map<String,Object> parameters)
           
 javax.jcr.Node getConfigurationNode()
           
 FormParagraph getConfigurationParagraph()
           
protected  FormDataBinder getFormDataBinder()
           
protected  View getFormView(FormStepState step)
          Called when the form is to be rendered.
protected  View getProcessorFailedView(String errorMessage)
          Called when a processor failed.
protected  View getSuccessView()
          Called when validation was successful and all processors executed successfully.
protected  View handleNoSuchFormState(String formStateToken)
          Called when the form was to be rendered for a supplied form token but there is no state in the session.
 
Methods inherited from class info.magnolia.module.form.engine.FormEngine
createAndSetFormState, destroyFormState, getFormState, getFormState, getFormStateToken, getNextPage, getPreviousPage, getValidationFailedView, getValidationSuccessfulView, handleNoSuchFormStateOnSubmit, handleRequest, handleTokenMissing, isBackButton, isFormSubmission, isRedirectWithParams, setFormState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFormEngine

protected AbstractFormEngine(javax.jcr.Node configurationNode,
                             FormParagraph configurationParagraph,
                             info.magnolia.rendering.context.RenderingContext context)
Method Detail

getConfigurationNode

public javax.jcr.Node getConfigurationNode()

getConfigurationParagraph

public FormParagraph getConfigurationParagraph()

handleNoSuchFormState

protected View handleNoSuchFormState(String formStateToken)
                              throws javax.jcr.RepositoryException
Description copied from class: FormEngine
Called when the form was to be rendered for a supplied form token but there is no state in the session. This typically happens when the user navigates back after having completed the form or if the user returns later via a bookmark or via browser history.

Specified by:
handleNoSuchFormState in class FormEngine
Throws:
javax.jcr.RepositoryException

getProcessorFailedView

protected View getProcessorFailedView(String errorMessage)
Description copied from class: FormEngine
Called when a processor failed.

Specified by:
getProcessorFailedView in class FormEngine
Parameters:
errorMessage - can be null in case another exception than FormProcessorFailedException is thrown by processor.

getSuccessView

protected View getSuccessView()
                       throws javax.jcr.RepositoryException
Description copied from class: FormEngine
Called when validation was successful and all processors executed successfully.

Specified by:
getSuccessView in class FormEngine
Throws:
javax.jcr.RepositoryException

getFormView

protected View getFormView(FormStepState step)
                    throws javax.jcr.RepositoryException
Description copied from class: FormEngine
Called when the form is to be rendered.

Specified by:
getFormView in class FormEngine
Parameters:
step - is null when we render the page for the first time. I.e. when no validation has taken place.
Throws:
javax.jcr.RepositoryException

getFormDataBinder

protected FormDataBinder getFormDataBinder()
Specified by:
getFormDataBinder in class FormEngine

executeProcessors

protected void executeProcessors(Map<String,Object> parameters)
                          throws javax.jcr.RepositoryException,
                                 FormProcessorFailedException
Specified by:
executeProcessors in class FormEngine
Throws:
javax.jcr.RepositoryException
FormProcessorFailedException


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.