cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r580139 [13/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...
Date Thu, 27 Sep 2007 19:57:38 GMT
Added: cocoon/site/site/2.2/blocks/forms/1.0/498_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/498_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/498_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/498_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,601 @@
+<!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> &raquo; <a href="../../../../">Cocoon</a> &raquo;</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" />&nbsp;
+                 <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='menuExpand'>
+              <strong>API</strong>
+                <ul>
+                  
+    <li >
+              <strong>Java API</strong>
+        </li>
+                  
+    <li >
+              <a href="491_1_1.html">Javascript API</a>
+        </li>
+              </ul>
+        </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">Java API</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Intro</h1><p>CForms is implemented in Java so the natural way to access it is through its
+Java API. In this section we will show you how to get started. The two primary
+flow-solutions of Cocoon (Flowscript and Javaflow) each have an additional Forms
+integration part. However, here we want to show how the core Forms APIs should
+be used independent of specific flow solutions, and therefore we will use the
+very basic &quot;Apples&quot; flow.</p><div class="note"><div><strong>Note: </strong>The Apples flow solution (contained in the &quot;apples&quot; block) is
+not officially supported by the Cocoon community. We use it here only for
+demonstrative purposes to illustrate the use of the Forms API.</div></div><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Apples flow</h1><p>If you are familiar with Apples, you can skip this section. What follows is a
+super-super short summary of how Apples works.</p><p>An Apple flow-controller is a Java class implementing the following
+interface:</p><pre>package org.apache.cocoon.components.flow.apples;
+
+public interface AppleController {
+    void process(AppleRequest req, AppleResponse res) throws Exception;
+}</pre><p>In the sitemap, a flow-interaction is started using map:call with the
+function attribute:</p><pre>&lt;map:call function=&quot;<em xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">some.fully.qualified.Classname</em>&quot;/&gt;</pre><p>This will create an instance of the specified class (which should implement
+the AppleController interface), associate that class with a continuation ID, and
+call the <tt>process</tt> method of the Apple (we refer to a specific Apples
+controller object simply as &quot;Apple&quot;). The Apple can then do whathever it wants
+to do, but before returning the process method should have called either the
+<tt>sendPage</tt> or <tt>redirectTo</tt> method on the supplied
+<tt>appleResponse</tt> object.</p><p>In contrast with the continuations-based flow solutions, calling
+sendPage or redirectTo does not stop the execution of the current method, it
+only configures what pipeline to call or where to redirect to in the
+AppleResponse object. It is only after the process method has returned that this
+information will be used by the Apples flow implementation.</p><p>To continue interacting with the same Apple instance, use map:call with the
+contination attribute:</p><pre>&lt;map:call continuation=&quot;<em xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">some-continuation-id</em>&quot;/&gt;</pre><p>This will look up the previously created Apple and call again its process
+method.</p><p>This is basically it. An Apple can maintain state in its instance variables.
+You can think of an Apple object as a session specific for a certain
+interaction. It encapsulates both the state of the interaction and its
+corresponding flow logic in one object.</p><p>In contrast with the continuation-based flow solutions, the execution of an
+Apple always starts at the top of the process method. To find out what you need
+to do, you can simply use request information (the requested path, request
+parameters and the request method).</p><p>To make this overview complete, if you don't need a stateful interaction you
+can let your Apple implement the interface <tt>StatelessAppleController</tt>. In
+that case, no continuation ID will be associated with the Apple and it will be
+discarded directly after use.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Avalon</h1><p>An Apples controller can implement the Avalon Framework interfaces to get
+access to its context. If you are familiar with Avalon, you can skip this
+section.</p><p>Cocoon internally manages components using the contracts defined by Avalon
+Framework. Avalon Framework defines a few interfaces that components can
+implement to let the container communicate with the component. An Apples
+controller is treated as such a component, thus an Apple can implement Avalon
+Framework interfaces.</p><p>For working with forms, we will need to be able to access the FormManager
+(and possibly the BindingManager). To get access to other components, Avalon
+defines the ServiceManager interface, which provides the following method:</p><pre>public void service(ServiceManager serviceManager);
+</pre><p>So if your component (an Apple in this case) implements the ServiceManager,
+this service method will be called during the setup of the component, and via
+the supplied ServiceManager object you can get access to other components
+running inside Cocoon. We will see below how we use this to get access to the
+FormManager.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Setting up a working environment</h1><p>To have a comfortable work/build environment, we suggest to use the
+<a href="http://wiki.apache.org/cocoon/YourCocoonBasedProjectAnt16">Ant script
+found on the wiki</a>.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">A basic Forms usage</h1><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Creating a form instance</h2><p>Creating a form instance based on a form definition is done using the
+FormManager. Since the few lines to do this are needed each time we would like
+to create a form instance, we define a helper class to do this. While at it, it
+includes also a method to create a binding object using the BindingManager.</p><pre>package my;
+
+import org.apache.cocoon.forms.formmodel.Form;
+import org.apache.cocoon.forms.FormManager;
+import org.apache.cocoon.forms.binding.Binding;
+import org.apache.cocoon.forms.binding.BindingManager;
+import org.apache.avalon.framework.service.ServiceManager;
+
+public class FormHelper {
+    public static Form createForm(ServiceManager serviceManager,
+                                  String formDefinitionFileName) throws Exception {
+        FormManager formManager = null;
+        try {
+            formManager = (FormManager)serviceManager.lookup(FormManager.ROLE);
+            return formManager.createForm(formDefinitionFileName);
+        } finally {
+            if (formManager != null)
+                serviceManager.release(formManager);
+        }
+    }
+
+    public static Binding createBinding(ServiceManager serviceManager,
+                              String bindingDefinitionFileName) throws Exception {
+        BindingManager bindingManager = null;
+        try {
+            bindingManager = (BindingManager)serviceManager.lookup(BindingManager.ROLE);
+            return bindingManager.createBinding(bindingDefinitionFileName);
+        } finally {
+            if (bindingManager != null)
+                serviceManager.release(bindingManager);
+        }
+    }
+}
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">The Apple controller</h2><p>Below is an Apple controller which is used to display a simple form
+containing just one field, &quot;name&quot;. Once the name is entered correctly, it will
+redirect to google to perform a search on that name.</p><pre>package my;
+
+import org.apache.cocoon.components.flow.apples.AppleController;
+import org.apache.cocoon.components.flow.apples.AppleRequest;
+import org.apache.cocoon.components.flow.apples.AppleResponse;
+import org.apache.cocoon.forms.formmodel.Form;
+import org.apache.cocoon.forms.FormContext;
+import org.apache.cocoon.environment.Request;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.service.ServiceException;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Locale;
+import java.net.URLEncoder;
+
+public class FirstFormsApple implements AppleController, Serviceable {
+    private ServiceManager serviceManager;
+    private boolean init = false;
+    private Form form;
+    private Locale locale = Locale.US;
+
+    public void service(ServiceManager serviceManager) throws ServiceException {
+        this.serviceManager = serviceManager;
+    }
+
+    public void process(AppleRequest appleRequest, AppleResponse appleResponse)
+            throws Exception {
+        if (!init) {
+            form = FormHelper.createForm(serviceManager,
+                           &quot;resources/form/firstform_definition.xml&quot;);
+            init = true;
+        }
+
+        Request request = appleRequest.getCocoonRequest();
+        if (request.getMethod().equals(&quot;GET&quot;)) {
+            showForm(appleResponse);
+        } else if (request.getMethod().equals(&quot;POST&quot;)) {
+            boolean finished = form.process(new FormContext(request, locale));
+            if (!finished) {
+                showForm(appleResponse);
+            } else {
+                String name = (String)form.getChild(&quot;name&quot;).getValue();
+                appleResponse.redirectTo(&quot;http://google.com/search?q=&quot;
+                                         + URLEncoder.encode(name, &quot;UTF-8&quot;));
+            }
+        } else {
+            throw new Exception(&quot;Unexpected HTTP method: &quot; + request.getMethod());
+        }
+    }
+
+    private void showForm(AppleResponse appleResponse) {
+        Map viewData = new HashMap();
+        viewData.put(&quot;CocoonFormsInstance&quot;, form);
+        viewData.put(&quot;locale&quot;, locale);
+        appleResponse.sendPage(&quot;FirstFormPipe&quot;, viewData);
+    }
+}
+</pre><p>Some notes:</p><ul>
+<li>if this is the first time the Apple is called, the form instance is created
+using the <tt>FormHelper</tt> utility class defined earlier</li>
+<li>if the request method is GET, we simply show the form</li>
+<li>if the request method is POST, the user has submitted the form so we let the
+form object process the request. This returns a boolean to indicate whether the
+form processing finished (finished means: all widgets validated successfully,
+and the reason for the form submit was not to execute some action or event
+handler). If not finished, we redisplay the form, otherwise, we do whatever it
+is we want to do with the collected form data. To keep this sample simple, we
+redirect to google.</li>
+</ul>It is important to notice that you can make the form definition and template
+much more complex (containing many &amp; advanced widgets, with validation
+logic, event handlers, etc.), while the Apple can stay as simple as this.<h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Supporting files</h2>For reference, we list the form definition, form template and sitemap used
+for this example.<h3 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">form definition</h3><pre>&lt;fd:form xmlns:fd=&quot;http://apache.org/cocoon/forms/1.0#definition&quot;&gt;
+  &lt;fd:widgets&gt;
+    &lt;fd:field id=&quot;name&quot; required=&quot;true&quot;&gt;
+      &lt;fd:label&gt;Name&lt;/fd:label&gt;
+      &lt;fd:datatype base=&quot;string&quot;/&gt;
+    &lt;/fd:field&gt;
+  &lt;/fd:widgets&gt;
+&lt;/fd:form&gt;
+</pre><h3 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">form template</h3><pre>&lt;html xmlns:ft=&quot;http://apache.org/cocoon/forms/1.0#template&quot;
+  xmlns:fi=&quot;http://apache.org/cocoon/forms/1.0#instance&quot;
+  xmlns:jx=&quot;http://apache.org/cocoon/templates/jx/1.0&quot;&gt;
+
+  &lt;jx:import uri=&quot;resource://org/apache/cocoon/forms/generation/jx-macros.xml&quot;/&gt;
+
+  &lt;head&gt;
+    &lt;title&gt;First form!&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;ft:form-template action=&quot;#{$continuation/id}.continue&quot; method=&quot;POST&quot;&gt;
+      &lt;ft:widget-label id=&quot;name&quot;/&gt;
+      &lt;ft:widget id=&quot;name&quot;/&gt;
+      &lt;br/&gt;
+      &lt;input type=&quot;submit&quot;/&gt;
+    &lt;/ft:form-template&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</pre><h3 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">sitemap</h3><pre>&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;map:sitemap xmlns:map=&quot;http://apache.org/cocoon/sitemap/1.0&quot;&gt;
+
+  &lt;map:components&gt;
+    &lt;map:transformers default=&quot;xslt&quot;&gt;
+      &lt;map:transformer name=&quot;i18n&quot;
+        src=&quot;org.apache.cocoon.transformation.I18nTransformer&quot;&gt;
+        &lt;catalogues default=&quot;forms&quot;&gt;
+          &lt;catalogue id=&quot;forms&quot; name=&quot;messages&quot;
+            location=&quot;resource://org/apache/cocoon/forms/system/i18n&quot;/&gt;
+        &lt;/catalogues&gt;
+        &lt;cache-at-startup&gt;true&lt;/cache-at-startup&gt;
+      &lt;/map:transformer&gt;
+    &lt;/map:transformers&gt;
+  &lt;/map:components&gt;
+
+  &lt;map:views&gt;
+  &lt;/map:views&gt;
+
+  &lt;map:resources&gt;
+  &lt;/map:resources&gt;
+
+  &lt;map:flow language=&quot;apples&quot;/&gt;
+
+  &lt;map:pipelines&gt;
+
+    &lt;map:pipeline internal=&quot;true&quot;&gt;
+      &lt;map:match pattern=&quot;FirstFormPipe&quot;&gt;
+        &lt;map:generate type=&quot;jx&quot; src=&quot;resources/form/firstform_template.xml&quot;/&gt;
+        &lt;map:transform type=&quot;i18n&quot;&gt;
+          &lt;map:parameter name=&quot;locale&quot; value=&quot;flow-attr:locale&quot;/&gt;
+        &lt;/map:transform&gt;
+        &lt;map:transform src=&quot;resources/xsl/forms-samples-styling.xsl&quot;/&gt;
+        &lt;map:serialize/&gt;
+      &lt;/map:match&gt;
+    &lt;/map:pipeline&gt;
+
+    &lt;map:pipeline&gt;
+      &lt;map:match pattern=&quot;firstform&quot;&gt;
+        &lt;map:call function=&quot;my.FirstFormsApple&quot;/&gt;
+      &lt;/map:match&gt;
+
+      &lt;map:match pattern=&quot;*.continue&quot;&gt;
+        &lt;map:call continuation=&quot;{1}&quot;/&gt;
+      &lt;/map:match&gt;
+
+      &lt;map:match pattern=&quot;resources/*/**&quot;&gt;
+        &lt;map:read src=&quot;resource://org/apache/cocoon/{1}/resources/{2}&quot;/&gt;
+      &lt;/map:match&gt;
+    &lt;/map:pipeline&gt;
+
+  &lt;/map:pipelines&gt;
+
+&lt;/map:sitemap&gt;
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Next</h1>[TODO]<p>See also the javadoc of the forms package for more information on the API.
+</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/498?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>&#169;  
+          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/685_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/685_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/685_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/685_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,461 @@
+<!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> &raquo; <a href="../../../../">Cocoon</a> &raquo;</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" />&nbsp;
+                 <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='menuExpand'>
+              <strong>Form libraries</strong>
+                <ul>
+                  
+    <li >
+              <strong>Form libraries</strong>
+        </li>
+              </ul>
+        </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 Libraries</h1><p>With this feature, it is now possible to define libraries of form definitions
+and bindings. Specific support for templates was intentionally left out because
+of the frequently changing and unstructured nature of it. Other tools, such as
+the JX Template Generator's import feature or a combination of the Include
+Transformer and XSLT will do a better job dealing with any template formatting
+needs.</p><p>One important feature of the library subsystem is inheritance. Form widgets
+and bindings can inherit their contents and parameters from others. All such
+parent bindings/widgets will be referenced by IDs like so:</p><pre>&lt;fd:field id=&quot;myFieldID&quot; extends=&quot;myOtherFieldID&quot;/&gt;
+</pre><p>The attribute &quot;extends&quot; specifies the widget or binding to inherit from. The
+following is a simple example which shows how this works conceptually:</p><pre>&lt;fd:field id=&quot;parentField&quot;&gt;
+  &lt;fd:label&gt;Parent Field&lt;/fd:label&gt;
+  &lt;fd:datatype base=&quot;string&quot;/&gt;
+&lt;/fd:field&gt;
+
+&lt;fd:field id=&quot;childField&quot; extends=&quot;parentField&quot;&gt;
+  &lt;fd:selection-list&gt;
+    &lt;fd:item value=&quot;1&quot;/&gt;
+    &lt;fd:item value=&quot;2&quot;&gt;
+      &lt;fd:label&gt;two&lt;/fd:label&gt;
+    &lt;/fd:item&gt;
+    &lt;fd:item value=&quot;3&quot;/&gt;
+  &lt;/fd:selection-list&gt;
+&lt;/fd:field&gt;
+</pre><p>The above snippet will result in the following situation:</p><pre>&lt;fd:field id=&quot;parentField&quot;&gt;
+  &lt;fd:label&gt;Parent Field&lt;/fd:label&gt;
+  &lt;fd:datatype base=&quot;string&quot;/&gt;
+&lt;/fd:field&gt;
+
+&lt;fd:field id=&quot;childField&quot;&gt;
+  &lt;fd:label&gt;Parent Field&lt;/fd:label&gt;
+  &lt;fd:datatype base=&quot;string&quot;/&gt;
+  &lt;fd:selection-list&gt;
+    &lt;fd:item value=&quot;1&quot;/&gt;
+    &lt;fd:item value=&quot;2&quot;&gt;
+      &lt;fd:label&gt;two&lt;/fd:label&gt;
+    &lt;/fd:item&gt;
+    &lt;fd:item value=&quot;3&quot;/&gt;
+  &lt;/fd:selection-list&gt;
+&lt;/fd:field&gt;</pre><div class="note"><div><strong>Note: </strong>Note that &quot;extends&quot; does not have to reference widgets in a
+library, widgets in the same context are also usable (e.g. widgets in the same
+group or two top-level widgets can inherit from another).</div></div><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Form Library Inclusion</h2><p>A sample library <tt>sample.xml</tt> might look like this:</p><pre>&lt;fd:library&gt;
+  &lt;fd:widgets&gt;
+
+    &lt;fd:group id=&quot;account&quot;&gt;
+      &lt;fd:widgets&gt;
+        &lt;fd:field id=&quot;owner&quot;&gt;
+          &lt;fd:label&gt;Account Holder&lt;/fd:label&gt;
+          &lt;fd:datatype base=&quot;string&quot;/&gt;
+        &lt;/fd:field&gt;
+        &lt;fd:field id=&quot;balance&quot;&gt;
+          &lt;fd:label&gt;Current Balance&lt;/fd:label&gt;
+          &lt;fd:datatype base=&quot;float&quot;/&gt;
+        &lt;/fd:field&gt;
+      &lt;/fd:widgets&gt;
+    &lt;/fd:group&gt;
+
+  &lt;/fd:widgets&gt;
+&lt;/fd:library&gt;
+</pre><p>This library can be easily be imported into another library or form model by
+using the <tt>&lt;fd:import/&gt;</tt> statement.</p><pre>&lt;fd:form&gt;
+  &lt;fd:widgets&gt;
+
+    &lt;fd:import prefix=&quot;lib&quot; uri=&quot;sample.xml&quot;/&gt;    
+
+    &lt;fd:group id=&quot;accountWithNumber&quot; extends=&quot;lib:account&quot;&gt;
+      &lt;fd:widgets&gt;
+        &lt;fd:field id=&quot;accountNo&quot;&gt;
+          &lt;fd:label&gt;Account Number&lt;/fd:label&gt;
+          &lt;fd:datatype base=&quot;integer&quot;/&gt;
+        &lt;/fd:field&gt;
+      &lt;/fd:widgets&gt;
+    &lt;/fd:group&gt;
+
+    &lt;fd:group id=&quot;accountWithDifferentId&quot; extends=&quot;lib:account&quot;/&gt;
+
+    &lt;fd:expand id=&quot;lib:account&quot;/&gt;
+
+  &lt;/fd:widgets&gt;
+&lt;/fd:form&gt;
+</pre><p>You can see how the value of &quot;extends&quot; now has a prefix which identifies the
+library to use while resolving the name. The seperator is &quot;:&quot; and such prefixes
+can also be deep, meaning reference a path in the inclusion tree if many
+libraries also import other libraries. In a situation where library &quot;common&quot; is
+imported by libary &quot;lib&quot;, then widgets in the &quot;common&quot; library are also
+accessible with the prefix &quot;lib:common:&quot; from a form importing only &quot;lib&quot;.</p><p>The above example shows the four usecases implemented in the current library
+system:</p><ol type="1">
+<li>Library import: Imports a specific library into the scope of a form or
+another library under a certain key.</li>
+<li>Full widget inheritance with overriding and extending information (in the
+example, the &quot;id&quot; is overridden and a selection-list is added).</li>
+<li>The simple case of inheritance where only the &quot;id&quot; should change, say
+because of name clashes. While usually, the &quot;fd:widgets&quot; element is required in
+a &quot;fd:group&quot;, it is not if you inherit the widgets from an already existing
+group, so changing the &quot;id&quot; is really simple.</li>
+<li>Simply using a widget defined in a library in the current library or form.
+This is achieved by the use of &quot;fd:expand&quot;. Any occurance of &quot;fd:expand&quot; will be
+replaced by the referenced widget.</li>
+</ol><div class="note"><div><strong>Note: </strong>The described statements &quot;fd:import&quot; and &quot;fd:expand&quot; are also
+available for bindings with exactly the same syntax and semantics, only within
+the binding namespace: &quot;fb:import&quot; and &quot;fb:expand&quot;.</div></div>Be advised that <strong>some restrictions to inheritance
+remain</strong>: Currently, it is not possible to inherit selection-lists,
+meaning that they can be copied to the inheriting widget, but adding/replacing
+items inside the lists is not possible. Similarly, single validators can not be
+replaced or changed, only new validators can be added.<br></br>
+Also note that the <strong>Tree widget does not support inheritance</strong> up
+to now. It is only possible to define it in a library and use &quot;fd:expand&quot; to
+re-use the preconfigured Tree widget.</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/685?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>&#169;  
+          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/733_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/733_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/733_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/733_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,388 @@
+<!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> &raquo; <a href="../../../../">Cocoon</a> &raquo;</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" />&nbsp;
+                 <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 >
+              <a href="753_1_1.html">Selection lists</a>
+        </li>
+                  
+    <li >
+              <strong>Widget States</strong>
+        </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">Widget States</h1><p>A widget has a certain state:</p><ul>
+<li><strong>Active</strong> state. This is the default state, where widgets read
+their values from the request and display them.</li>
+<li><strong>Disabled</strong> state, value is displayed but user input is
+ignored. The widget should be rendered in a manner that indicates that this
+widget could be active, but is currently not.</li>
+<li><strong>Output</strong> state, value is displayed but user input is ignored.
+The widget should be rendered as plain text, giving no indication that it could
+be input.</li>
+<li><strong>Invisible</strong> state. Values are not displayed and user input is
+ignored.</li>
+</ul>In the form definition, you can assign the state using an attribute called
+<tt>state</tt> with as value <tt>active</tt>, <tt>disabled</tt>, <tt>output</tt>
+or <tt>invisible</tt>. The state of a widget can of course also be modified at
+runtime (thus on the widget instance), by using the method <tt>setState</tt> on
+the widget.The list of states above is ordered from the most featured (&quot;active&quot;) to the
+most constrained (&quot;invisible&quot;). A widgets' actual state is the strictest between
+the widgets' own state and its parent state.</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/733?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>&#169;  
+          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/738_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/738_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/738_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/738_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,451 @@
+<!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> &raquo; <a href="../../../../">Cocoon</a> &raquo;</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" />&nbsp;
+                 <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 >
+              <a href="754_1_1.html">Form</a>
+        </li>
+                  
+    <li >
+              <a href="740_1_1.html">Group/Struct widget</a>
+        </li>
+                  
+    <li >
+              <strong>ImageMap widget</strong>
+        </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">ImageMap widget</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>It is used to display a server-side image map and it triggers an ImageMap
+event on the server side when clicked.<br></br>
+It behaves much as an Action widget, but you can bind the source URI of the
+image using the binding framework &quot;<tt>fb:value</tt>&quot; element, set the image at
+runtime using the <tt>setImageURI()</tt> method, and retrieve the mouse
+coordinates with <tt>getX(</tt>) and <tt>getY()</tt> methods.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre>&lt;fd:imagemap id=&quot;map&quot;&gt;
+    &lt;fd:imageuri&gt;test.gif&lt;/fd:imageuri&gt;
+    &lt;fd:hint&gt;Click on this map to zoom-in&lt;/fd:hint&gt;
+    &lt;fd:on-action&gt;
+        &lt;javascript&gt;onClickMap(event);&lt;/javascript&gt;
+    &lt;/fd:on-action&gt;
+&lt;/fd:imagemap&gt;</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Binding</h1><pre>&lt;fb:value id=&quot;map&quot; path=&quot;@src&quot;/&gt;</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1><pre>&lt;ft:widget id=&quot;map&quot;&gt;
+	&lt;fi:styling xmlns:fi=&quot;<a href="http://apache.org/cocoon/forms/1.0#instance">http://apache.org/cocoon/forms/1.0#instance</a>&quot;
+		border=&quot;2&quot;/&gt;
+&lt;/ft:widget&gt;</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Flow</h1><p>This is another way to set the image URI:</p><pre>frm.getWidget().lookupWidget(&quot;map&quot;).setImageURI(&quot;test2.gif&quot;);</pre><p>This is the handler of the imagemap event:</p><pre>function onClickMap (event) {
+	var x= event.getX();
+	var y= event.getY();
+
+	cocoon.log.debug(&quot;imageMap: x:&quot; + x + &quot; y:&quot; + y);
+}
+</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/738?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>&#169;  
+          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/739_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/739_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/739_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/739_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,543 @@
+<!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> &raquo; <a href="../../../../">Cocoon</a> &raquo;</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" />&nbsp;
+                 <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 >
+              <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 >
+              <strong>Tree widget</strong>
+        </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">Tree widget</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>The tree widget is for displaying trees of &quot;things&quot;. The tree widget supports
+expanding and collapsing of nodes, single or multiple selections, and a flexible
+TreeModel interface to provide its data.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre>&lt;fd:tree id=&quot;...&quot; state=&quot;...&quot; root-visible=&quot;true&quot; selection=&quot;multiple|single&quot;&gt;
+  &lt;fd:tree-model type=&quot;...&quot;/&gt;
+  &lt;fd:on-selection-changed&gt;
+   ...
+  &lt;/fd:on-selection-changed&gt;
+  &lt;fd:on-create&gt;
+    ...
+  &lt;/fd:on-create&gt;
+  &lt;fd:validation&gt;
+    ...
+  &lt;/fd:validation&gt;
+  &lt;fd:attributes&gt;
+    ...
+  &lt;/fd:attributes&gt;
+&lt;/fd:tree&gt;
+</pre><p>All elements and attributes, except for id, are optional.</p><p>See the <a href="481_1_1.html">field widget</a> for information on common
+attributes and elements.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">The tree model</h1><p>See the interface
+<a href="http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/tree/TreeModel.html">TreeModel</a>.
+Essentially, can be a tree of any sort of objects (there is no interface for the
+nodes in the tree). Each parent node should be able to identify its children
+uniquely by means of a key (some string).</p><p>CForms ships with two implementations of TreeModel: one generic
+implementation (DefaultTreeModel), and one for browsing over Cocoon/Avalon
+sources (= filesystem-like structures).</p><p>You can set the form model in the form definition, or set it at runtime using
+the setModel method on the tree widget.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Source tree model</h2><p>Syntax:</p><pre>&lt;fd:tree-model type=&quot;source&quot; src=&quot;...&quot;&gt;
+  &lt;fd:fileset&gt;
+    &lt;fd:include pattern=&quot;...&quot;/&gt;
+    &lt;fd:exclude pattern=&quot;...&quot;/&gt;
+  &lt;/fd:fileset&gt;
+  &lt;fd:dirset&gt;
+    &lt;fd:include pattern=&quot;...&quot;/&gt;
+    &lt;fd:exclude pattern=&quot;...&quot;/&gt;
+  &lt;/fd:dirset&gt;
+&lt;/fd:tree-model&gt;
+</pre><p>The <tt>src</tt> attribute defines the root of the content to be browsed. For
+example, to browse the content of the webapp directory, specify
+<tt>src=&quot;context://&quot;</tt>. Of course, you can also use &quot;file://&quot; or other
+traversable sources [todo: link to some page with info about sources].</p><p>The <tt>fd:fileset</tt> and <tt>fd:dirset</tt> elements are optional. The
+fileset patterns are used to filter files based on their name, and the dirset
+patterns are used to filter directories based on their names.</p><p>There can be multiple (or none at all) <tt>fd:include</tt> and
+<tt>fd:exclude</tt> elements inside <tt>fd:fileset</tt> or <tt>fd:dirset</tt>.
+The include patterns will be evaluated first, the exclude patterns next, so the
+exclude patterns have higher precendence.</p><p>The patterns are wildcard patterns. They are the same as for the wildcard
+matcher in the sitemap, thus simply use a * as wildcard (the ** syntax makes no
+sense here, as the pattern is evaluated on individual names, not on full paths).
+</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Custom models</h2><p>Syntax:</p><pre>&lt;fd:tree-model type=&quot;java&quot; class=&quot;...&quot;/&gt;
+</pre><p>whereby the class attribute specifies a class implementing
+<a href="http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/tree/TreeModel.html">TreeModel</a>.
+The class can implement Avalon interfaces to get the Logger, ServiceManager and
+Context.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Programmatically assigning a model</h2><p>Here's an example of how to build a tree model programatically using the
+provided DefaultTreeModel in flowscript:</p><pre>importClass(Packages.org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel);
+
+[...]
+
+var node1 = new DefaultTreeModel.DefaultTreeNode(&quot;node 1&quot;)
+var node2 = new DefaultTreeModel.DefaultTreeNode(&quot;node 2&quot;)
+var root = new DefaultTreeModel.DefaultTreeNode(&quot;root&quot;)
+root.add(&quot;node1&quot;, node1);
+node1.add(&quot;node2&quot;, node2);
+var treeModel = new DefaultTreeModel(root);
+
+var treeWidget = form.getChild(&quot;mytree&quot;);
+treeWidget.setModel(treeModel);
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1><p>For the display of a tree widget, three special template elements are
+available:</p><ul>
+<li><tt>ft:tree</tt>: global element to insert a tree widget in the template.
+This also inserts two hidden fields, &quot;:path&quot; and &quot;:action&quot; to communicate a node
+action to the server, see below.</li>
+<li><tt>ft:tree-nodes</tt>: the template to be executed for each tree node.</li>
+<li><tt>ft:tree-children</tt>: used inside ft:tree-nodes to recursively apply
+the ft:tree-nodes template to the child nodes.</li>
+</ul>A very rough example is:<pre>&lt;ft:tree id=&quot;mytree&quot;&gt;
+  &lt;div&gt;
+    &lt;ft:tree-nodes&gt;
+      &lt;div&gt;
+        ${treeNode.node.data}
+      &lt;/div&gt;
+      &lt;ft:tree-children/&gt;
+    &lt;/ft:tree-nodes&gt;
+  &lt;/div&gt;
+&lt;/ft:tree&gt;
+</pre>This example just shows the typical structural rendering, but doesn't contain
+any styling and javascript actions to trigger expansion and collapsion of nodes.
+Inside ft:tree you have access to two variables:<ul>
+<li><tt>treeWidget</tt>, just a synonym for the normal &quot;widget&quot; variable that is
+available in the template of each widget.</li>
+<li><tt>treeNode</tt>, provides access to the current tree node being rendered.
+More specifically it is a
+<a href="http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/tree/TreeWalker.html">TreeWalker</a>
+instance. Its <tt>node</tt> property gives access to the actual tree node.</li>
+</ul><div class="note"><div><strong>Note: </strong>The <tt xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">${treeNode.node.data}</tt> expression in the template
+example above is specific to the form model you are using, since the node can be
+any object. The data property exists in the DefaultTreeModel nodes, however in
+the source tree model the nodes are Source objects, so you would use name
+instead of data.</div></div><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Tree node actions</h1>An action can be executed on a certain node in the tree. The available
+actions are:<ul>
+<li>expand</li>
+<li>collapse</li>
+<li>toggle-collapse</li>
+<li>select</li>
+<li>unselect</li>
+<li>toggle-select</li>
+</ul>To execute an action, set the hidden field named tree-widget-full-name +
+&quot;:action&quot; to one of the actions listed above. The node on which the action is
+applied is specified in the hidden field named tree-widget-full-name + &quot;:path&quot;.
+The node is specified as a slash-separated path of node keys. In the template
+you can access this easily with <tt>treeNode.path</tt>.<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">A more functional template</h1>For a complete example of a tree template, see e.g. the
+file_explorer_template.xml file in the CForms samples. From there, you can
+&quot;steal&quot; the styling and the javascript to perform tree node actions.<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">API notes</h1>See the
+<a href="http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/tree/Tree.html">API
+docs of the tree widgets</a> for more information on how to access e.g. the
+selected nodes.</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/739?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>&#169;  
+          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>



Mime
View raw message