home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / form2_model.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.3 KB  |  162 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <fd:form
  18.   xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
  19.   xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
  20.  
  21.   <fd:widgets>
  22.     <fd:field id="email" required="true">
  23.       <fd:datatype base="string">
  24.         <fd:validation>
  25.           <fd:email/>
  26.         </fd:validation>
  27.       </fd:datatype>
  28.       <fd:label>Enter an <b>email</b> address:</fd:label>
  29.     </fd:field>
  30.   
  31.     <fd:aggregatefield id="phone" required="true">
  32.       <fd:label>Enter a phone number in \+([0-9]{1,3})-([0-9]{1,4})-([0-9]{5,7}) format</fd:label>
  33.       <fd:datatype base="string"/>
  34.       <fd:split pattern="\+([0-9]{1,3})-([0-9]{1,4})-([0-9]{5,7})">
  35.         <fd:map group="1" field="cntr"/>
  36.         <fd:map group="2" field="zone"/>
  37.         <fd:map group="3" field="number"/>
  38.         <fd:failmessage>The phone-number format is wrong, please try again
  39.         </fd:failmessage>
  40.       </fd:split>
  41.       <fd:combine expression='Concat("+", cntr, "-", zone, "-", number)'/>
  42.       <fd:widgets>
  43.         <fd:field id="cntr">
  44.           <fd:datatype base="string"/>
  45.         </fd:field>
  46.         <fd:field id="zone">
  47.           <fd:datatype base="string"/>
  48.         </fd:field>
  49.         <fd:field id="number">
  50.           <fd:datatype base="string"/>
  51.         </fd:field>
  52.       </fd:widgets>
  53.     </fd:aggregatefield>
  54.   
  55.     <fd:field id="ipaddress">
  56.       <fd:label>Please enter your IP address</fd:label>
  57.       <fd:datatype base="string">
  58.         <fd:validation>
  59.           <fd:regexp pattern="^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$">
  60.             <fd:failmessage>Invalid IP address.</fd:failmessage>
  61.           </fd:regexp>
  62.         </fd:validation>
  63.       </fd:datatype>
  64.     </fd:field>
  65.   
  66.     <fd:field id="birthday" required="true">
  67.       <fd:label>Your birthday (dd/MM/yyyy):</fd:label>
  68.       <fd:datatype base="date">
  69.         <fd:convertor>
  70.           <fd:patterns>
  71.             <fd:pattern>dd/MM/yyyy</fd:pattern>
  72.             <!-- The above pattern is a non-locale-specific pattern. You can
  73.             also add locale-specific patterns by adding more fd:pattern elements
  74.             here, with a locale attribute on them. -->
  75.           </fd:patterns>
  76.         </fd:convertor>
  77.       </fd:datatype>
  78.     </fd:field>
  79.   
  80.     <fd:field id="number" required="true">
  81.       <fd:label>Select a number:</fd:label>
  82.       <fd:datatype base="integer"/>
  83.       <fd:selection-list>
  84.         <fd:item value="1"/>
  85.         <fd:item value="2"/>
  86.         <fd:item value="3"/>
  87.         <fd:item value="4"/>
  88.         <fd:item value="5"/>
  89.       </fd:selection-list>
  90.     </fd:field>
  91.   
  92.     <fd:booleanfield id="choose">
  93.       <fd:label>I choose</fd:label>
  94.     </fd:booleanfield>
  95.   
  96.     <fd:field id="sex">
  97.       <fd:label>Sex</fd:label>
  98.       <fd:datatype base="enum">
  99.         <fd:convertor type="enum">
  100.           <fd:enum>org.apache.cocoon.forms.samples.Sex</fd:enum>
  101.         </fd:convertor>
  102.       </fd:datatype>
  103.       <fd:selection-list type="enum" class="org.apache.cocoon.forms.samples.Sex"/>
  104.     </fd:field>
  105.   
  106.     <fd:multivaluefield id="drinks">
  107.       <fd:label>Indicate which 2 of the following drinks you'd like to receive:</fd:label>
  108.       <fd:datatype base="string"/>
  109.       <fd:validation>
  110.         <fd:value-count exact="2"/>
  111.       </fd:validation>
  112.       <fd:selection-list>
  113.         <fd:item value="Maes"/>
  114.         <fd:item value="Jupiler"/>
  115.         <fd:item value="Leffe"/>
  116.         <fd:item value="Hoegaarden"/>
  117.         <fd:item value="Coca Cola"/>
  118.       </fd:selection-list>
  119.     </fd:multivaluefield>
  120.  
  121.     <fd:repeater id="contacts">
  122.       <fd:widgets>
  123.         <fd:output id="id">
  124.           <fd:datatype base="long"/>
  125.         </fd:output>
  126.         <fd:field id="firstname">
  127.           <fd:label>Firstname</fd:label>
  128.           <fd:datatype base="string"/>
  129.         </fd:field>
  130.         <fd:field id="lastname">
  131.           <fd:label>Lastname</fd:label>
  132.           <fd:datatype base="string"/>
  133.         </fd:field>
  134.         <fd:field id="phone">
  135.           <fd:label>Phone</fd:label>
  136.           <fd:datatype base="string"/>
  137.         </fd:field>
  138.         <fd:field id="email">
  139.           <fd:label>Email</fd:label>
  140.           <fd:datatype base="string">
  141.             <fd:validation>
  142.               <fd:email/>
  143.             </fd:validation>
  144.           </fd:datatype>
  145.         </fd:field>
  146.         <fd:booleanfield id="select">
  147.           <fd:label>Select</fd:label>
  148.         </fd:booleanfield>
  149.       </fd:widgets>
  150.     </fd:repeater>
  151.   
  152.     <fd:repeater-action id="addcontact" action-command="add-row" repeater="contacts">
  153.       <fd:label>Add contact</fd:label>
  154.     </fd:repeater-action>
  155.   
  156.     <fd:repeater-action id="removecontacts" action-command="delete-rows" repeater="contacts" select="select">
  157.       <fd:label>Remove selected contacts</fd:label>
  158.     </fd:repeater-action>
  159.   </fd:widgets>
  160.  
  161. </fd:form>
  162.