blob: 7445cf545d5e8bf08330c2c18e7891afd5e19a69 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
<document>
<header>
<title>XMLForm Handling</title>
<authors>
<person name="Ivelin Ivanov" email="ivelin@apache.org"/>
<person name="Daniel Fagerstrom" email="daniel.fagerstrom@swipnet.se"/>
</authors>
</header>
<body>
<s1 title="Notices">
<note>
This document is out of date. XMLForm is not supported anymore starting from
the Cocoon 2.1 release. Alternatively, you can use <link
href="../flow/jxforms.html">JXForms</link>, which is conceptually the
same but offers a more robust implementation. Another emerging form
framework is <link
href="http://wiki.cocoondev.org/Wiki.jsp?page=Woody">Woody</link>.
</note>
<p>This document is based on components included in the current un-released Cocoon 2.1
distribution. Be sure
to look at the WARNING document that accompanies such pre-release versions.
</p>
</s1>
<s1 title="Introduction">
<p>The XMLForm framework is inspired by Apache Jakarta Struts and
W3C XForms.</p>
<p>Its goal is to:</p>
<ul>
<li>Ease the development of sophisticated web applications
utilizing complex data types and multi-page transactions</li>
<li>Provide an automated 2 way mapping between
<![CDATA[
HTML Forms <-> XML <-> JavaBeans
]]></li>
<li>Use standard XML schema languages like XML Schema, Relax-NG,
Schematron for data validation</li>
<li>Promote complete reuse of Cocoon Actions for:</li>
<ul>
<li>UI centric web applications - HTML, WML, UXL, VoiceML,
etc.</li>
<li>Web Services (based on the REST paradigm)</li>
<li>Remote Portal Forms. (An interactive extension of static
content formats like Netscape RSS)</li>
</ul>
<li>Utilize XPath tools like Apache Jakarta Commons JXPath for
read/write access to JavaBeans, DOM nodes and mixed objects.</li>
<li>Utilize the existing Cocoon XML functional testing framework
- AntEater.</li>
</ul>
<p>The current implementation offers the following features:</p>
<ol>
<li>Automated 2 way binding of HTML Forms to JavaBeans (and DOM
nodes) through XPath</li>
<li>Automatic validation of JavaBeans(and DOM nodes) through
Schematron schemas</li>
<li>Intermediate XForms like XML markup for form views</li>
</ol>
</s1>
<s1 title="Background">
<p>The aim of XMLForm, is to build and edit an xml document
(called the instance), subject to constraints from some schema
(XMLSchema, Schematron, ...), through a sequence of form pages.
The instance is either a dom-document or a Java bean-structure or
a mix. XMLForm consist, of three main components:</p>
<ul>
<li>Form - is responsible for the instance and validation of it.
Form objects are stored in request attributes for one page forms
and session attributes for wizards (multi page forms). A Form can
be populated from the request parameters. This is the "model in
MVC terms.</li>
<li>XMLFormTransformer - takes a form descriptor, (similar to
XForms) as input and fill it with data and error messages from a
Form object that is referred in an attribute. This is the "view"
in MVC terms.</li>
<li>AbstractXMLFormAction, (WizardAction) - creates the Form
object if necessary and populates it with data based on the
request parameters. It can also take care of flow handling and
checkbox state. This is the "controller" in MVC terms.</li>
</ul>
</s1>
<s1 title="Demonstration">
<p>
In version 2.1, see XMLForm in action with the by selecting:
<code>http://localhost:8080/cocoon/samples/xmlform/"</code>.
<!-- <link href="../../overview.html#samples">Cocoon Samples</link> ...
<link href="../../../samples/xmlform/">XMLForm Demonstration</link> -->
</p>
</s1>
<s1 title="Further information">
<p>See the
<link href="../../howto/xmlform-wizard/howto-xmlform-wizard.html">Cocoon XMLForm How-To</link>
</p>
<p>Please discuss Cocoon XMLForm on the
<link href="http://cocoon.apache.org/community/mail-lists.html">mailing lists</link>
</p>
</s1>
</body>
</document>