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 [8/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/forms...
Added: cocoon/site/site/2.2/blocks/forms/1.0/1351_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/1351_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/1351_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/1351_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,507 @@
+<!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 >
+ <strong>Migration guide</strong>
+ </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">Migration guide</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Introduction</h1><p>Forms block has been recently adapted to use features that servlet services
+framework provides. For in-depth details of adoption process take a look at
+<a href="http://issues.apache.org/jira/browse/COCOON-1991">COCOON-1991</a>
+issue.</p><p>Here you'll find description of migration process which should be easy and
+straightforward. It is assumed that you already have proper block structure
+created with archetype, see <a href="../../../../2.2/1159_1_1.html">Your first Cocoon application
+using Maven 2</a>.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Connecting servlets</h2><p>First of all, in order to get access to the resources that Forms block makes
+available you need to create a connection to its servlet. Open
+src/main/resources/META-INF/cocoon/spring/servlet-service.xml for edition and
+put this configuration inside <tt><servlet:context></tt> tag:</p><pre><servlet:connections>
+ <entry key="ajax" value-ref="org.apache.cocoon.ajax.impl.servlet"/>
+ <entry key="forms" value-ref="org.apache.cocoon.forms.impl.servlet"/>
+</servlet:connections>
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Correcting links and paths</h2><p>You will need to perform massive find-and-replace operation multiple times.
+Previously, all external (available to the browser) resources were loaded with
+special <tt>_cocoon/**</tt> matcher and internal resources (like XSL files) were
+loaded with <tt>resource://</tt> scheme. Both are now considered as bad
+practice.<br></br>
+Special, global matcher cannot be easily provided in real blocks environment
+because it does not support concepts like block's polymorphism and makes Cocoon
+more monolithic. Loading resources of other block with <tt>resource:</tt> is
+also discouraged because resources location within block <strong>is not part of
+any block's contract</strong>. Only resources that are available with servlet:
+scheme are part of block's contract and should not change without significant
+reasoning.</p><p>Now you will see list of couple old and new paths/links. Performing normal
+find-and-replace operation on your block that you are migrating should be
+enough. Here is the list:</p><pre>resource://org/apache/cocoon/forms/flow/javascript/Form.js
+servlet:forms:/resource/internal/flow/javascript/Form.js
+
+resource://org/apache/cocoon/forms/generation/jx-macros.xml
+servlet:forms:/resource/internal/generation/jx-macros.xml
+
+resource://org/apache/cocoon/forms/system/i18n
+servlet:forms:/resource/internal/i18n
+
+resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl
+servlet:forms:/resource/internal/xsl/forms-page-styling.xsl
+
+resource://org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
+servlet:forms:/resource/internal/xsl/forms-advanced-field-styling.xsl
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">forms-samples-styling.xsl</h2><p>If you use forms-samples-styling.xsl for transforming your Forms into HTML
+code you will have to update it to newer version. Important change (apart from
+modified paths mentioned above) is that you should replace this fragment:</p><pre><!-- Location of the resources directory, where JS libs and icons are stored -->
+<xsl:param name="resources-uri">resources</xsl:param>
+</pre><p>with this one:</p><pre><!-- Location of the resources directories, where JS libs and icons are stored -->
+<xsl:param name="dojo-resources"/>
+<xsl:param name="forms-resources"/>
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Javascript adjustments (for widgets authors)</h2><p>If you happened to write custom widget you probably will need to adjust your
+code, also. Unfortunately, this step can be more troublesome than others and can
+demand from you better understanding of the changes that has been incorporated
+into Forms code during refactoring process. Here, the most important issues will
+be highlighted taking as example migration of MultiValueEditor from Cocoon's
+distribution.<br></br>
+Here is the diff:</p><pre>Index: src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js
+===================================================================
+--- src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js (wersja 517778)
++++ src/main/resources/org/apache/cocoon/forms/resources/js/MultiValueEditor.js (wersja 517779)
+@@ -39,9 +39,9 @@
+
+ cformsIdPrefix: "id-prefix-not-set",
+
+- resourcesUri: cocoon.resourcesUri, // to make this available to the template
++ formsResourcesUri: cocoon.formsResourcesUri, // to make this available to the template
+
+- templatePath: cocoon.resourcesUri + "/forms/js/templates/MultiValueEditor.html",
++ templatePath: cocoon.formsResourcesUri + "/js/templates/MultiValueEditor.html",
+
+ fillInTemplate: function(args, frag) {
+ cocoon.forms.MultiValueEditor.superclass.fillInTemplate(this, args, frag);
+
+Index: src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html
+===================================================================
+--- src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html (wersja 517778)
++++ src/main/resources/org/apache/cocoon/forms/resources/js/templates/MultiValueEditor.html (wersja 517779)
+@@ -9,11 +9,11 @@
+ </select>
+ </td>
+ <td width="20px">
+- <input dojoAttachPoint="deleteButton" type="image" src="${this.resourcesUri}/forms/img/delete.gif"/>
++ <input dojoAttachPoint="deleteButton" type="image" src="${this.formsResourcesUri}/img/delete.gif"/>
+ <br/>
+- <input dojoAttachPoint="moveUpButton" type="image" src="${this.resourcesUri}/forms/img/move_up.gif"/>
++ <input dojoAttachPoint="moveUpButton" type="image" src="${this.formsResourcesUri}/img/move_up.gif"/>
+ <br/>
+- <input dojoAttachPoint="moveDownButton" type="image" src="${this.resourcesUri}/forms/img/move_down.gif"/>
++ <input dojoAttachPoint="moveDownButton" type="image" src="${this.formsResourcesUri}/img/move_down.gif"/>
+ <br/>
+ </td>
+ </tr>
+</pre><p>As you can see, there is no <tt>cocoon.resourcesUri</tt> property anymore. If
+you put your own widget in Forms' resource tree, simply replace
+<tt>cocoon.resourcesUri</tt> with <tt>cocoon.formsResourcesUri</tt>. Otherwise,
+introduce your own property and set it's value to
+<tt>"servlet:/resource/external/yourwidget/"</tt> or similar.<br></br>
+If you use Forms URI, don't forget to remove redundant <tt>"/forms"</tt> prefix
+(see example above).</p><div class="note"><div><strong>Note: </strong>It has been removed because there is no universal
+<tt xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">_cocoon/**</tt> matcher loading resources for all blocks (including Forms);
+now every block is responsible on its own for loading its resources. Even more,
+there is no universal pattern for resources URLs because blocks can be mounted
+at different locations. You may think that situation is worse than it used to be
+but it's not the case. If you think that I suggest to learn more about servlet
+service framework.</div></div><p>If you have additional questions don't hesitate to ask for a help on user's
+mailing list.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Sitemap adjustments</h2><p>Obviously, you have to adjust your sitemap too to pass new parameters:</p><pre><map:transform src="resources/forms-samples-styling.xsl">
+ <map:parameter name="resources-uri" value="{request:contextPath}/_cocoon/resources"/>
+</map:transform>
+</pre><p>should be replaced with:</p><pre><map:transform src="resources/forms-samples-styling.xsl">
+ <map:parameter name="dojo-resources" value="{servlet:ajax:/resource/external/dojo}"/>
+ <map:parameter name="forms-resources" value="{servlet:forms:/resource/external/forms}"/>
+</map:transform>
+</pre><p>Of course you may have little bit different configuration. Above fragments
+are mentioned for explanatory purpose.</p><p>Links with in <tt>servlet:</tt> scheme cannot be included in HTML code sent
+to the browser thus you need to perform link rewriting step just before
+serialization. In order to do that, you will need to add
+<tt>servletLinkRewriting</tt> transformer as shown in this example:</p><pre> <map:match pattern="*-display-pipeline.jx">
+ <map:generate type="jx" src="forms/{1}_template.xml" label="content1">
+ <map:parameter name="locale" value="{flow-attribute:locale}"/>
+ </map:generate>
+ <map:transform type="browser-update"/><!-- AJAX-style form update -->
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="{flow-attribute:locale}"/>
+ </map:transform>
+ <map:call resource="simple-page2html">
+ <map:parameter name="file" value="forms/{1}_template.xml"/>
+ </map:call>
+ <map:transform src="resources/forms-samples-styling.xsl">
+ <map:parameter name="dojo-resources" value="{servlet:ajax:/resource/external/dojo}"/>
+ <map:parameter name="forms-resources" value="{servlet:forms:/resource/external/forms}"/>
+ <map:parameter name="dojo-debug" value="true"/><!-- set to true to turn on dojo debugging in the Browser -->
+ <map:parameter name="dojo-locale" value="{flow-attr:locale}"/>
+ </map:transform>
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="{flow-attribute:locale}"/>
+ </map:transform>
+
+ <map:transform type="servletLinkRewriter"/> <!-- here is the transformation step you will need to add -->
+
+ <map:select type="ajax-request">
+ <map:when test="true"><!-- sending a partial Browser Update -->
+ <map:select type="request-parameter">
+ <map:parameter name="parameter-name" value="dojo.transport"/>
+ <map:when test="iframe"><!-- sending BU via iFrameIO -->
+ <map:transform src="servlet:forms:/resource/internal/xsl/IframeTransport-bu-styling.xsl"/>
+ <map:serialize type="xhtml"/><!-- this is REALLY important -->
+ </map:when>
+ <map:otherwise><!-- sending BU via XHR -->
+ <map:serialize type="xml"/>
+ </map:otherwise>
+ </map:select>
+ </map:when>
+ <map:otherwise><!-- sending a complete page -->
+ <map:serialize type="html"/>
+ </map:otherwise>
+ </map:select>
+ </map:match>
+</pre><p>You should add that transformer to all pipelines that transform Forms code
+into HTML.</p><p>Also, this is last step of whole migration process. After performing all
+steps you need to rebuild your block and clear browser cache to get everything
+working as before refactoring and migration process.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">See also</h2><p>You may also be interested with <a href="../../../../2.2/blocks/ajax/1.0/1350_1_1.html">AJAX migration
+guide</a>.</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/1351?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/475_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/475_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/475_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/475_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,414 @@
+<!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'>
+ <a href="755_1_1.html">Form publishing</a>
+ <ul>
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="755_1_1.html">Templating</a>
+ <ul>
+
+ <li >
+ <a href="480_1_1.html">Template Generator</a>
+ </li>
+
+ <li >
+ <strong>Template transformer</strong>
+ </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">Template Transformer</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Introduction</h1><p>The Forms Template Transformer can execute the <a href="755_1_1.html">CForms
+template</a> tags.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Usage</h1><p>For how to declare this transformer and how to embed it in a pipeline, see
+the Cocoon samples (the lazy doc writer approach).</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Special features of the forms transformer</h1><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Where the forms transformer looks for the form instance object</h2><p>Each time the forms transformer encounters a ft:form-template element, it
+will try to retrieve a CForms form instance object. It looks for it in the
+following locations:</p><ol type="1">
+<li>if the ft:form-template element has a location attribute, then the value of
+that attribute will be evaluated as a JXPath expression. The result of this
+expression should be the form object.</li>
+<li>if a parameter called "attribute-name" was supplied to the forms transformer
+in the sitemap, then the forms transformer will try to find the form in the
+request attribute with that name. (request attributes are a temporary storage
+area that exists for the duration of one request and is often used to
+communicate objects between different sitemap components such as actions and
+transformers)</li>
+<li>finally, the forms transformer will look if a CForms form was supplied from
+a flowscript using the key "CocoonFormsInstance".</li>
+</ol>If the form is not found at any of these locations, an exception is thrown.
+For example, if your form object is stored in the session using the key
+"myform", then following expression in the location attribute can be used to
+retrieve it:<pre><ft:form-template location="getAttribute($session, 'myform')" ...</pre>If you'd like to retrieve the key "myform" from a parameters specified in the
+sitemap, say one called "sessionattr", then the following can be used:<pre><ft:form-template location="getAttribute($session,
+ getParameter($parameters, 'sessionattr'))" ...</pre><p>As mentioned before, ft:form-template elements cannot be nested, but you can
+have multiple ft:form-template elements on one page. Together with the location
+attribute, this can be used to handle multiple forms occuring on one template.
+</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Action attribute on ft:form-template</h2><p>The forms transformer supports the execution of JXPath expressions that occur
+in the action attribute of the ft:form-template element. This makes it possible
+to embed the continuation ID in that attribute.</p><p>For example:</p><pre><ft:form-template action="#{$cocoon/continuation/id}.continue" ...</pre><p>The following objects are available in the JXPath context via the cocoon
+object: continuation, requests, session and parameters. The context of the
+JXPath expression is the map passed on from the flowscript (if any).</p><p>Note that the JXTemplate-based form-template-tag-implementation of course
+also supports this, as this is a native feature of JXTemplate.</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/475?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/476_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/476_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/476_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/476_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,376 @@
+<!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'>
+ <a href="755_1_1.html">Form publishing</a>
+ <ul>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Templating</a>
+ </li>
+
+ <li >
+ <strong>Generator</strong>
+ </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">Forms Generator</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>The FormsGenerator is a Cocoon generator that generates an XML representation
+of a form instance object.</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/476?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/477_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/477_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/477_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/477_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,465 @@
+<!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'>
+ <strong>Widgets</strong>
+ <ul>
+
+ <li >
+ <strong>Action widget</strong>
+ </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 >
+ <a href="754_1_1.html">Form</a>
+ </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">Action widget</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>Used to trigger an action event on the server side. Usually presented as a
+button the user can press (though this is not required). When an action widget
+was activated, validation will not be performed. This is because usually it
+would be strange to have other fields validated when the user's intention wasn't
+really to submit the form. If you want validation to happen, use the
+<a href="493_1_1.html">submit widget</a>. After pressing an action button, the form
+will normally always be redisplayed, unless the event handling code explicitely
+disables this (by using the method <tt>endFormProcessing</tt> method on the
+<tt>Form</tt> object).</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre><fd:action id="..." command="..." state="...">
+ <fd:label>...</fd:label>
+ <fd:help>...</fd:help>
+ <fd:hint>...</fd:hint>
+ <fd:on-action>
+ [...]
+ </fd:on-action>
+ <fd:on-create>
+ [..]
+ </fd:on-create>
+ <fd:attributes>
+ <fd:attribute name="..." value="..."/>
+ </fd:attributes>
+</fd:action></pre><p>The <strong>command</strong> attribute specifies a name that will be part of
+the event generated by this widget. This can sometimes be useful. For example,
+on the <a href="494_1_1.html">Repeater action</a> and <a href="495_1_1.html">Row
+action</a> it indicates what to do. Previously this attribute was called
+action-command (now deprecated).</p><p>For more information on how event handlers are defined, see
+<a href="479_1_1.html">Event Handling</a>. The interface to be implemented for Java
+event listeners is <tt>org.apache.cocoon.forms.event.ActionListener</tt>. The
+WidgetEvent subclass is <tt>org.apache.cocoon.forms.event.ActionEvent</tt>.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1><p>An action widget is inserted in a template using the ft:widget tag:</p><pre><ft:widget id="..."/>
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Styling (default HTML XSL)</h1><p>By default an action widget is shown as a button.</p><p>To render the action widget as an image:</p><pre><ft:widget id="...">
+ <fi:styling type="image" src="foo.gif">
+</ft:widget>
+</pre><p>To render the action widget as a link:</p><pre><ft:widget id="...">
+ <fi:styling type="link">
+</ft:widget></pre></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/477?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/478_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/478_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/478_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/478_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,608 @@
+<!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 >
+ <strong>Sample</strong>
+ </li>
+
+ <li >
+ <a href="752_1_1.html">Improving the sample</a>
+ </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">A Simple Example</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">A simple CForms example</h1><p>In this example we will show how to create a simple registration form using
+CForms and flowscript. We will follow to following steps:</p><ol type="1">
+<li>Create a form definition file</li>
+<li>Create a template file</li>
+<li>Write a bit of flowscript</li>
+<li>Add some pipelines to the sitemap</li>
+</ol>You can try this sample out on a default Cocoon install. In the webapp
+directory (build/webapp), create a new subdirectory, for example called
+<tt>myformtest</tt>. In there, create the files as outlined in this sample.Here is a screenshot of the form we're going to create:<img alt="forms_registrationform" name="forms_registrationform" height="283" width="387" src="images/350_1_1.img"></img><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Create a form definition file</h1>Below the form definition file is displayed,
+<tt>registration_definition.xml</tt>. This lists all the widgets in the form,
+together with their configuration information.<pre><fd:form
+ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
+
+ <fd:widgets>
+ <fd:field id="name" required="true">
+ <fd:label>Name:</fd:label>
+ <fd:datatype base="string"/>
+ <fd:validation>
+ <fd:length min="2"/>
+ </fd:validation>
+ </fd:field>
+
+ <fd:field id="email" required="true">
+ <fd:label>Email address:</fd:label>
+ <fd:datatype base="string"/>
+ <fd:validation>
+ <fd:email/>
+ </fd:validation>
+ </fd:field>
+
+ <fd:field id="age">
+ <fd:label>Your age:</fd:label>
+ <fd:datatype base="long"/>
+ <fd:validation>
+ <fd:range min="0" max="150"/>
+ </fd:validation>
+ </fd:field>
+
+ <fd:field id="password" required="true">
+ <fd:label>Password:</fd:label>
+ <fd:datatype base="string"/>
+ <fd:validation>
+ <fd:length min="5" max="20"/>
+ </fd:validation>
+ </fd:field>
+
+ <fd:field id="confirmPassword" required="true">
+ <fd:label>Re-enter password:</fd:label>
+ <fd:datatype base="string"/>
+ <fd:validation>
+ <fd:assert test="password = confirmPassword">
+ <fd:failmessage>The two passwords are not equal.</fd:failmessage>
+ </fd:assert>
+ </fd:validation>
+ </fd:field>
+
+ <fd:booleanfield id="spam">
+ <fd:label>Send me spam</fd:label>
+ </fd:booleanfield>
+ </fd:widgets>
+
+</fd:form>
+</pre><p>All elements are in the Forms Definition namespace: <strong>fd</strong>.</p><p>Every definition file has a <tt><fd:form></tt> element as the root
+element.</p><p>The child widgets of the form are defined inside the
+<tt><fd:widgets></tt> element. As you can see, most of the widgets are
+field widgets. The field widget is the most important widget in CForms. It is
+very flexible because it can be associated with different datatypes and with a
+selection list. See the reference docs for more information on this and other
+widgets.</p><p>A nice feature is that the <tt>fd:label</tt> tags can contain mixed content.
+On the one hand, this can be used to provide rich formatting in the label. But
+it also enables you to put i18n-elements in there, to be interpreted by the
+I18nTransformer. This way, internationalisation is done using standard Cocoon
+techniques.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Create a template file</h1><p>Here is the template for our registration form example,
+<tt>registration_template.xml</tt>:</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">
+ <ft:widget-label id="name"/>
+ <ft:widget id="name"/>
+ <br/>
+ <ft:widget-label id="email"/>
+ <ft:widget id="email"/>
+ <br/>
+ <ft:widget-label id="age"/>
+ <ft:widget id="age"/>
+ <br/>
+ <ft:widget-label id="password"/>
+ <ft:widget id="password">
+ <fi:styling type="password"/>
+ </ft:widget>
+ <br/>
+ <ft:widget-label id="confirmPassword"/>
+ <ft:widget id="confirmPassword">
+ <fi:styling type="password"/>
+ </ft:widget>
+ <br/>
+ <ft:widget id="spam"/>
+ <ft:widget-label id="spam"/>
+ <br/>
+
+ <input type="submit"/>
+ </ft:form-template>
+ </body>
+</html></pre><p>The CForms-specific elements here are in the "Forms Template" namespace:
+<strong>ft</strong>.</p><p>First, jx:import is used to import the CForms macros which execute the
+elements in the ft namespace.</p><p>The <tt><ft:widget-label></tt> tag will cause the label of a widget to
+be inserted at the location of the tag. The <tt><ft:widget></tt> tag will
+cause the XML representation of a widget to be inserted at the location of that
+tag. The inserted XML will be in the "Forms Instance" namespace:
+<strong>fi</strong>.</p><p>The XML representation of the widget will then be translated to HTML by an
+XSLT stylesheet (forms-samples-styling.xsl in our case -- see sitemap snippets
+below). This XSLT only has to handle individual widgets, and not the page as a
+whole, and is thus not specific for one form but can be reused across forms.</p><p>For certain widgets it may be necessary to provide extra presentation hints,
+such as the width of a text box, the style of a selection list (drop down, radio
+buttons, ...) or class and style attribute values. This can be done by putting a
+fi:styling element inside the ft:widget element. This element is in the fi
+namespace because it will be copied literally. The attributes and/or content of
+the fi:styling element depend on what is supported by the particular stylesheet
+used.</p><p>As an alternative to the template approach, you could also use the
+FormsGenerator, which will generate an XML representation of the whole form, and
+style that with a custom-written XSLT. For most users we recommend the template
+approach though.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Write a bit of flowscript</h1><p>Flowscript is Cocoon's solution to handling the flow of a web interaction. It
+is based on the concept of continuations. If you don't know yet about
+continuations and flowscript, <a href="NO_LINK">learn about it here</a>.</p><p>Here's the flowscript for our example, <tt>registration.js</tt>:</p><pre>cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
+
+function registration() {
+ var form = new Form("registration_definition.xml");
+
+ form.showForm("registration-display-pipeline");
+
+ var viewData = { "username" : form.getChild("name").getValue() }
+ cocoon.sendPage("registration-success-pipeline", viewData);
+}</pre><p>The flowscript works as follows:</p><p>First we create a <tt>Form</tt> object, specifying the form definition file
+to be used. The Form object is actually a javascript wrapper around the "real"
+Java form instance object.</p><p>Then the <tt>showForm</tt> function is called on the form object. This will
+(re)display the form to the user until validation of the form succeeded. As
+parameter to the showForm function, we pass the sitemap pipeline to be used to
+display the form.</p><p>Finally we get some data from the form (the entered name), and call a sitemap
+pipeline to display this data. This pipeline is based on the JXTemplate
+generator.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Add some pipelines to the sitemap</h1><p>Here is the sitemap we need, <tt>sitemap.xmap</tt>:</p><pre><?xml version="1.0"?>
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+ <map:components>
+ <map:transformers default="xslt">
+ <map:transformer name="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer">
+ <catalogues default="forms">
+ <catalogue id="forms" name="messages"
+ location="resource://org/apache/cocoon/forms/system/i18n"/>
+ </catalogues>
+ <cache-at-startup>true</cache-at-startup>
+ </map:transformer>
+ </map:transformers>
+ </map:components>
+
+ <map:views>
+ </map:views>
+
+ <map:resources>
+ </map:resources>
+
+ <map:flow language="javascript">
+ <map:script src="registration.js"/>
+ </map:flow>
+
+ <map:pipelines>
+
+ <map:pipeline>
+ <map:match pattern="registration">
+ <map:call function="registration"/>
+ </map:match>
+
+ <map:match pattern="*.continue">
+ <map:call continuation="{1}"/>
+ </map:match>
+
+ <map:match pattern="registration-display-pipeline">
+ <map:generate type="jx" src="registration_template.xml"/>
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="en-US"/>
+ </map:transform>
+ <map:transform src="forms-samples-styling.xsl"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="registration-success-pipeline">
+ <map:generate type="jx" src="registration_success.jx"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="resources/*/**">
+ <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
+ </map:match>
+
+ </map:pipeline>
+
+ </map:pipelines>
+
+</map:sitemap>
+</pre><p>Note the following things:</p><ul>
+<li>The i18n transformer is configured so it knows about the forms messages. The
+forms catalogue does not have to be the default one, but here it is the only one
+and thus the default.</li>
+<li>In the <tt>map:flow</tt> tag our flowscript file is declared.</li>
+<li>Then we have the pipelines:</li>
+<ul>
+<li>The first two are for managing the flowscript: when someone hits the
+registration URL, we call the registration function in our flowscript</li>
+<li>When a form is submitted, it will be matched by the second matcher,
+*.continue, which will continue the execution of the flowscript.</li>
+<li>The third matcher is for displaying the form. Note the JXTemplate generator
+is used so that the form template tags get interpreted.</li>
+<li>The fourth pipeline is for showing the "success" page, again using the
+JXTemplate generator, the contents of the registration_succcess.jx file is given
+below.</li>
+<li>The last one is for making default CForms resources available, such as
+javascript libraries, CSS files and images.</li>
+</ul>
+
+</ul>As promised, here is the content of the <tt>registration_success.jx</tt>
+file:<pre><?xml version="1.0"?>
+<html>
+ <head>
+ <title>Registration successful</title>
+ </head>
+ <body>
+ Registration was successful for ${username}!
+ </body>
+</html>
+</pre>One last thing you need to do is to copy the following file, which you find
+in the Cocoon download, to your test directory:<pre>src/blocks/forms/samples/resources/forms-samples-styling.xsl</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Try it out</h1>If you have created all the files mentioned above, you can now try out this
+sample by browsing to:<pre>http://localhost:8888/myformtest/registration
+</pre>Try entering incorrect data and see what it does.<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Next steps</h1>The example we have studied here is quite simple. It might seem elaborate for
+a simple form (though notice you didn't have to write any Java for all of this,
+nor to restart Cocoon), but adding more complexity to the form is now simply a
+matter of adding more widgets, custom validation logic, event handlers, etc. To
+have a feel for the power of CForms, take a look at the examples included
+included in the Forms block.</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/478?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>