You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2007/09/27 21:57:38 UTC
svn commit: r580139 [15/28] - in /cocoon/site/site/2.2: ./ blocks/
blocks/ajax/ blocks/ajax/1.0/ blocks/ajax/1.0/apidocs/ blocks/ajax/1.0/css/
blocks/ajax/1.0/images/ blocks/ajax/1.0/images/logos/ blocks/css/
blocks/forms/ blocks/forms/1.0/ blocks/form...
Added: cocoon/site/site/2.2/blocks/forms/1.0/752_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/752_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/752_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/752_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,469 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="489_1_1.html">Basics</a>
+ <ul>
+
+ <li >
+ <a href="489_1_1.html">Introduction</a>
+ </li>
+
+ <li >
+ <a href="478_1_1.html">Sample</a>
+ </li>
+
+ <li >
+ <strong>Improving the sample</strong>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Improving the simple sample</h1><p>This section describes some possible improvements to the simple sample.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Automatic layouting</h1><p>A very common way of layouting a form is in a table with two columns: the
+left column contains the labels, the right column the input fields. The CForms
+XSL stylesheets support some tags to do this automatically for you. Here is the
+template for the simple sample, using automatic two-column styling:</p><pre><html xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+ xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+
+ <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+
+ <head>
+ <title>Registration form</title>
+ </head>
+ <body>
+ <h1>Registration</h1>
+ <ft:form-template action="#{$continuation/id}.continue" method="POST">
+<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"> <fi:group>
+ <fi:styling layout="columns"/>
+ <fi:items></strong>
+ <ft:widget id="name"/>
+ <ft:widget id="email"/>
+ <ft:widget id="age"/>
+ <ft:widget id="password">
+ <fi:styling type="password"/>
+ </ft:widget>
+ <ft:widget id="confirmPassword">
+ <fi:styling type="password"/>
+ </ft:widget>
+ <ft:widget id="spam"/>
+<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"> </fi:items>
+ </fi:group></strong>
+ <input type="submit"/>
+ </ft:form-template>
+ </body>
+</html>
+</pre><p>As you see, it is no longer needed to use the <tt>ft:widget-label</tt> tags.
+Furthermore, the stylesheets will properly use the HTML <tt>label</tt> tag to
+associate the label with the input field.</p><p>Other supported stylings include "tabs" (for tabbed panes), "choice" (similar
+to tabs but with a dropdown to switch), "fieldset" (groups the fields in a frame
+with a label). See the CForms samples for examples of how to use them.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Using i18n</h1><p>As mentioned before, you can internationalize the form labels by embedding
+<tt>i18n</tt> tags that will be handled by the i18n transformer. Let's look at
+the concrete steps to achieve this.</p><p>First, the form definition. Here we need to add the declaration of the i18n
+namespace, and for now we'll just apply i18n for the name field. This is done as
+follows:</p><pre><fd:form
+ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+ <strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">xmlns:i18n="http://apache.org/cocoon/i18n/2.1"</strong>>
+
+ <fd:widgets>
+ <fd:field id="name" required="true">
+ <fd:label><strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"><i18n:text key="name"/></strong>:</fd:label>
+ <fd:datatype base="string"/>
+ <fd:validation>
+ <fd:length min="2"/>
+ </fd:validation>
+ </fd:field>
+[...]
+</pre><p>Then, the resource bundle. Resource bundles for the i18n transformer are in
+an XML format. Create a subdirectory called i18n and put a file called
+messages.xml in it, containing the following:</p><pre><?xml version="1.0"?>
+<catalogue>
+ <message key="name">Name</message>
+</catalogue>
+</pre><p>The only thing left now is to change the configuration of the i18n
+transformer to make it aware of this resource bundle. Change the configuration
+of the i18n transformer in the sitemap as follows:</p><pre> <map:transformer name="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer">
+ <catalogues <strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">default="mymessages"</strong>>
+ <strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"><catalogue id="mymessages" name="messages" location="i18n"/></strong>
+ <catalogue id="forms" name="messages"
+ location="resource://org/apache/cocoon/forms/system/i18n"/>
+ </catalogues>
+ <cache-at-startup>true</cache-at-startup>
+ </map:transformer>
+</pre><p>The location attribute of the catalogue is relative to the location of the
+sitemap, so the value i18n refers to the subdirectory you created in the
+previous step. As we did not mention the catalogue explicitely on the
+<tt>i18n:text</tt> element, we need to make it the default (the forms catalogue
+does not need to be the default). For more information on this see the i18n
+transformer documentation.</p><p>If you now try the sample again, everything should work as before; you should
+still see the "Name" label.</p><p>But now we still need to tell the i18n transformer what locale to use. To
+make our explanation more complete, we should not only tell the i18n transformer
+what locale to use, but the same locale should typically also be used when
+parsing form data and formatting form data for output (this does not matter for
+string fields, but important for dates and numbers). This can be done as
+follows. In the flowscript (registration.js), specify a locale property on the
+form. Let us take french as an example:</p><pre>[...]
+ var form = new Form("registration.xml");
+ form.locale = new java.util.Locale("fr");
+[...]
+</pre><p>The locale you specify here will also be automatically added to the viewData
+for the pipeline when calling showForm.</p><p>In the sitemap, we need to pass the locale to the template generator and the
+i18n transformer:</p><pre> <map:match pattern="registration-display-pipeline">
+ <map:generate type="jx" src="registration_template.xml">
+<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"> <map:parameter name="locale" value="{flow-attr:locale}"/></strong>
+ </map:generate>
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">{flow-attr:locale}</strong>"/>
+ </map:transform>
+ <map:transform src="forms-samples-styling.xsl"/>
+ <map:serialize/>
+ </map:match>
+</pre><p>The "flow-attr" <em>input module</em> is used to retrieve values from the
+viewData.</p><p>Finally, create a french resource bundle: i18n/messages_fr.xml:</p><pre><?xml version="1.0"?>
+<catalogue>
+ <message key="name">Nom</message>
+</catalogue>
+</pre><p>If you now try the registration sample again, "Name" should be replaced by
+"Nom".</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/752?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/753_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/753_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/753_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/753_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,459 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="484_1_1.html">Widget concepts</a>
+ <ul>
+
+ <li >
+ <a href="484_1_1.html">Validation</a>
+ </li>
+
+ <li >
+ <a href="479_1_1.html">Event Handling</a>
+ </li>
+
+ <li >
+ <a href="487_1_1.html">Datatypes</a>
+ </li>
+
+ <li >
+ <strong>Selection lists</strong>
+ </li>
+
+ <li >
+ <a href="733_1_1.html">Widget States</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Selection lists</h1><p>This section explains selection lists and their available implementations.
+Selection lists can be used with the <a href="481_1_1.html">field</a> or
+<a href="490_1_1.html">multivaluefield</a> widgets. Selection lists are closely
+related to the datatype of the widget, since the items in the selection list
+should of course match the datatype of the widget.</p><h1 id="default" xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Default selection list implementation</h1><p>The selection list can be defined inline or read from an external source.
+Example of inline declaration:</p><pre><fd:datatype base="long"/>
+<fd:selection-list>
+ <fd:item value="1"/>
+ <fd:item value="2"/>
+ <fd:item value="3">
+ <fd:label>three</fd:label>
+ </fd:item>
+ <fd:item value="4"/>
+ <fd:item value="5"/>
+</fd:selection-list></pre><p>Each item in the selection-list can have a value (specified in the value
+attribute) and optionally a label (specified in the fd:label element). If no
+label is specified, the value is used as label. The fd:label element can contain
+mixed content.</p><p>To set a default selection, just set the value of the widget containing the
+selection list.</p><p>Example of getting a selection list from an external source:</p><pre><fd:datatype base="string"/>
+<fd:selection-list src="cocoon:/mychoices.xml"/></pre><p>All Cocoon-supported protocols can be used. The format of the XML produced by
+the source should be the same as in case of inline specification of the
+selection list, thus the root element should be a fd:selection-list element.</p><p>By default, the selection list will be retrieved form the source once, and
+then become part of the form definition, just like when you would have defined
+it inline. This has the consequence that if the XML produced by the source
+changes, you won't see the selection list changed. If you'd like CForms to
+retrieve the content of the selection list each time it needs it, add an
+attribute called "dynamic" with value "true", for example:</p><pre><fd:datatype base="string"/>
+<fd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/></pre><p>If the datatype is different from string, CForms will need to convert the
+string values that appear in the selection list to their object equivalent. This
+conversion is normally done using the same convertor as the datatype in which
+the selection list appears, but you can also specify a different one. Here's an
+example for a date selection list:</p><pre><fd:datatype base="date"/>
+<fd:selection-list>
+ <fd:convertor type="formatting">
+ <fd:patterns>
+ <fd:pattern>yyyyMMdd</fd:pattern>
+ </fd:patterns>
+ </fd:convertor>
+ <fd:item value="13020711"/>
+ <fd:item value="19120623"/>
+ <fd:item value="19690721"/>
+ <fd:item value="19700506"/>
+ <fd:item value="19781014"/>
+ <fd:item value="20010911"/>
+</fd:selection-list></pre><p>If there is a fd:convertor element, it should always be the first child
+element of the fd:selection-list element. This works of course also for
+selection lists retrieved from external sources.</p><p>Selection list implementations are pluggable. Everything said until now
+applies to the default selection list implementation. An alternative
+implementation can be specified by using a <strong>type</strong> attribute on
+the fd:selection-list element. The sections below describe the alternative
+implementations currently available.</p><h1 id="flow" xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">flow-jxpath selection list implementation</h1><p>See the javadoc of the
+<a href="http://cvs.apache.org/viewcvs.cgi/*checkout*/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java?rev=HEAD">FlowJXPathSelectionListBuilder</a>
+class for now.</p><p>Example:</p><p>In flowscript:</p><pre>var data = new Object();
+
+data.cityList = new Array(2);
+data.cityList[0] = {value:"AL", label:"Alabama"};
+data.cityList[1] = {value:"AK", label:"Alaska"};
+
+form.showForm("flow/myform.form", data);</pre><p>and the corresponding selection list definition:</p><pre><fd:selection-list type="flow-jxpath" list-path="cityList"
+ value-path="value" label-path="label" /></pre><p>Hint: the label can be any kind of object, its toString() method will be
+called to get the string to be displayed. In case the object supplied as label
+implements the XMLizable interface, its toSAX method will be called instead. One
+practical application of this is using i18n labels:</p><pre>importClass (Packages.org.apache.cocoon.forms.util.I18nMessage);
+...
+mylist[0] = {value: "x", label: new I18nMessage("myI18nKey") };</pre><h1 id="enum" xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">enum selection list implementation</h1><p>This type of selection list outputs a list of items corresponding to the
+possible instances of an enumerated type (see below).</p><p>Example:</p><pre><fd:selection-list type="enum" class="com.example.Sex"/></pre><p>outputs:</p><pre><fi:selection-list>
+ <fi:item value=""/>
+ <fi:item value="com.example.Sex.MALE">
+ <fi:label>
+ <i18n:text>com.example.Sex.MALE</i18n:text>
+ </fi:label>
+ </fi:item>
+ <fi:item value="com.example.Sex.FEMALE">
+ <fi:label>
+ <i18n:text>com.example.Sex.FEMALE</i18n:text>
+ </fi:label>
+ </fi:item>
+</fi:selection-list></pre><p>If you don't want an initial null value, add a
+<strong>nullable="false"</strong> attribute to the
+<strong>fd:selection-list</strong> element. You can specify an i18n key to use
+as a label for the null element using the
+<strong>null-text="i18.key.here"</strong> attribute. This applies only to
+<strong>enum</strong> type selection lists.</p><p>Note : since the enum pattern is based on Class.getDeclaredFields() method,
+it's not always granted that the enum selection list items will be in the same
+order the fields are declared in the enumeration class. This is reported to
+happen expecially on IBM JRE. A good solution to this problem is to use the
+apache commons Enum as a super class of your enumeration classes. Due to the way
+this enumeration pattern is implemented, it's possible to grant the element
+orders in a portable way.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/753?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/754_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/754_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/754_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/754_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,453 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="477_1_1.html">Widgets</a>
+ <ul>
+
+ <li >
+ <a href="477_1_1.html">Action widget</a>
+ </li>
+
+ <li >
+ <a href="486_1_1.html">Aggregatefield widget</a>
+ </li>
+
+ <li >
+ <a href="482_1_1.html">Booleanfield widget</a>
+ </li>
+
+ <li >
+ <a href="1161_1_1.html">Calculated fields</a>
+ </li>
+
+ <li >
+ <a href="1294_1_1.html">Captcha Widget</a>
+ </li>
+
+ <li >
+ <a href="742_1_1.html">Class/New (not really widgets)</a>
+ </li>
+
+ <li >
+ <a href="481_1_1.html">Field widget</a>
+ </li>
+
+ <li >
+ <strong>Form</strong>
+ </li>
+
+ <li >
+ <a href="740_1_1.html">Group/Struct widget</a>
+ </li>
+
+ <li >
+ <a href="738_1_1.html">ImageMap widget</a>
+ </li>
+
+ <li >
+ <a href="497_1_1.html">Messages widget</a>
+ </li>
+
+ <li >
+ <a href="490_1_1.html">MultiValueField widget</a>
+ </li>
+
+ <li >
+ <a href="492_1_1.html">Output widget</a>
+ </li>
+
+ <li >
+ <a href="494_1_1.html">RepeaterAction widget</a>
+ </li>
+
+ <li >
+ <a href="496_1_1.html">Repeater widget</a>
+ </li>
+
+ <li >
+ <a href="495_1_1.html">RowAction widget</a>
+ </li>
+
+ <li >
+ <a href="493_1_1.html">Submit widget</a>
+ </li>
+
+ <li >
+ <a href="739_1_1.html">Tree widget</a>
+ </li>
+
+ <li >
+ <a href="741_1_1.html">Union widget</a>
+ </li>
+
+ <li >
+ <a href="483_1_1.html">Upload widget</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Form</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>The form itself is not really a widget, but we include its reference
+documentation here nonetheless.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre><fd:form id="..." state="...">
+ <fd:widgets>
+ [...]
+ </fd:widgets>
+ <fd:validation>
+ [...]
+ </fd:validation>
+ <fd:on-create>
+ [...]
+ </fd:on-create>
+ <fd:attributes>
+ <fd:attribute name="..." value="..."/>
+ </fd:attributes>
+</fd:form>
+</pre><p>The widgets contained by the form are defined inside the fd:widgets element.
+For an explanation of the other elements and attributes, see the
+<a href="481_1_1.html">field widget</a>. Specifying an id for the form is optional.
+</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1><p>A form is inserted into a template by use of the ft:form-template tag:</p><pre><ft:form-template>
+ [...]
+</ft:form-template>
+</pre><p>You can add the usual HTML form attributes such as action and method on the
+ft:form-tempate, they will be replicated in the output.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/754?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/755_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/755_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/755_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/755_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,432 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <strong>Form publishing</strong>
+ <ul>
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <strong>Templating</strong>
+ <ul>
+
+ <li >
+ <a href="480_1_1.html">Template Generator</a>
+ </li>
+
+ <li >
+ <a href="475_1_1.html">Template transformer</a>
+ </li>
+ </ul>
+ </li>
+
+ <li >
+ <a href="476_1_1.html">Generator</a>
+ </li>
+
+ <li >
+ <a href="485_1_1.html">XSLT</a>
+ </li>
+
+ <li >
+ <a href="1147_1_1.html">CSS</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Templating</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Introduction</h1><p>CForms templates make it possible to define the layout for your form in a
+simple way. The basic principle is that you create a template file containing
+<tt><ft:widget id="xyz"/></tt> elements where you want to insert the
+widgets. After execution of the template, these will be replaced by the XML
+representation of the corresponding widgets. The ft:widget elements can thus be
+embedded in e.g. a HTML layout. After processing of the template tags you will
+end up with HTML with here and there a piece of XML describing a widget. This
+XML description contains all state information of the widget: its value,
+validation errors, selection-list data if any, and so on. These
+widget-XML-descriptions will then typically be translated to HTML by an XSLT.
+This XSLT is not specific to one form, as it simply needs to know how to
+translate individual widgets to HTML, and does not have to create the complete
+page layout. CForms contains just such an XSLT so you don't have to write it
+yourself (except if you need to do heavy customisation). The image below
+illustrates this process.</p><p><img alt="forms_template_transformer" name="forms_template_transformer" height="356" width="581" src="images/405_1_1.img"></img></p><div class="note"><div><strong>Note: </strong>A completely different approach would be to do everything with
+XSLT, starting from the output of the <a href="476_1_1.html">FormsGenerator</a>. In
+general we recommend to use the CForms templating approach though.</div></div><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Available implementations</h1><p>There are two different mechanisms available to process the form tags:</p><ul>
+<li>A <a href="480_1_1.html">set of form macros for the JXTemplate Generator</a>
+</li>
+<li>A <a href="475_1_1.html">form template transformer</a></li>
+</ul>The JXTemplate-based approach is the newer one and is more powerful as you
+can make use of standard JX constructs in addition to the CForms template tags.
+<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Locating the form instance object</h1>In the most common case, the form object is passed by the flow controller to
+the pipeline in the view data under a key named "CocoonFormsInstance". There are
+alternative ways to locate the form, though these are dependent on the template
+implementation (JX or the transformer).<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Forms transformer element reference</h1><p>The elements to which the forms transformer reacts are all in the "ft" (Forms
+Template) namespace, which is identified by the following URI:</p><pre>http://apache.org/cocoon/forms/1.0#template</pre><p>These will generally be replaced by elements in the "fi" (Forms Instance)
+namespace, which is identified by the following URI:</p><pre>http://apache.org/cocoon/forms/1.0#instance
+</pre><p>A template should always consist of a <a href="754_1_1.html">ft:form-template
+tag</a> which then contains the tags to insert the individual widgets. Widgets
+are most often inserted using the ft:widget tag, but some widgets might need
+specific tags. See the descriptions of the individual widgets for the
+appropriate template tags.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">ft:widget</h2><p>The ft:widget element is replaced by the forms transformer by the XML
+representation of a widget. Which widget is specified by the id attribute. The
+ft:widget element can contain a fi:styling element containing parameters to
+influence the styling process (the XSLT). The forms transformer will simply copy
+the fi:styling element over to its output.</p><p>For example:</p><pre><ft:widget id="pass">
+ <fi:styling type="password"/>
+<ft:widget/></pre><p>will be replaced by:</p><pre><fi:field id="pass">
+ [... label, validation errors, ...]
+ <fi:styling type="password"/>
+</fi:field></pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">ft:widget-label</h2><p>The ft:widget-label element will be replaced by the forms transformer with
+the label of a certain widget (specified by an id attribute). The label will not
+be wrapped in another element.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">ft:continuation-id</h2><p>The ft:continuation-id element will be replaced by the forms transformer by:
+</p><pre><fi:continuation-id>
+ ID-of-the current-continuation
+</fi:continuation-id></pre><p>This might be useful for embedding the continuation ID in a hidden form
+field, for example.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/755?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/904_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/904_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/904_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/904_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,364 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <strong>Action</strong>
+ <ul>
+
+ <li >
+ <strong>HandleFormSubmitAction</strong>
+ </li>
+
+ <li >
+ <a href="1027_1_1.html">InitForm1Action</a>
+ </li>
+
+ <li >
+ <a href="1035_1_1.html">MakeFormAction</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">HandleFormSubmitAction</h1><h1>Summary</h1><p>No summary available. The summary needs to be defined using the
+ <tt>@cocoon.sitemap.component.documentation</tt> annotation in the Java source file for this component: </p><h1>Basic information</h1><table class="bodyTable"><tr class="a"><th>Component type</th><td>org.apache.cocoon.forms.acting.HandleFormSubmitAction</td></tr><tr class="b"><th>Cocoon block</th><td>Action</td></tr><tr class="a"><th>Java class</th><td>forms</td></tr><tr class="b"><th>Cachable</th><td></td></tr></table><h1>Documentation</h1><p>No documentation available yet.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/904?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/915_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/915_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/915_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/915_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,360 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <strong>Generator</strong>
+ <ul>
+
+ <li >
+ <strong>FormsGenerator</strong>
+ </li>
+
+ <li >
+ <a href="978_1_1.html">SuggestionListGenerator</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">FormsGenerator</h1><h1>Summary</h1><p>No summary available. The summary needs to be defined using the
+ <tt>@cocoon.sitemap.component.documentation</tt> annotation in the Java source file for this component: </p><h1>Basic information</h1><table class="bodyTable"><tr class="a"><th>Component type</th><td>org.apache.cocoon.forms.generation.FormsGenerator</td></tr><tr class="b"><th>Cocoon block</th><td>Generator</td></tr><tr class="a"><th>Java class</th><td>forms</td></tr><tr class="b"><th>Cachable</th><td>No</td></tr></table><h1>Documentation</h1><p>No documentation available yet.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/915?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>