You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2010/07/02 17:26:00 UTC
svn commit: r960027 [4/4] - in /tcl/rivet/trunk: ./ doc/html/ doc/xml/
Added: tcl/rivet/trunk/doc/html/xml_calendar.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/xml_calendar.html?rev=960027&view=auto
==============================================================================
--- tcl/rivet/trunk/doc/html/xml_calendar.html (added)
+++ tcl/rivet/trunk/doc/html/xml_calendar.html Fri Jul 2 15:25:59 2010
@@ -0,0 +1,32 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>XmlCalendar</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="calendar_package.html" title="Calendar Package"><link rel="prev" href="calendar.html" title="Calendar"><link rel="next" href="help.html" title="Resources - How to Get Help"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">XmlCalendar</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="calendar.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Calendar Package</th><td width="20%" align="right"> <a accesskey="n" href="help.html"><img src="images/next.png" alt="Next"></a></td></tr></
table></div><div class="refentry" title="XmlCalendar"><div class="refentry.separator"><hr></div><a name="xml_calendar"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>XmlCalendar — XmlCalendar returns XML formatted calendar tables</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">XmlCalendar</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>calendar_name</code></em></span> ?<span style="font-family:monospace; font-weight: bold;">-option1 <em class="replaceable"><code>value_1</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">-option2 <em class="replaceable"><code>value_2</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;">...</span>
?</div></div></div><div class="refsect1"><a name="id621844"></a><p style="width:90%">
+ An XmlCalendar object is created and returned. This command object accepts many
+ customization options to specify the XML tags to be used in the structure of
+ the cal table.
+ </p><div class="refsect2" title="Options"><a name="id621851"></a><h3>Options</h3><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">-container options_list</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ Assigns the <span style="font-family:monospace"><span class="command"><strong>options_list</strong></span></span> to the XML root element that
+ will encompass the whole table.
+ </div><div style="margin-bottom:1.5ex ; padding .5ex">
+ An option list is organized as an odd-sized list of option:
+<pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">tag_name attr11 val1 attr2 val2 ...</pre>
+ </div><div style="margin-bottom:1.5ex ; padding .5ex">
+ The first element of the list is the tag name that will assigned to the container
+ (default: calendar, no attributes). The remaining terms must be an even number and are
+ interpreted as attribute-value pairs
+ </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">-header (tag_name attr11 val1
+ attr2 val2 ...)</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ Assigns tag name and attributes to the XML header element (default: calheader)
+ </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">-body (tag_name attr11 val1
+ attr2 val2 ...)</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ Assigns tag name and attributes to the XML body element of the table (default: calbody)
+ </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">-banner (tag_name attr11 val1
+ attr2 val2 ...)</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ Assigns tag name and attributes to the XML banner element of the table (default: monthyear)
+ </div><div style="margin-bottom:1.5ex ; padding .5ex">
+ The header of a calendar table is made of a banner, showing the Month and Year number, and
+ of a weekdays bar.
+ </div></div></dd><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">-foot (tag_name attr11 val1
+ attr2 val2 ...)</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ Assigns tag name and attributes to the XML foot element of the table (default: calfoot).
+ </div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top">
+ This option was added for completeness, but it's not implemented yet
+ </td></tr></table></div></div></dd></dl></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="calendar.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="calendar_package.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="help.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Calendar </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Resources - How to Get Help</td></tr></table></div></body></html>
Modified: tcl/rivet/trunk/doc/xml/calendar.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/calendar.xml?rev=960027&r1=960026&r2=960027&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/calendar.xml (original)
+++ tcl/rivet/trunk/doc/xml/calendar.xml Fri Jul 2 15:25:59 2010
@@ -3,41 +3,57 @@
<section>
<title>Introduction</title>
<para>
- Calendar is a set of three classes that produce Calendar tables
- in different forms: Calendar, XmlCalendar and HtmlCalendar.
- The base class Calendar outputs a calendar
- table (or a whole year calendar) in a similar form the typical
- Unix command does, but its internal code is based on Tcl only
- so that it doesn't rely on the existance of this utility on
- the system. This is also a base class from which the XmlCalendar
- class inherits the basics methods that generate the table.
- XmlCalendar prints an XML calendar table. Header, weekdays banner
- and week rows tags are configurable and also specific days or
+ The Calendar package is a set of three classes that produce
+ calendar tables in 2 different forms: Ascii calendar and XML
+ Calendar. The third class HtmlCalendar is a concrete descendant
+ of XmlCalendar that prints a calendar in xhtml form.
+ The ascii output from Calendar is formatted in the same form
+ the typical Unix <command>cal</command> command does. The internal
+ code is based on Tcl only therefore doesn't rely on the existance
+ of the 'cal' command on the system.
+ This is also a base class from which the XmlCalendar
+ class inherits the basic methods that generate the table.
+ XmlCalendar prints an XML calendar table whose header, weekdays banner
+ and week rows tags are configurable. Also specific days or
specific weeks can be given arbitrary attributes.
</para>
- <para>
- HtmlCalendar is a concrete class derived from XmlCalendar where
- tags are HTML tags and the output is ready for display.
- </para>
</section>
- <section>
- <title>Creating a Calendar instance</title>
- <variablelist>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <command>Calendar <arg>cal</arg></command>
- </cmdsynopsis>
- <para>
- The command creates an command object called <arg>cal</arg> ready
- to output a calendar table
- </para>
- <programlisting>set cal [Calendar #auto]</programlisting>
- <para>
- The method 'emit' if invoked without arguments returns an
- ASCII formatted calendar of the current month
- </para>
- <programlisting>
+ <refentry id="calendar">
+ <refnamediv>
+ <refname>Calendar</refname>
+ <refpurpose>Utility class the builds and prints a calendar table</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>Calendar</command>
+ <arg choice="plain"><replaceable>calendar_name</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Calendar object subcommands</title>
+ <para>
+ The main public command for a calendar object is <command>emit</command> that returns a calendar table
+ </para>
+ </refsect1>
+ <refsect1>
+ <variablelist>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>calendar_obj</command>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>calendar_obj</command> <arg>month</arg> <arg>year</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>calendar_obj</command> <arg><replaceable>month | year</replaceable></arg>
+ </cmdsynopsis>
+ <para>
+ The method 'emit' if invoked without arguments returns an
+ ASCII formatted calendar of the current month
+ </para>
+ <programlisting>
+set cal [Calendar #auto]
set current_month [$cal emit]
puts $current_month
Jun 2010
@@ -46,14 +62,124 @@ puts $current_month
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
- 27 28 29 30
-</programlisting>
+ 27 28 29 30</programlisting>
+ </listitem>
+ </varlistentry>
+ <para>
+ The method <command>emit</command> when invoked with a single argument
+ interprets this vale as a year number and prints the whole calendar of
+ that year. When invoked with 2 arguments takes the first as month, either
+ expressed in its shortened form ('Jan','Feb',...) or as number in the
+ range 1-12. The second argument is a year number.
+ </para>
+ </variablelist>
+ </refsect1>
+ </refentry>
+ <refentry id="xml_calendar">
+ <refnamediv>
+ <refname>XmlCalendar</refname>
+ <refpurpose>XmlCalendar returns XML formatted calendar tables</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>XmlCalendar</command>
+ <arg choice="plain"><replaceable>calendar_name</replaceable></arg>
+ <arg>-option1 <replaceable>value_1</replaceable></arg>
+ <arg>-option2 <replaceable>value_2</replaceable></arg>
+ <arg>...</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <para>
+ An XmlCalendar object is created and returned. This command object accepts many
+ customization options to specify the XML tags to be used in the structure of
+ the cal table.
+ </para>
+ <refsect2>
+ <title>Options</title>
+ <variablelist>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>-container options_list</command>
+ </cmdsynopsis>
+ <para>
+ Assigns the <command>options_list</command> to the XML root element that
+ will encompass the whole table.
+ </para>
+ <para>
+ An option list is organized as an odd-sized list of option:
+<programlisting>tag_name <option>attr11 val1 attr2 val2 ...</option></programlisting>
+ </para>
+ <para>
+ The first element of the list is the tag name that will assigned to the container
+ (default: calendar, no attributes). The remaining terms must be an even number and are
+ interpreted as attribute-value pairs
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>-header <group>tag_name <option>attr11 val1
+ attr2 val2 ...</option></group></command>
+ </cmdsynopsis>
+ <para>
+ Assigns tag name and attributes to the XML header element (default: calheader)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>-body <group>tag_name <option>attr11 val1
+ attr2 val2 ...</option></group></command>
+ </cmdsynopsis>
+ <para>
+ Assigns tag name and attributes to the XML body element of the table (default: calbody)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>-banner <group>tag_name <option>attr11 val1
+ attr2 val2 ...</option></group></command>
+ </cmdsynopsis>
+ <para>
+ Assigns tag name and attributes to the XML banner element of the table (default: monthyear)
+ </para>
+ <para>
+ The header of a calendar table is made of a banner, showing the Month and Year number, and
+ of a weekdays bar.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <command>-foot <group>tag_name <option>attr11 val1
+ attr2 val2 ...</option></group></command>
+ </cmdsynopsis>
+ <para>
+ Assigns tag name and attributes to the XML foot element of the table (default: calfoot).
+ </para>
+ <note>
+ This option was added for completeness, but it's not implemented yet
+ </note>
+ </listitem>
+ </varlistentry>
+
- </listitem>
- </varlistentry>
- <para>
-
- </para>
- </variablelist>
- </section>
+
+ </variablelist>
+ </refsect2>
+
+ </refsect1>
+ </refentry>
</section>
\ No newline at end of file
Modified: tcl/rivet/trunk/doc/xml/form.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/form.xml?rev=960027&r1=960026&r2=960027&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/form.xml (original)
+++ tcl/rivet/trunk/doc/xml/form.xml Fri Jul 2 15:25:59 2010
@@ -26,14 +26,10 @@
</para>
</section>
<refentry id="form_package">
+
<refnamediv>
<refname>form</refname>
- <refpurpose>
- <para>
- The <command>form</command> command creates a form object that can be manipulated
- to generate HTML forms.
- </para>
- </refpurpose>
+ <refpurpose> a Tcl command object for creating HTML forms</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
@@ -47,7 +43,6 @@
<refsect1>
<para>
creates and returns a new Tcl command named <replaceable>form_name</replaceable>.
- This command can be used to build the crate a form
</para>
<refsect2>
<title>Options</title>
@@ -60,7 +55,7 @@
<arg choice="opt">post|get</arg>
</cmdsynopsis>
<para>
- The method to be used to encode the form data.
+ The http method for sending the form data back to the server.
Possible values are get or post
</para>
<note>
@@ -92,8 +87,8 @@
a given field gets added to the form it is initialized with the
value of the corresponding variable in the array.
This option works well in conjuction with the
- <command>load_response</command> command of Rivet when default values
- come from another form.
+ <command>load_response</command> command of Rivet when default
+ values come from another form.
</para>
</listitem>
</varlistentry>
@@ -115,7 +110,10 @@
<refsect1>
<title>Form Object Commands</title>
<para>
- Form object commands follow the usual general syntax of Tcl commands:
+ Form object commands follow the usual syntax of Tcl commands with a <arg>subcommand</arg> argument playing the
+ role of a switch among various functionalities of the command. Form objects need also the parameter <arg>name</arg>
+ which is to become the value of the 'name' attribute in an input field. This argument is the key that has to be
+ used by the server-side script to retrieve the input field value.
</para>
<variablelist>
<varlistentry>
@@ -129,12 +127,17 @@
</listitem>
</varlistentry>
</variablelist>
- <para>
- Where <arg>name</arg> is to become the value of a 'name' attribute in the opening tag of a field
- or form. Options passed to a subcommand are copied into the tag as attribute="value" pairs.
+ <para>
+ Options passed to a subcommand are copied into the tag as attribute="value" pairs.
Some subcommand (e.g. form, radiobuttons and checkboxes) treat specific options in a way
that fits the specific organization and function of these fields.
</para>
+ <para>
+ Exception to this general syntax are the subcommand <command>field</command> and <command>end</command>.
+ <command>field</command> is an abstract input field creation method and requires an additional
+ parameter specifiyng the type of field being created. Every concrete input field generation command
+ uses this subcommand internally to get the html code printed.
+ </para>
</refsect1>
<refsect1>
@@ -153,22 +156,23 @@
<arg>args</arg>
</cmdsynopsis>
<para>
- Print the <form> tag with all of its arguments.
+ Print the <form> tag with all its attributes.
This command must be called as first in the form generation
process. The following is a sample of code creating a form named 'formname' whose data will
- be sent with menthod GET and initialized with data stored in array 'response'
+ be sent with method GET. Initial form fields values will be obtained from array
+ 'response'
</para>
<programlisting>
- form myform -defaults response -method get -name formname
- myform start
- myform text text_entry -size 20
- myform select option_selected -values {opt1 opt2 opt3 opt4}
- myform submit submit -value Search
- myform end</programlisting>
- <para>
- The code collects the input field values and send them through GET
- method to the same form URL for further processing. Use the <arg>-action</arg>
- switch to specify a different URL to process the data
+form myform -defaults response -method get -name formname
+myform start
+myform text text_entry -size 20
+myform select option_selected -values {opt1 opt2 opt3 opt4}
+myform submit submit -value Search
+myform end</programlisting>
+ <para>
+ The code prints a form that sends a text entry content and the option value
+ associated to a radiobutton. The URL of the server script is the same that
+ created the form. Use the <arg>-url</arg> option to specify a different url
</para>
</listitem>
</varlistentry>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org