You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gerry Kaplan <gk...@prolifics.com> on 2004/10/27 15:30:04 UTC

DateInputModule

I am trying to create a sitemap that, after validating a form, will add the
fields to a MySQL database. The database definitions are as follows:

<root>
   <connection>imweb</connection>
 
   <table name="reports" alias="reports">
      <keys>
         <key name="ReportId" type="int" autoincrement="true">
            <mode name="auto"  type="autoincr"/>
         </key>
      </keys>
      <values>
         <value name="UserId"  type="string"></value>
            <mode name="session-attr" type="all">
               <parameter>userId</parameter>
            </mode>
         <value name="ReportRef" type="string"></value>
         <value name="PatName"  type="string"></value>
         <value name="CreationDate" type="time-stamp"></value>
         <value name="ModifiedDate" type="time-stamp"></value>
         <value name="ExamDate"  type="date"></value>
         <value name="ReportXML" type="blob"></value>
      </values>   
   </table>
 
   <table-set name="add-report">
      <table name="reports"/>
   </table-set>
</root>

2 questions:

1. How can I populate "CreationDate" and "ModifiedDate" with the current
datetime (timestamp). I cannot find a good example of how to use the
DateInputModule with a database.

2. In the above example, I have specified the "mode" tag on the UserId
value. Is it possible that this be placed in the table-set instead of the
table definition?

Thanks in advance!

Gerry


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org