org.apache.cocoon.forms.flow.java
Class FormInstance

java.lang.Object
  extended by org.apache.cocoon.components.flow.java.AbstractContinuable
      extended by org.apache.cocoon.forms.flow.java.FormInstance
All Implemented Interfaces:
Continuable

public class FormInstance
extends AbstractContinuable

Implementation of the Cocoon Forms/Java Flow integration.

Version:
CVS $Id: FormInstance.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez, Stephan Michels

Constructor Summary
FormInstance(Element formDefinition)
          Create a form of an fd:form element in the form of a org.w3c.dom.Element
FormInstance(String uri)
          Create a form, given the URI of its definition file
FormInstance(String definitionFile, String bindingFile)
          Create a form, given the URI of its definition file, the binding file.
 
Method Summary
 void createBinding(String bindingURI)
           
 Object getAttribute(String name)
           
 Widget getChild(String name)
          Get a Widget (the java object) from the form.
 Widget getModel()
           
 String getSubmitId()
           
 void load(Object object)
           
 void removeAttribute(String name)
           
 void save(Object object)
           
 void setAttribute(String name, Object value)
           
 void show(String uri)
          Returns the bookmark continuation associated with this form, or undefined if setBookmark() has not been called.
 void show(String uri, Object bizData)
          Manages the display of a form and its validation.
 
Methods inherited from class org.apache.cocoon.components.flow.java.AbstractContinuable
getComponent, getContext, getLogger, getObjectModel, getParameters, getRequest, processPipelineTo, redirectTo, releaseComponent, sendPage, sendPage, sendPageAndWait, sendPageAndWait, sendStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormInstance

public FormInstance(String uri)
Create a form, given the URI of its definition file


FormInstance

public FormInstance(String definitionFile,
                    String bindingFile)
Create a form, given the URI of its definition file, the binding file.


FormInstance

public FormInstance(Element formDefinition)
Create a form of an fd:form element in the form of a org.w3c.dom.Element

Method Detail

getModel

public Widget getModel()

getChild

public Widget getChild(String name)
Get a Widget (the java object) from the form. If name is undefined, the form widget itself is returned. Otherwise, the form's child widget of name name is returned.


getSubmitId

public String getSubmitId()

show

public void show(String uri)
Returns the bookmark continuation associated with this form, or undefined if setBookmark() has not been called.


show

public void show(String uri,
                 Object bizData)
Manages the display of a form and its validation. This uses some additionnal propertied on the form object : - "locale" : the form locale (default locale is used if not set) - "validator" : additional validation function. This function receives the form object as parameter and should return a boolean indicating if the form handling is finished (true) or if the form should be redisplayed again (false) On return, the calling code can check some properties to know the form result : - "isValid" : true if the form was sucessfully validated - "submitId" : the id of the widget that triggered the form submit (can be null)

Parameters:
uri - the page uri (like in cocoon.sendPageAndWait())
bizData - some business data for the view (like in cocoon.sendPageAndWait()). The "{FormsPipelineConfig.CFORMSKEY}" and "locale" properties are added to this object.

createBinding

public void createBinding(String bindingURI)

load

public void load(Object object)

save

public void save(Object object)

setAttribute

public void setAttribute(String name,
                         Object value)

getAttribute

public Object getAttribute(String name)

removeAttribute

public void removeAttribute(String name)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.