Author: vgritsenko Date: Sat Nov 13 15:09:31 2004 New Revision: 65535 Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/descriptor.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/form.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/success.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/samples.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/descriptor.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/form.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/success.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/descriptor.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/form.xml cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/success.xml Log: tweak layout, tweak text, whitespace
Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/descriptor.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/descriptor.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/descriptor.xml Sat Nov 13 15:09:31 2004 @@ -14,22 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. --> -<root> - - <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> - <parameter name="deposit" type="double" min="10.0" max="999.99"/> - <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> - <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> - <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> - <parameter name="driver" type="string" nullable="yes" max-len="20"/> - <constraint-set name="car-reservation"> - <validate name="persons"/> - <validate name="deposit" min="50.0"/> - <validate name="email"/> - <validate name="address"/> - <validate name="type"/> - <validate name="driver"/> - </constraint-set> +<root> + <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> + <parameter name="deposit" type="double" min="10.0" max="999.99"/> + <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> + <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> + <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> + <parameter name="driver" type="string" nullable="yes" max-len="20"/> + <constraint-set name="car-reservation"> + <validate name="persons"/> + <validate name="deposit" min="50.0"/> + <validate name="email"/> + <validate name="address"/> + <validate name="type"/> + <validate name="driver"/> + </constraint-set> </root> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/form.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/form.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/form.xml Sat Nov 13 15:09:31 2004 @@ -14,124 +14,130 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> -<head> -<style type="text/css"> -span.error { - font-style:italic; - font-weight:bold; - color:red; - background-color:#fffbe4; -} -</style> -</head> - <title>Formvalidation and -prefilling</title> - <body> - <h1>Reserve a car with Cocoon Cars!</h1> - - <p>This last sample combines the techniques demonstrated in the - previous two samples. Default data is inserted filled into the - form using a combination of the SimpleFormInstanceTransformer and - the SimpleFormTransformer. In addition, user input is validated - with the FormValidatorAction and the submitted data is filled - in with another SimpleFormTransformer which also selects which - error tags shall occurr in the resulting page.</p> - - <h2>Car Reservation</h2> - <p>Please fill in the form completely in order to reserve a car.</p> - <form name="car" method="post"> - <!-- the transformer can be configured to look for the instance --> - <!-- data outside the form element. --> - <form-instance> - <persons>4</persons> - <deposit>50</deposit> - <email>your email</email> - <driver/> - <driver/> - <driver/> - </form-instance> - <table> - <tbody> - <tr> - <td> - The car should seat - <select size="1" name="persons"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="2">2</option> - <option value="4">4</option> - <option value="5">5</option> - <option value="7">7</option> - <option value="9">9</option> - </select> - Persons. - </td> - <td> - <error name="persons" when-ge="error">*</error> - </td> - </tr> - <tr> - <td> - The car should by a - <select size="1" name="type"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="sedan">Sedan Car</option> - <option value="station">Station Wagon</option> - <option value="cabrio">Cabrio</option> - <option value="racing">Sports Car</option> - </select> - </td> - <td><error name="type" when-ge="error">*</error></td> - </tr> - <tr> - <td> - I'd like to deposit EUR <input type="text" size="4" name="deposit"/> - </td> - <td><error name="deposit" when-ge="error">*</error></td> - </tr> - <tr> - <td>My email is <input type="text" size="30" name="email"/></td> - <td><error name="email" when-ge="error">*</error></td> - </tr> - <tr> - <td> - Please bill to - <textarea name="address" cols="30" rows="5" /> - </td> - <td><error name="address" when-ge="error">*</error></td> - </tr> - <repeat on="driver"> - <tr> - <td> - Allowed driver <input name="driver" type="text" size="20" /> - </td> - <td><error name="driver" when-ge="error">*</error></td> - </tr> - </repeat> - <tr> - <td colspan="2"> - <ol> - <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> - <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> - <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> - <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> - <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> - <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> - <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> - <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> - <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> - <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> - <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> - - <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> - </ol> - </td> - </tr> - <tr> - <td></td> - <td><input type="submit" name="go" value="go!"/></td> - </tr> - </tbody> - </table> - </form> - </body> + <head> + <style type="text/css"> + span.error { + font-style:italic; + font-weight:bold; + color:red; + background-color:#fffbe4; + } + </style> + </head> + + <title>Form Validation And Pre-Population</title> + + <body> + <h1>Reserve a car with Cocoon Cars!</h1> + + <p>This last sample combines the techniques demonstrated in the + previous two samples. Default data is inserted filled into the + form using a combination of the SimpleFormInstanceTransformer and + the SimpleFormTransformer. In addition, user input is validated + with the FormValidatorAction and the submitted data is filled + in with another SimpleFormTransformer which also selects which + error tags shall occurr in the resulting page.</p> + + <h2>Car Reservation</h2> + <p>Please fill in the form completely in order to reserve a car.</p> + <form name="car" method="post"> + <!-- the transformer can be configured to look for the instance --> + <!-- data outside the form element. --> + <form-instance> + <persons>4</persons> + <deposit>50</deposit> + <email>your email</email> + <driver/> + <driver/> + <driver/> + </form-instance> + + <table> + <tbody> + <tr> + <td>Choose a car seating capacity</td> + <td> + <select size="1" name="persons"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="2">2</option> + <option value="4">4</option> + <option value="5">5</option> + <option value="7">7</option> + <option value="9">9</option> + </select> + </td> + <td> + <error name="persons" when-ge="error">*</error> + </td> + </tr> + <tr> + <td>Choose car type</td> + <td> + <select size="1" name="type"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="sedan">Sedan Car</option> + <option value="station">Station Wagon</option> + <option value="cabrio">Cabrio</option> + <option value="racing">Sports Car</option> + <option value="bus">Bus</option> + </select> + </td> + <td><error name="type" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter amount of the deposit</td> + <td><input type="text" size="4" name="deposit"/></td> + <td><error name="deposit" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter confirmation email address</td> + <td><input type="text" size="30" name="email"/></td> + <td><error name="email" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter billing address</td> + <td><textarea name="address" cols="30" rows="5"/></td> + <td><error name="address" when-ge="error">*</error></td> + </tr> + + <!-- the following repeat tag inserts as many rows as --> + <!-- drivers were submitted on the request. --> + <repeat on="driver"> + <tr> + <td> + Allowed driver <input name="driver" type="text" size="20" /> + </td> + <td><error name="driver" when-ge="error">*</error></td> + </tr> + </repeat> + + <tr> + <td colspan="2"> + Validation errors, if any: + <ol> + <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> + <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> + <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> + <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> + <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> + <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> + <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> + <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> + <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> + <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> + <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> + <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> + </ol> + </td> + </tr> + <tr> + <td></td> + <td><input type="submit" name="go" value="Go!"/></td> + </tr> + </tbody> + </table> + </form> + </body> </page> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/success.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/success.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/four/success.xml Sat Nov 13 15:09:31 2004 @@ -14,32 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> - <title>Formvalidation and -prefilling</title> + <title>Form Validation And Pre-Population</title> + <h1>Receipt</h1> <content> - <para> The entered data successfully passed the validation stage. </para> - <form name="car" method="post"> - <para> - A <input type="text" name="type" readonly="true"/> car which seats - <input type="text" name="persons" readonly="true"/> has been reserved for you. - Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> - at the reception. The invoice will be send to <textarea name="address"/> and a - confirmation email will be send to <input type="text" readonly="true" name="email"/>. - </para> - <para>Allowed drivers are</para> - <ol> - <repeat on="driver"> - <li><input type="text" name="driver" readonly="true"/></li> - </repeat> - </ol> - <para>Thank you for choosing Cocoon.</para> - </form> + <para> + A <input type="text" name="type" readonly="true"/> car which seats + <input type="text" name="persons" readonly="true"/> has been reserved for you. + Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> + at the reception desk. The invoice will be sent to <textarea name="address"/> + and a confirmation email will arrive to + <input type="text" readonly="true" name="email"/> shortly. Enjoy your car. + </para> + + <para>Allowed drivers are</para> + <ol> + <repeat on="driver"> + <li><input type="text" name="driver" readonly="true"/></li> + </repeat> + </ol> + <para>Thank you for choosing Cocoon demo for your car reservation needs.</para> + </form> </content> </page> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/samples.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/samples.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/samples.xml Sat Nov 13 15:09:31 2004 @@ -15,29 +15,29 @@ limitations under the License. --> -<!-- CVS: $Id: samples.xml,v 1.4 2004/04/28 21:01:23 upayavira Exp $ --> +<!-- CVS: $Id$ --> <samples xmlns:xlink="http://www.w3.org/1999/xlink" name="simple form handling"> <group name="Simple Form Handling"> <note> + Apache Cocoon contains several approaches to forms. The one demonstrated + here is probably the simplest but also the weakest. Please also consider + Cocoon Forms in the Forms block. + </note> + <note> This samples group demonstrates the use for the simple form handling in Apache Cocoon. Simple form handling consists of four parts: validating user input, filling forms with submitted data, displaying validation results, and filling forms with default values. This corresponds largely to the involved Cocoon components: a validating - action, a logicsheet helping to display validation results, a + action, an XSP logicsheet helping to display validation results, a transformer to fill in submitted data and display validation results, and a transformer to extract default values. </note> - <note> - Apache Cocoon contains several approaches to forms. The one demonstrated - here is probably the simplest but also the weakest. Please also consider - Cocoon Forms in the Forms block. - </note> <sample name="Logicsheet" href="one/index"> - On a XSP two logicsheets are used to redisplay submitted data and - indicate validation results. + On an XSP page two logicsheets are used to redisplay submitted data + and indicate validation results. </sample> <sample name="One Transformer" href="two/index"> On a static XML page a form is displayed, submitted data is filled in, Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/descriptor.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/descriptor.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/descriptor.xml Sat Nov 13 15:09:31 2004 @@ -14,22 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. --> -<root> - - <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> - <parameter name="deposit" type="double" min="10.0" max="999.99"/> - <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> - <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> - <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> - <parameter name="driver" type="string" nullable="yes" max-len="20"/> - <constraint-set name="car-reservation"> - <validate name="persons"/> - <validate name="deposit" min="50.0"/> - <validate name="email"/> - <validate name="address"/> - <validate name="type"/> - <validate name="driver"/> - </constraint-set> +<root> + <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> + <parameter name="deposit" type="double" min="10.0" max="999.99"/> + <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> + <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> + <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> + <parameter name="driver" type="string" nullable="yes" max-len="20"/> + <constraint-set name="car-reservation"> + <validate name="persons"/> + <validate name="deposit" min="50.0"/> + <validate name="email"/> + <validate name="address"/> + <validate name="type"/> + <validate name="driver"/> + </constraint-set> </root> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/form.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/form.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/form.xml Sat Nov 13 15:09:31 2004 @@ -14,126 +14,131 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> -<head> -<style type="text/css"> -span.error { - font-style:italic; - font-weight:bold; - color:red; - background-color:#fffbe4; -} -</style> -</head> - <title>Formvalidation and -prefilling</title> - <body> - <h1>Reserve a car with Cocoon Cars!</h1> - - <p>Here, only default data that is provided separate from the form - elements is filled in. No validation occurrs. The transformer has - been instructed to let error elements pass, therefore all errors - are shown.</p> - - <h2>Car Reservation</h2> - <p>Please fill in the form completely in order to reserve a car.</p> - <form name="car" method="post"> - <!-- the transformer can be configured to look for the instance --> - <!-- data outside the form element. --> - <form-instance> - <persons>4</persons> - <deposit>50</deposit> - <email>your email</email> - <address>Please + <head> + <style type="text/css"> + span.error { + font-style:italic; + font-weight:bold; + color:red; + background-color:#fffbe4; + } + </style> + </head> + + <title>Form Validation And Pre-Population</title> + + <body> + <h1>Reserve a car with Cocoon Cars!</h1> + + <p>Here, only default data that is provided separate from the form + elements is filled in. No validation occurrs. The transformer has + been instructed to let error elements pass, therefore all errors + are shown.</p> + + <h2>Car Reservation</h2> + <p>Please fill in the form completely in order to reserve a car.</p> + <form name="car" method="post"> + <!-- the transformer can be configured to look for the instance --> + <!-- data outside the form element. --> + <form-instance> + <persons>4</persons> + <deposit>50</deposit> + <email>your email</email> + <address>Please fill in your address. - </address> - <type>sedan</type> - <driver>Peter</driver> - <driver>Mary</driver> - <driver/> - </form-instance> - <table> - <tbody> - <tr> - <td> - The car should seat - <select size="1" name="persons"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="2">2</option> - <option value="4">4</option> - <option value="5">5</option> - <option value="7">7</option> - <option value="9">9</option> - </select> - Persons. - </td> - <td> - <error name="persons" when-ge="error">*</error> - </td> - </tr> - <tr> - <td> - The car should by a - <select size="1" name="type"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="sedan">Sedan Car</option> - <option value="station">Station Wagon</option> - <option value="cabrio">Cabrio</option> - <option value="racing">Sports Car</option> - </select> - </td> - <td><error name="type" when-ge="error">*</error></td> - </tr> - <tr> - <td> - I'd like to deposit EUR <input type="text" size="4" name="deposit"/> - </td> - <td><error name="deposit" when-ge="error">*</error></td> - </tr> - <tr> - <td>My email is <input type="text" size="30" name="email"/></td> - <td><error name="email" when-ge="error">*</error></td> - </tr> - <tr> - <td> - Please bill to - <textarea name="address" cols="30" rows="5" /> - </td> - <td><error name="address" when-ge="error">*</error></td> - </tr> - <repeat on="driver"> - <tr> - <td> - Allowed driver <input name="driver" type="text" size="20" /> - </td> - <td><error name="driver" when-ge="error">*</error></td> - </tr> - </repeat> - <tr> - <td colspan="2"> - <ol> - <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> - <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> - <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> - <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> - <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> - <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> - <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> - <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> - <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> - <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> - <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> - - <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> - </ol> - </td> - </tr> - <tr> - <td></td> - <td><input type="submit" name="go" value="go!"/></td> - </tr> - </tbody> - </table> - </form> - </body> + </address> + <type>sedan</type> + <driver>Peter</driver> + <driver>Mary</driver> + <driver/> + </form-instance> + + <table> + <tbody> + <tr> + <td>Choose a car seating capacity</td> + <td> + <select size="1" name="persons"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="2">2</option> + <option value="4">4</option> + <option value="5">5</option> + <option value="7">7</option> + <option value="9">9</option> + </select> + </td> + <td> + <error name="persons" when-ge="error">*</error> + </td> + </tr> + <tr> + <td>Choose car type</td> + <td> + <select size="1" name="type"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="sedan">Sedan Car</option> + <option value="station">Station Wagon</option> + <option value="cabrio">Cabrio</option> + <option value="racing">Sports Car</option> + <option value="bus">Bus</option> + </select> + </td> + <td><error name="type" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter amount of the deposit</td> + <td><input type="text" size="4" name="deposit"/></td> + <td><error name="deposit" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter confirmation email address</td> + <td><input type="text" size="30" name="email"/></td> + <td><error name="email" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter billing address</td> + <td><textarea name="address" cols="30" rows="5"/></td> + <td><error name="address" when-ge="error">*</error></td> + </tr> + + <!-- the following repeat tag inserts as many rows as --> + <!-- drivers were submitted on the request. --> + <repeat on="driver"> + <tr> + <td>Allowed driver</td> + <td><input name="driver" type="text" size="20"/></td> + <td><error name="driver" when-ge="error">*</error></td> + </tr> + </repeat> + + <tr> + <td colspan="2"> + All validation errors: + <ol> + <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> + <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> + <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> + <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> + <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> + <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> + <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> + <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> + <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> + <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> + <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> + <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> + </ol> + </td> + </tr> + <tr> + <td></td> + <td><input type="submit" name="go" value="Go!"/></td> + </tr> + </tbody> + </table> + </form> + </body> </page> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/success.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/success.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/three/success.xml Sat Nov 13 15:09:31 2004 @@ -14,32 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> - <title>Formvalidation and -prefilling</title> + <title>Form Validation And Pre-Population</title> + <h1>Receipt</h1> <content> - <para> The entered data successfully passed the validation stage. </para> - <form name="car" method="post"> - <para> - A <input type="text" name="type" readonly="true"/> car which seats - <input type="text" name="persons" readonly="true"/> has been reserved for you. - Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> - at the reception. The invoice will be send to <textarea name="address"/> and a - confirmation email will be send to <input type="text" readonly="true" name="email"/>. - </para> - <para>Allowed drivers are</para> - <ol> - <repeat on="driver"> - <li><input type="text" name="driver" readonly="true"/></li> - </repeat> - </ol> - <para>Thank you for choosing Cocoon.</para> - </form> + <para> + A <input type="text" name="type" readonly="true"/> car which seats + <input type="text" name="persons" readonly="true"/> has been reserved for you. + Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> + at the reception desk. The invoice will be sent to <textarea name="address"/> + and a confirmation email will arrive to + <input type="text" readonly="true" name="email"/> shortly. Enjoy your car. + </para> + + <para>Allowed drivers are</para> + <ol> + <repeat on="driver"> + <li><input type="text" name="driver" readonly="true"/></li> + </repeat> + </ol> + <para>Thank you for choosing Cocoon demo for your car reservation needs.</para> + </form> </content> </page> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/descriptor.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/descriptor.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/descriptor.xml Sat Nov 13 15:09:31 2004 @@ -14,22 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. --> -<root> - - <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> - <parameter name="deposit" type="double" min="10.0" max="999.99"/> - <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> - <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> - <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> - <parameter name="driver" type="string" nullable="yes" max-len="20"/> - <constraint-set name="car-reservation"> - <validate name="persons"/> - <validate name="deposit" min="50.0"/> - <validate name="email"/> - <validate name="address"/> - <validate name="type"/> - <validate name="driver"/> - </constraint-set> +<root> + <parameter name="persons" type="long" min="2" max="9" default="5" nullable="yes"/> + <parameter name="deposit" type="double" min="10.0" max="999.99"/> + <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)+\w\w\w?$"/> + <parameter name="address" type="string" min-len="10" max-len="200" nullable="no"/> + <parameter name="type" type="string" nullable="no" one-of="|cabrio|sedan|station|racing|"/> + <parameter name="driver" type="string" nullable="yes" max-len="20"/> + <constraint-set name="car-reservation"> + <validate name="persons"/> + <validate name="deposit" min="50.0"/> + <validate name="email"/> + <validate name="address"/> + <validate name="type"/> + <validate name="driver"/> + </constraint-set> </root> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/form.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/form.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/form.xml Sat Nov 13 15:09:31 2004 @@ -14,111 +14,112 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> -<head> -<style type="text/css"> -span.error { - font-style:italic; - font-weight:bold; - color:red; - background-color:#fffbe4; -} -</style> -</head> - <title>Formvalidation and -prefilling</title> - <body> - <h1>Reserve a car with Cocoon Cars!</h1> - - <p>This sample illustrates how to use simple form validation in conjunction - with the SimpleFormTransformer to fill in user submitted data.</p> - - <h2>Car Reservation</h2> - <p>Please fill in the form completely in order to reserve a car.</p> - <form name="car" method="post"> - <table> - <tbody> - <tr> - <td> - The car should seat - <select size="1" name="persons"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="2">2</option> - <option value="4">4</option> - <option value="5">5</option> - <option value="7">7</option> - <option value="9">9</option> - </select> - Persons. - </td> - <td> - <error name="persons" when-ge="error">*</error> - </td> - </tr> - <tr> - <td> - The car should by a - <select size="1" name="type"> - <option value="" selected="true" disabled="true">Please select</option> - <option value="sedan">Sedan Car</option> - <option value="station">Station Wagon</option> - <option value="cabrio">Cabrio</option> - <option value="racing">Sports Car</option> - </select> - </td> - <td><error name="type" when-ge="error">*</error></td> - </tr> - <tr> - <td> - I'd like to deposit EUR <input type="text" size="4" name="deposit"/> - </td> - <td><error name="deposit" when-ge="error">*</error></td> - </tr> - <tr> - <td>My email is <input type="text" size="30" name="email"/></td> - <td><error name="email" when-ge="error">*</error></td> - </tr> - <tr> - <td> - Please bill to - <textarea name="address" cols="30" rows="5" /> - </td> - <td><error name="address" when-ge="error">*</error></td> - </tr> - <!-- the following repeat tag inserts as many rows as --> - <!-- drivers were submitted on the request. --> - <repeat on="driver"> - <tr> - <td> - Allowed driver <input name="driver" type="text" size="20" /> - </td> - <td><error name="driver" when-ge="error">*</error></td> - </tr> - </repeat> - <tr> - <td colspan="2"> - <ol> - <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> - <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> - <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> - <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> - <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> - <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> - <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> - <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> - <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> - <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> - <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> - - <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> - </ol> - </td> - </tr> - <tr> - <td></td> - <td><input type="submit" name="go" value="go!"/></td> - </tr> - </tbody> - </table> - </form> - </body> + <head> + <style type="text/css"> + span.error { + font-style:italic; + font-weight:bold; + color:red; + background-color:#fffbe4; + } + </style> + </head> + + <title>Form Validation And Pre-Population</title> + + <body> + <h1>Reserve a car with Cocoon Cars!</h1> + + <p>This sample illustrates how to use simple form validation in conjunction + with the SimpleFormTransformer to fill in user submitted data.</p> + + <h2>Car Reservation</h2> + <p>Please fill in the form completely in order to reserve a car.</p> + <form name="car" method="post"> + <table> + <tbody> + <tr> + <td>Choose a car seating capacity</td> + <td> + <select size="1" name="persons"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="2">2</option> + <option value="4">4</option> + <option value="5">5</option> + <option value="7">7</option> + <option value="9">9</option> + </select> + </td> + <td> + <error name="persons" when-ge="error">*</error> + </td> + </tr> + <tr> + <td>Choose car type</td> + <td> + <select size="1" name="type"> + <option value="" selected="true" disabled="true">Please select</option> + <option value="sedan">Sedan Car</option> + <option value="station">Station Wagon</option> + <option value="cabrio">Cabrio</option> + <option value="racing">Sports Car</option> + <option value="bus">Bus</option> + </select> + </td> + <td><error name="type" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter amount of the deposit</td> + <td><input type="text" size="4" name="deposit"/></td> + <td><error name="deposit" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter confirmation email address</td> + <td><input type="text" size="30" name="email"/></td> + <td><error name="email" when-ge="error">*</error></td> + </tr> + <tr> + <td>Enter billing address</td> + <td><textarea name="address" cols="30" rows="5"/></td> + <td><error name="address" when-ge="error">*</error></td> + </tr> + + <!-- the following repeat tag inserts as many rows as --> + <!-- drivers were submitted on the request. --> + <repeat on="driver"> + <tr> + <td>Allowed driver</td> + <td><input name="driver" type="text" size="20"/></td> + <td><error name="driver" when-ge="error">*</error></td> + </tr> + </repeat> + <tr> + <td colspan="2"> + Validation errors, if any: + <ol> + <li><error name="*" when-ge="error">An error occurred. <span style="background-color: #aaaaaa;">Please check your input and the messages below</span> for more <br /> information.</error></li> + <li><error name="persons" when="too-small">The smallest car <br /> seats 2.</error></li> + <li><error name="persons" when="too-large">The largest car <br /> seats 9.</error></li> + <li><error name="deposit" when="too-small">The deposit needs to be <br /> at least EUR 50.</error></li> + <li><error name="deposit" when="is-null">Please specify a <br /> deposit.</error></li> + <li><error name="email" when="is-null">Please fill in an <br /> email address.</error></li> + <li><error name="email" when="no-match">Your email seems incorrect. <br /> Please fill in a correct email address.</error></li> + <li><error name="address" when="is-null">Please fill in a <br /> billing address.</error></li> + <li><error name="address" when="too-small">Your address seems <br /> to be incorrect. Please fill in a correct billing address.</error></li> + <li><error name="type" when="is-null">Please select the type of car <br /> you would like to drive.</error></li> + <li><error name="type" when="no-match">Please select one of <br /> the existing type of car.</error></li> + <li><error name="driver" when="error">Please enter at least <br /> one valid driver's name.</error></li> + </ol> + </td> + </tr> + <tr> + <td></td> + <td><input type="submit" name="go" value="Go!"/></td> + </tr> + </tbody> + </table> + </form> + </body> </page> Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/success.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/success.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/simpleform/two/success.xml Sat Nov 13 15:09:31 2004 @@ -14,32 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. --> + <page> - <title>Formvalidation and -prefilling</title> + <title>Form Validation And Pre-Population</title> + <h1>Receipt</h1> <content> - <para> The entered data successfully passed the validation stage. </para> - <form name="car" method="post"> - <para> - A <input type="text" name="type" readonly="true"/> car which seats - <input type="text" name="persons" readonly="true"/> has been reserved for you. - Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> - at the reception. The invoice will be send to <textarea name="address"/> and a - confirmation email will be send to <input type="text" readonly="true" name="email"/>. - </para> - <para>Allowed drivers are</para> - <ol> - <repeat on="driver"> - <li><input type="text" name="driver" readonly="true"/></li> - </repeat> - </ol> - <para>Thank you for choosing Cocoon.</para> - </form> + <para> + A <input type="text" name="type" readonly="true"/> car which seats + <input type="text" name="persons" readonly="true"/> has been reserved for you. + Please leave the deposit of EUR <input type="text" name="deposit" readonly="true"/> + at the reception desk. The invoice will be sent to <textarea name="address"/> + and a confirmation email will arrive to + <input type="text" readonly="true" name="email"/> shortly. Enjoy your car. + </para> + + <para>Allowed drivers are</para> + <ol> + <repeat on="driver"> + <li><input type="text" name="driver" readonly="true"/></li> + </repeat> + </ol> + <para>Thank you for choosing Cocoon demo for your car reservation needs.</para> + </form> </content> </page>