net.sf.colle.forms
Class Form

java.lang.Object
  extended bynet.sf.colle.forms.Structure
      extended bynet.sf.colle.forms.Form
All Implemented Interfaces:
FormElement

public class Form
extends Structure

This class define the root of a form. Created: 10 Jul 2001

Version:
$Revision: 1.5 $, $Date: 2004/12/01 06:50:32 $
Author:
Jeremy Miller

Field Summary
 
Fields inherited from interface net.sf.colle.forms.FormElement
ERROR_INVALID, ERROR_REQUIRED, UNKNOWN, VALID
 
Constructor Summary
Form(String psName, Object pxAppliationElement, String psInitialState)
          Create a new form element.
 
Method Summary
 String getAction()
          Returns the form action.
 String getState()
          Returns the form state.
 void map(org.jdom.Element pxElement)
          Maps the form data into the result document.
 boolean service(HttpServletRequest pxRequest)
          Services a request.
 void setAction(String psAction)
          Set the form action.
 void setState(String psState)
          Set the form state.
 
Methods inherited from class net.sf.colle.forms.Structure
add, getApplicationElement, getElement, getErrorCode, getName, getPath, mapImpl, service, setErrorCode, setToDefault, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Form

public Form(String psName,
            Object pxAppliationElement,
            String psInitialState)
Create a new form element.

Parameters:
psName - name of form
psInitialState - current state of form
Method Detail

service

public boolean service(HttpServletRequest pxRequest)
Services a request. Only call this method if the request was triggered by a user submitting this form.

Parameters:
pxRequest - http request to fetch data from
Returns:
true if the request contains a form

getAction

public String getAction()
Returns the form action. If null the action defined in the layout definition will be used.


setAction

public void setAction(String psAction)
Set the form action. Setting the action to null (the default) will cause the action defined in the layout definition to be used.


getState

public String getState()
Returns the form state.


setState

public void setState(String psState)
Set the form state.


map

public void map(org.jdom.Element pxElement)
Maps the form data into the result document. This data is then displayed in the form through the generated XSL template.

Specified by:
map in interface FormElement
Overrides:
map in class Structure
Parameters:
pxElement - parent element to add new elements onto