cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r170828 - in /cocoon/blocks/core/forms/trunk/samples: forms/form1_template_action.xml forms/form1_template_action_jx-macro.xml sitemap.xmap welcome.xml
Date Wed, 18 May 2005 21:01:29 GMT
Author: reinhard
Date: Wed May 18 14:01:28 2005
New Revision: 170828

URL: http://svn.apache.org/viewcvs?rev=170828&view=rev
Log:
add lean samples to gather profiling information

Added:
    cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action_jx-macro.xml
Modified:
    cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action.xml
    cocoon/blocks/core/forms/trunk/samples/sitemap.xmap
    cocoon/blocks/core/forms/trunk/samples/welcome.xml

Modified: cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action.xml?rev=170828&r1=170827&r2=170828&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action.xml Wed May 18 14:01:28
2005
@@ -16,7 +16,10 @@
 -->
 <!-- The only difference between this file and the form1_template_flow.xml
      is the value of the action attribute on the ft:form-template element -->
-<page xmlns:ft="http://apache.org/cocoon/forms/1.0#template" xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
+<page 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">
+      
   <title>Sample form</title>
   <content>
     <ft:form-template action="form1" method="POST">

Added: cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action_jx-macro.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action_jx-macro.xml?rev=170828&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action_jx-macro.xml (added)
+++ cocoon/blocks/core/forms/trunk/samples/forms/form1_template_action_jx-macro.xml Wed May
18 14:01:28 2005
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed 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.
+-->
+<!-- The only difference between this file and the form1_template_flow.xml
+     is the value of the action attribute on the ft:form-template element -->
+<page 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">
+  
+  <!-- Import the macros that define CForms template elements -->
+  <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+  	
+  <title>Sample form</title>
+  <content>
+    <ft:form-template action="form1" method="POST">
+      <div style="width: 90%; margin: 10px 50px 50px 50px;">
+
+        <!-- group with tabs. Each of the children of <items> will constitute a
tab -->
+        <fi:group>
+          <fi:styling type="tabs"/>
+          <fi:label>Choose a panel: </fi:label>
+          <fi:state>
+            <ft:widget id="tab-state"/>
+          </fi:state>
+
+          <fi:items>
+            <!-- group with automatic two-column layout -->
+            <fi:group>
+              <fi:label>String fields</fi:label>
+              <fi:styling layout="columns"/>
+              <fi:items>
+                <ft:widget id="email"/>
+                <ft:widget id="fourchars">
+                  <!-- particular styling for the enumeration -->
+                  <fi:styling list-type="listbox" listbox-size="4"/>
+                </ft:widget>
+              </fi:items>
+            </fi:group>
+
+            <fi:group>
+              <fi:label>Number fields</fi:label>
+              <fi:styling layout="columns"/>
+              <fi:items>
+                <ft:widget id="number1">
+                  <fi:styling submit-on-change="true"/>
+                </ft:widget>
+                <ft:widget id="number2"/>
+                <ft:widget id="account"/>
+                <ft:widget id="cowheight">
+                  <fi:styling list-type="radio"/>
+                </ft:widget>
+              </fi:items>
+            </fi:group>
+
+            <fi:group>
+              <fi:styling layout="columns"/>
+              <fi:label>Boolean fields</fi:label>
+              <fi:items>
+                <ft:widget id="somebool"/>
+                <ft:widget id="drinks">
+                  <fi:styling list-type="double-listbox">
+                    <fi:available-label>Available drinks</fi:available-label>
+                    <fi:selected-label>Your selection</fi:selected-label>
+                  </fi:styling>
+                </ft:widget>
+              </fi:items>
+            </fi:group>
+          </fi:items>
+        </fi:group>
+
+        <p>Checkout the <a href="form1.flow">form1 flow page</a> for another
way of formatting panels</p>
+
+        <!-- Group of type 'fieldset' will have a surrounding frame -->
+        <fi:group>
+          <fi:styling type="fieldset" layout="columns"/>
+          <fi:label>Misc controls</fi:label>
+          <fi:items>
+            <ft:widget id="visa"/>
+            <ft:widget id="ipaddress"/>
+            <ft:widget id="altbirthdate"/>
+            <ft:widget id="altbirthdate2"/>
+            <ft:widget id="birthdate"/>
+            <ft:widget id="dieselprice"/>
+          </fi:items>
+        </fi:group>
+
+        <!-- manual layout of fields, without use of a fi:group -->
+        <ft:widget-label id="contacts"/><br/>
+        <ft:repeater-size id="contacts"/>
+        <table border="1">
+          <tr>
+            <th><ft:repeater-widget-label id="contacts" widget-id="firstname"/></th>
+            <th><ft:repeater-widget-label id="contacts" widget-id="lastname"/></th>
+            <th><ft:repeater-widget-label id="contacts" widget-id="phone"/></th>
+            <th><ft:repeater-widget-label id="contacts" widget-id="email"/></th>
+            <th><ft:repeater-widget-label id="contacts" widget-id="birthdate"/></th>
+            <th><ft:repeater-widget-label id="contacts" widget-id="select"/></th>
+          </tr>
+          <!-- The contents of the repeater-widget element is a template that will
+               be applied to each row in the repeater. -->
+          <ft:repeater-widget id="contacts">
+            <tr>
+              <td><ft:widget id="firstname"/></td>
+              <td><ft:widget id="lastname"/></td>
+              <td><ft:widget id="phone"/></td>
+              <td><ft:widget id="email"/></td>
+              <td>
+                <ft:widget id="birthdate"/>
+              </td>
+              <td><ft:widget id="select"/></td>
+            </tr>
+          </ft:repeater-widget>
+          <tr>
+            <td colspan="4" align="right">
+              <ft:widget id="addcontact"/>
+              <ft:widget id="removecontacts"/>
+            </td>
+          </tr>
+        </table>
+        <input type="submit"/>
+      </div>
+    </ft:form-template>
+  </content>
+</page>
+

Modified: cocoon/blocks/core/forms/trunk/samples/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/sitemap.xmap?rev=170828&r1=170827&r2=170828&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/sitemap.xmap (original)
+++ cocoon/blocks/core/forms/trunk/samples/sitemap.xmap Wed May 18 14:01:28 2005
@@ -128,20 +128,23 @@
        </map:select>
 
        <!-- pipeline to show the form -->
-       <map:generate src="forms/form1_template_action.xml"/>
+       <map:generate src="forms/form1_template_action.xml">
+	     <map:parameter name="attribute-name" value="form1"/>       	
+       </map:generate>
+
        <map:transform type="forms" label="content1">
          <map:parameter name="attribute-name" value="form1"/>
        </map:transform>
+       
        <map:transform type="i18n">
-         <!--map:parameter name="locale" value="en-US"/-->
        </map:transform>
        <map:call resource="simple-page2html">
          <map:parameter name="file" value="forms/form1_success.xsp"/>
        </map:call>
        <map:transform type="i18n">
-         <!--map:parameter name="locale" value="en-US"/-->
        </map:transform>
        <map:transform src="resources/forms-samples-styling.xsl"/>
+
        <map:serialize/>
      </map:match>
         
@@ -503,7 +506,32 @@
        </map:call>
        <map:serialize />
      </map:match>
-
+     
+     <!-- **************************** profiling **************************** -->
+     <map:match pattern="form1-cforms-transformer">
+       <map:act type="init-form">
+         <map:parameter name="form-definition" value="forms/form1.xml"/>
+         <map:parameter name="attribute-name" value="form1"/>
+       </map:act>       
+       <map:generate src="forms/form1_template_action.xml"/>
+       <map:transform type="forms" label="content1">
+         <map:parameter name="attribute-name" value="form1"/>
+       </map:transform>
+       <map:serialize type="xml"/>
+     </map:match>  
+     <map:match pattern="form1-jx-macro">
+       <map:act type="init-form">
+         <map:parameter name="form-definition" value="forms/form1.xml"/>
+         <map:parameter name="attribute-name" value="form1"/>
+       </map:act>       
+       <map:generate src="forms/form1_template_action_jx-macro.xml" type="jx">
+         <map:parameter name="attribute-name" value="form1"/>       	
+       </map:generate>
+       <map:serialize type="xml"/>
+     </map:match>     
+     
+     <!-- **************************** mounts **************************** -->
+     
     <map:match pattern="*">
         <map:redirect-to uri="{1}/"/>
     </map:match>

Modified: cocoon/blocks/core/forms/trunk/samples/welcome.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/welcome.xml?rev=170828&r1=170827&r2=170828&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/welcome.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/welcome.xml Wed May 18 14:01:28 2005
@@ -109,6 +109,15 @@
       Create your Euro 2004 soccer dream team
     </sample>
  </group>
+
+  <group name="Profiling information">
+    <note>
+      These samples concentrate on Cocoon Forms and JXTemplate in order to collect profiling
information.
+      In order to keep the samples as lean as possible, an action is used as controller.
+    </note>
+    <sample name="form1 - JXTemplate" href="form1-jx-macro">Render form using JXTemplate
macros</sample>
+    <sample name="form1 - FormsTransformer" href="form1-cforms-transformer">Render
form using the FormsTransformer</sample>    
+  </group> 
  
  <group name="Experimental Flowscript API for Cocoon Forms">
   <note>



Mime
View raw message