|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.form.engine.FormEngine
public abstract class FormEngine
Implements a rendering and form submission algorithm that keeps state in session for multiple pages. Subclasses implement extension hooks to provide the actual views used.
Field Summary | |
---|---|
info.magnolia.rendering.context.RenderingContext |
context
|
protected boolean |
redirectWithParams
|
Constructor Summary | |
---|---|
FormEngine(info.magnolia.rendering.context.RenderingContext context)
|
Method Summary | |
---|---|
protected FormState |
createAndSetFormState()
|
protected void |
destroyFormState()
|
protected abstract void |
executeProcessors(Map<String,Object> parameters)
|
protected abstract FormDataBinder |
getFormDataBinder()
|
FormState |
getFormState()
|
protected FormState |
getFormState(String formStateToken)
|
protected String |
getFormStateToken()
|
protected abstract View |
getFormView(FormStepState step)
Called when the form is to be rendered. |
protected String |
getNextPage()
Returns the UUID of the page to redirect to when validation succeeds or null to proceed to executing processors. |
protected String |
getPreviousPage()
Returns the UUID of the previous page or null if there is no such page (i.e. |
protected abstract View |
getProcessorFailedView(String errorMessage)
Called when a processor failed. |
protected abstract View |
getSuccessView()
Called when validation was successful and all processors executed successfully. |
protected View |
getValidationFailedView(FormStepState step)
Called when validation fails. |
protected View |
getValidationSuccessfulView(FormState formState)
Called when validation has been performed and there were no validation errors. |
protected abstract 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. |
protected View |
handleNoSuchFormStateOnSubmit(String formStateToken)
Called when a submission occurs with a form state token but there is no formState in session. |
View |
handleRequest(javax.jcr.Node content)
|
protected View |
handleTokenMissing()
Called when the form is to be rendered and there's no token provided. |
protected boolean |
isBackButton()
|
protected boolean |
isFormSubmission()
|
boolean |
isRedirectWithParams()
|
void |
setFormState(FormState formState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean redirectWithParams
public info.magnolia.rendering.context.RenderingContext context
Constructor Detail |
---|
@Inject public FormEngine(info.magnolia.rendering.context.RenderingContext context)
Method Detail |
---|
public View handleRequest(javax.jcr.Node content) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public boolean isRedirectWithParams()
protected FormState createAndSetFormState()
protected String getFormStateToken() throws FormStateTokenMissingException
FormStateTokenMissingException
protected FormState getFormState(String formStateToken) throws NoSuchFormStateException
NoSuchFormStateException
protected void destroyFormState()
public FormState getFormState()
public void setFormState(FormState formState)
protected boolean isFormSubmission()
protected boolean isBackButton()
mgnlFormBackButtonPressed
. Check formSubmit.ftl script to see how it works on the client-side.protected View handleTokenMissing() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected abstract View getFormView(FormStepState step) throws javax.jcr.RepositoryException
step
- is null when we render the page for the first time. I.e. when no validation has taken place.
javax.jcr.RepositoryException
protected View getValidationSuccessfulView(FormState formState) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getNextPage() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected View getValidationFailedView(FormStepState step) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected abstract View getProcessorFailedView(String errorMessage) throws javax.jcr.RepositoryException
errorMessage
- can be null in case another exception than FormProcessorFailedException is thrown by processor.
javax.jcr.RepositoryException
protected abstract View getSuccessView() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected abstract View handleNoSuchFormState(String formStateToken) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected View handleNoSuchFormStateOnSubmit(String formStateToken) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected abstract FormDataBinder getFormDataBinder()
protected abstract void executeProcessors(Map<String,Object> parameters) throws javax.jcr.RepositoryException, FormProcessorFailedException
javax.jcr.RepositoryException
FormProcessorFailedException
protected String getPreviousPage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |