dlr 01/06/13 09:02:04
Modified: docs/services intake-service.html
Log:
Added Henning's recent additions to the Intake service documentation. This was
regenerated by checking out the jakarta-site2 module at the same directory level as
jakarta-turbine and doing a 'ant docs' from Turbine's build directory.
Revision Changes Path
1.21 +157 -12 jakarta-turbine/docs/services/intake-service.html
Index: intake-service.html
===================================================================
RCS file: /home/cvs/jakarta-turbine/docs/services/intake-service.html,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- intake-service.html 2001/06/01 17:10:31 1.20
+++ intake-service.html 2001/06/13 16:02:01 1.21
@@ -15,6 +15,8 @@
<meta name="email" value="[EMAIL PROTECTED]">
<meta name="author" value="Jon S. Stevens">
<meta name="email" value="[EMAIL PROTECTED]">
+ <meta name="author" value="Henning P.
Schmiedehausen">
+ <meta name="email" value="[EMAIL PROTECTED]">
<title>Turbine - Turbine Services - Intake Service</title>
</head>
@@ -346,20 +348,20 @@
mapToObject="om.AttributeValue">
<field name="Value" key="val" type="String">
<rule name="maxLength" value="255">Value length
cannot be &gt; 255</rule>
- <required-message>This module requires data for this
+ <rule name="required" value="true">This module
requires data for this
attribute.
- </required-message>
+ </rule>
</field>
<field name="Url" key="url" type="String"
mapToProperty="Value">
<rule name="maxLength" value="255">Url length
cannot be &gt; 255</rule>
<rule name="mask" value="^$|http.+">Please enter
an url starting with "http"</rule>
- <required-message>This module requires a valid
url.</required-message>
+ <rule name="required" value="true">This module
requires a valid url.</rule>
</field>
<field name="OptionId" key="optionid"
type="NumberKey">
<rule name="mask" value="^$|[0-9]+">Please select
a valid choice</rule>
- <required-message>This module requires that you select an option
+ <rule name="required" value="true">This module
requires that you select an option
for this attribute.
- </required-message>
+ </rule>
</field>
</group>
@@ -414,10 +416,153 @@
Email, Url, or Date, will be added that will add functionality that is
difficult or not possible with a simple regex mask.
</p>
- <p>
+ </blockquote>
+ </p>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
+ <tr><td bgcolor="#525D76">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Field Rules"><strong>Field Rules</strong></a>
+ </font>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
The field can define rule elements. The basic fields include rules for
minimum and maximum, lengths and values, as well as a regex mask.
</p>
+ <p>The basic validator can do four
different checks:</p>
+ <p>required - Must this element be
present or not? If it is not
+required, some of the following checks, namely the minLength may not
+work as expected.</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+ <rule type="required" value="true">This field must be
present</rule>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p> minLength - The minium length
of the input string. Note that one of the
+ most obvious uses of this check, namely that the length is at least 1
+ character should not be done here but with "required" above. The following
+ example does <b>not</b> work!</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+ <rule type="minLength" value="1">This form field must be
filled out</rule>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>If the field is not required,
then the following checks are (of course)
+ not done if the field is not present at all! So the check above is always
+ true unless there is also a "required" rule but then you don't need this
+ check no longer. The following example is much better:</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+ <rule type="required" value="true">This field must be
present</rule>
+ <rule type="minLength" value="8">This field must have at
least eight characters!</rule>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>maxLength - The maximum length
of the input string. This is pretty
+ straightforward. If the field is longer than this rule, you get an
+ error.</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+ <rule type="maxLength" value="64">This field must have
64 or less characters!</rule>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>mask - A regular expression mask
which the input field must fit. This
+ is very useful if you enter some formatted data (e.g. a date) into a
+ string field and want to rule out some of the basic errors. The
+ regular expressions are taken from the <A
HREF="http://jakarta.apache.org/regexp/">Jakarta Regexp package</A>
+ and are described in the javadocs <A
HREF="http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html">
+ here</A>.</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+<rule type="mask" value="\d\d?\.\d\d?\.\d\d\d?\d?">The
date format is invalid!</rule>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>Note that you can have only one
mask rule per field. It is not
+ possible to use multiple masks for a single field.</p>
</blockquote>
</p>
</td></tr>
@@ -838,14 +983,14 @@
<td bgcolor="#ffffff"><pre>
<field name="Value" key="val" type="String">
<rule name="maxLength" value="255">Value length
cannot be &gt; 255</rule>
- <required-message>This module requires data for this
+ <rule name="required" value="true">This module
requires data for this
attribute.
- </required-message>
+ </rule>
</field>
<field name="Url" key="url" type="String"
mapToProperty="Value">
<rule name="maxLength" value="255">Url length cannot
be &gt; 255</rule>
<rule name="mask" value="^$|http.+">Please enter an
url starting with "http"</rule>
- <required-message>This module requires a valid
url.</required-message>
+ <rule name="required" value="true">This module
requires a valid url.</rule>
</field>
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
@@ -1017,14 +1162,14 @@
<td bgcolor="#ffffff"><pre>
<field name="Value" key="val" type="String">
<rule name="maxLength" value="255">Value length
cannot be &gt; 255</rule>
- <required-message>This module requires data for this
+ <rule name="required" value="true">This module
requires data for this
attribute.
- </required-message>
+ </rule>
</field>
<field name="Url" key="url" type="String"
mapToProperty="Value">
<rule name="maxLength" value="255">Url length
cannot be &gt; 255</rule>
<rule name="mask" value="^$|http.+">Please enter
an url starting with "http"</rule>
- <required-message>This module requires a valid
url.</required-message>
+ <rule name="required" value="true">This module
requires a valid url.</rule>
</field>
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]