jon 01/06/29 12:00:00
Modified: xdocs/services intake-service.xml
docs contributors.html
docs/howto peers-howto.html velocity-site-howto.html
docs/services intake-service.html
Removed: xdocs/proposals security-service.xml
Log:
removing security-service.xml cause the .html file was removed
checking in changes that were a result of a bunch of bug fixes, but the
.html files were never checked in.
added documentation to intake service based on postings on the mailing
lists
Revision Changes Path
1.9 +128 -0 jakarta-turbine/xdocs/services/intake-service.xml
Index: intake-service.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine/xdocs/services/intake-service.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- intake-service.xml 2001/06/13 12:35:48 1.8
+++ intake-service.xml 2001/06/29 18:59:51 1.9
@@ -819,6 +819,134 @@
</section>
+<section name="Mini-FAQ">
+
+<p>Question</p>
+<source><![CDATA[
+Has anyone used intake with field types other than String and the basic
+integer types?
+
+In particular I am interested in boolean and Date fields. Is there a way
+I can map a boolean to a checkbox and a Date to something a bit nicer
+than a standard text input box (perhaps three selects)?
+
+Can intake validate the date values?
+
+Also, what are the onError and validator attributes of the field element
+for (as found in the DTD)?
+]]></source>
+
+<p>Answer</p>
+
+<source><![CDATA[
+There is boolean type
+
+Example
+
+<field name="Active" key="active" type="boolean"/>
+
+Here is a macro that adds a hidden value that intake will use in the
+event the box is unchecked. It would be used similar to
+#booleanCheckbox($intake.Attribute.mapTo($attribute).Active)
+
+#macro ( booleanCheckbox $booleanField )
+ <input type="checkbox" name="$booleanField.Key" value="true"
+ #if ($booleanField.Value) checked #end />
+ <input type="hidden" name="$booleanField.ValueIfAbsent"
+ value="false" />
+#end
+
+Date types still need to be added. Please help with this if you have
+the need.
+
+> Also, what are the onError and validator attributes of
+> the field element for (as found in the DTD)?
+>
+
+onError should be removed I think, I will make sure it is not used.
+validator is used to override the default validator for a field type.
+For example the String type currently has the DefaultValidator as its
+default which provides such things as maxLength and regexp mask rules.
+Let's say you have an EmailValidator that is more efficient than a mask
+rule and would like to use that, you would specify the classname in the
+validator attribute.
+
+john mcnally
+]]></source>
+
+<p>Followup</p>
+
+<source><![CDATA[
+I have worked up an interim solution whereby I add a pair of
+wrapper methods around the date in the peer class thus:
+
+ public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance();
+
+ public String getStartDateString()
+ {
+ return CmesConstants.DATE_FORMAT.format(getStartDate());
+ }
+
+ public void setStartDateString(String dateString)
+ {
+ try {
+ setStartDate(CmesConstants.DATE_FORMAT.parse(dateString));
+ }
+ catch (ParseException ex) {
+ Log.error("setStartDate(): Unable to parse dateString: " + dateString);
+ }
+ }
+
+In my intake file I use the wrapper instead of the real attribute thus:
+
+ <field name="StartDate" key="sdate" type="String" mapToProperty="StartDateString">
+ <rule name="required" value="true">Please enter a start date.</rule>
+ <rule name="mask" value="^[0-3]?\d/[01]?\d/[29][09]\d\d$">Please enter a
sensible date ("dd/mm/yyyy").</rule>
+ </field>
+
+Note that the date format I am using here is that suitable
+for Australia. The mask allows for dates from 2000 through
+2099 as well as the date 31/12/9999 which is my maximum
+date.
+
+While not perfect, this solution should be adequate for my
+current application. I am not confident enough yet to dive
+in and have a go at writing a proper date validator. It looks
+like Ian might be on to this already.
+]]></source>
+
+<source><![CDATA[
+elicia wrote:
+...
+>
+> Also, I do not quite understand what the boolean third argument does in
+> the following line:
+>
+> Group group = intake.get("AttributeValue", aval.getQueryKey(), *false*);
+>
+> I am also not entirely clear what it means to get a Default group as in
+> the following template code:
+>
+> Group group = intake.get("AttributeValue", aval.getQueryKey());
+
+
+The third argument tells Intake not to create the Group if it was not
+present in the request parameters. So if you expect that the parameters
+should have been present, using false, and then checking if group ==
+null would let you know of a problem.
+
+It seems that false, is the more often used form, so it would have been
+better if the two arg method defaulted to false instead of true, but I
+have not decided whether to change it. The reason for having the option
+of creating the group if it did not exist is that is the primary way of
+using Intake in templates and I thought there might be circumstances
+where an Action may want to create intake groups that would then be
+available in templates. It has not turned out to be too common, yet.
+
+john mcnally
+]]></source>
+
+</section>
</body>
1.52 +2 -2 jakarta-turbine/docs/contributors.html
Index: contributors.html
===================================================================
RCS file: /home/cvs/jakarta-turbine/docs/contributors.html,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- contributors.html 2001/05/20 01:27:54 1.51
+++ contributors.html 2001/06/29 18:59:53 1.52
@@ -1054,12 +1054,12 @@
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
+ <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- Periapt
+ Zenplex Inc.
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
1.7 +5 -5 jakarta-turbine/docs/howto/peers-howto.html
Index: peers-howto.html
===================================================================
RCS file: /home/cvs/jakarta-turbine/docs/howto/peers-howto.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- peers-howto.html 2001/05/21 00:09:33 1.6
+++ peers-howto.html 2001/06/29 18:59:55 1.7
@@ -191,7 +191,7 @@
</p>
<p>
There is exactly one DatabaseMap for each relational database that you
-connect to. You may wish to connect to more that one database in your
+connect to. You may wish to connect to more than one database in your
application. You should then have one DatabaseMap for each of the
databases.
</p>
@@ -218,7 +218,7 @@
<tr><td>
<blockquote>
<p>
-Everything in Peers resolve around Peer classes. A Peer class have a
+Everything in Peers resolve around Peer classes. A Peer class has a
one-to-one mapping to a Database table. You use each table's associated
Peer class to do operations on that table. Peer classes can be generated
for you automatically.
@@ -226,7 +226,7 @@
<p>
Peer classes have static methods only, so you would never create objects of
Peer classes. It is not necessary to have objects on this level because
-of the one-to-one mapping with a table. Peer methods are thread-save.
+of the one-to-one mapping with a table. Peer methods are thread safe.
</p>
</blockquote>
</p>
@@ -249,8 +249,8 @@
</p>
<p>
Data Objects are used almost exclusively with their related Peer classes.
-Where peer classes "wraps around" around a database table, a Data Object
-"wraps around" individual rows of the table. The two always go together.
+Where peer classes "wrap around" around a database table, a Data Object
+"wrap around" individual rows of the table. The two always go together.
</p>
<p>
You normally use Data Objects in one of two ways. The most common way
1.7 +1 -1 jakarta-turbine/docs/howto/velocity-site-howto.html
Index: velocity-site-howto.html
===================================================================
RCS file: /home/cvs/jakarta-turbine/docs/howto/velocity-site-howto.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- velocity-site-howto.html 2001/05/21 00:09:35 1.6
+++ velocity-site-howto.html 2001/06/29 18:59:55 1.7
@@ -677,7 +677,7 @@
<blockquote>
<p>
There is also a new feature of Turbine that the VelocitySiteAction takes
-advantage of, it is called <a href="action-event.html">Action Event</a>.
+advantage of, it is called <a href="action-event-howto.html">Action Event</a>.
Please click the link and read more documentation about it. This is an
excellent way to write your actions because now they are entirely event
driven based on which button was clicked in the HTML form.
1.22 +205 -0 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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- intake-service.html 2001/06/13 16:02:01 1.21
+++ intake-service.html 2001/06/29 18:59:58 1.22
@@ -1366,6 +1366,211 @@
</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="Mini-FAQ"><strong>Mini-FAQ</strong></a>
+ </font>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ <tr><td>
+ <blockquote>
+ <p>Question</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>
+Has anyone used intake with field types other than String and the basic
+integer types?
+
+In particular I am interested in boolean and Date fields. Is there a way
+I can map a boolean to a checkbox and a Date to something a bit nicer
+than a standard text input box (perhaps three selects)?
+
+Can intake validate the date values?
+
+Also, what are the onError and validator attributes of the field element
+for (as found in the DTD)?
+</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>Answer</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>
+There is boolean type
+
+Example
+
+<field name="Active" key="active"
type="boolean"/>
+
+Here is a macro that adds a hidden value that intake will use in the
+event the box is unchecked. It would be used similar to
+#booleanCheckbox($intake.Attribute.mapTo($attribute).Active)
+
+#macro ( booleanCheckbox $booleanField )
+ <input type="checkbox" name="$booleanField.Key"
value="true"
+ #if ($booleanField.Value) checked #end />
+ <input type="hidden" name="$booleanField.ValueIfAbsent"
+ value="false" />
+#end
+
+Date types still need to be added. Please help with this if you have
+the need.
+
+> Also, what are the onError and validator attributes of
+> the field element for (as found in the DTD)?
+>
+
+onError should be removed I think, I will make sure it is not used.
+validator is used to override the default validator for a field type.
+For example the String type currently has the DefaultValidator as its
+default which provides such things as maxLength and regexp mask rules.
+Let's say you have an EmailValidator that is more efficient than a mask
+rule and would like to use that, you would specify the classname in the
+validator attribute.
+
+john mcnally
+</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>Followup</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>
+I have worked up an interim solution whereby I add a pair of
+wrapper methods around the date in the peer class thus:
+
+ public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance();
+
+ public String getStartDateString()
+ {
+ return CmesConstants.DATE_FORMAT.format(getStartDate());
+ }
+
+ public void setStartDateString(String dateString)
+ {
+ try {
+ setStartDate(CmesConstants.DATE_FORMAT.parse(dateString));
+ }
+ catch (ParseException ex) {
+ Log.error("setStartDate(): Unable to parse dateString: " +
dateString);
+ }
+ }
+
+In my intake file I use the wrapper instead of the real attribute thus:
+
+ <field name="StartDate" key="sdate"
type="String" mapToProperty="StartDateString">
+ <rule name="required" value="true">Please enter a
start date.</rule>
+ <rule name="mask"
value="^[0-3]?\d/[01]?\d/[29][09]\d\d$">Please enter a sensible date
("dd/mm/yyyy").</rule>
+ </field>
+
+Note that the date format I am using here is that suitable
+for Australia. The mask allows for dates from 2000 through
+2099 as well as the date 31/12/9999 which is my maximum
+date.
+
+While not perfect, this solution should be adequate for my
+current application. I am not confident enough yet to dive
+in and have a go at writing a proper date validator. It looks
+like Ian might be on to this already.
+</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>
+ <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>
+elicia wrote:
+...
+>
+> Also, I do not quite understand what the boolean third argument does in
+> the following line:
+>
+> Group group = intake.get("AttributeValue", aval.getQueryKey(),
*false*);
+>
+> I am also not entirely clear what it means to get a Default group as in
+> the following template code:
+>
+> Group group = intake.get("AttributeValue", aval.getQueryKey());
+
+
+The third argument tells Intake not to create the Group if it was not
+present in the request parameters. So if you expect that the parameters
+should have been present, using false, and then checking if group ==
+null would let you know of a problem.
+
+It seems that false, is the more often used form, so it would have been
+better if the two arg method defaulted to false instead of true, but I
+have not decided whether to change it. The reason for having the option
+of creating the group if it did not exist is that is the primary way of
+using Intake in templates and I thought there might be circumstances
+where an Action may want to create intake groups that would then be
+available in templates. It has not turned out to be too common, yet.
+
+john mcnally
+</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>
+ </blockquote>
+ </p>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
</td>
</tr>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]