cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Taube" <andreta...@attbi.com>
Subject RE: MySQL date conversion with modular database action
Date Tue, 18 Feb 2003 16:41:51 GMT
I am running the latest cocoon that I got from the CVS.

My table descriptor is

        <table name="pcm_contract" alias="pcm_contract">
                <keys>
                        <key name="id" type="int" autoincrement="true">
                                <mode name="auto" type="autoincr"/>
                        </key>
                </keys>

                <values>
                        <value name="contract_name"
type="string"></value>
                        <value name="contract_type"     type="int"></value>
                        <value name="contract_code"
type="string"></value>
                        <value name="job_number"
type="string"></value>
                        <value name="misc_code"
type="string"></value>
                        <value name="start_date"        type="date">
                                <mode name="datemeta"   type="attribute">
                                        <!-- pass the following as attribute
name to the nested module -->

<parameter>pcm_contract.start_date</parameter>
                                        <!-- use the request parameter
module to obtain the string -->
                                        <input-module name="request-param"
format="MM/dd/yyyy">
                           </mode>
                        </value>
                        <value name="end_date"          type="date">
                                <mode name="datemeta" type="attribute">
                                        <!-- pass the following as attribute
name to the nested module -->

<parameter>pcm_contract.end_date</parameter>
                                        <!-- use the request parameter
module to obtain the string -->
                                        <input-module name="request-param"
format="MM/dd/yyyy"/>
                           </mode>
                        </value>
                        <value name="contract_status"   type="int"></value>
                </values>
        </table>


And my logs only show:

DEBUG   (2003-02-18) 09:24.53:804   [sitemap]
(/pcm1/contract_admin.contract.html) Thread-26/DefaultComponentFactory:
ComponentFactory creating new instance of
org.apache.cocoon.acting.modular.DatabaseUpdateAction.
DEBUG   (2003-02-18) 09:24.53:805   [sitemap]
(/pcm1/contract_admin.contract.html) Thread-26/DefaultComponentFactory:
logger attribute is sitemap.action.DatabaseUpdateAction
DEBUG   (2003-02-18) 09:24.53:807   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html)
Thread-26/AbstractComplementaryConfigurableAction: Using cached
configuration for contract_admin/contract_descriptor.xml
DEBUG   (2003-02-18) 09:24.53:823   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: modeTypes :
{2=request-attr, 1=others, 0=autoincr}
DEBUG   (2003-02-18) 09:24.53:843   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=0
DEBUG   (2003-02-18) 09:24.53:845   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=1
DEBUG   (2003-02-18) 09:24.53:846   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=2
DEBUG   (2003-02-18) 09:24.53:847   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=3
DEBUG   (2003-02-18) 09:24.53:848   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=4
DEBUG   (2003-02-18) 09:24.53:849   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=5
DEBUG   (2003-02-18) 09:24.53:851   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=6
DEBUG   (2003-02-18) 09:24.53:852   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=7
DEBUG   (2003-02-18) 09:24.53:853   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: i=8
DEBUG   (2003-02-18) 09:24.53:855   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: query: UPDATE
pcm_contract SET contract_name= ?, contract_type= ?, contract_code= ?,
job_number= ?, misc_code= ?, start_date= ?, end_date= ?, contract_status= ?
WHERE id= ?
DEBUG   (2003-02-18) 09:24.53:857   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.id from request-param using getAttribute method
DEBUG   (2003-02-18) 09:24.53:859   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.id [0] 19
DEBUG   (2003-02-18) 09:24.53:860   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.contract_name from request-param using getAttribute
method
DEBUG   (2003-02-18) 09:24.53:861   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_name [0] Date Test
DEBUG   (2003-02-18) 09:24.53:862   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.contract_type from request-param using getAttribute
method
DEBUG   (2003-02-18) 09:24.53:863   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_type [0] 1
DEBUG   (2003-02-18) 09:24.53:864   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.contract_code from request-param using getAttribute
method
DEBUG   (2003-02-18) 09:24.53:865   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_code [0] TEMP 123
DEBUG   (2003-02-18) 09:24.53:866   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.job_number from request-param using getAttribute method
DEBUG   (2003-02-18) 09:24.53:867   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.job_number [0]
DEBUG   (2003-02-18) 09:24.53:868   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.misc_code from request-param using getAttribute method
DEBUG   (2003-02-18) 09:24.53:869   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.misc_code [0]
DEBUG   (2003-02-18) 09:24.53:870   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.start_date from request-param using getAttribute method
DEBUG   (2003-02-18) 09:24.53:871   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.start_date [0] 2/9/2003
DEBUG   (2003-02-18) 09:24.53:872   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.end_date from request-param using getAttribute method
DEBUG   (2003-02-18) 09:24.53:873   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.end_date [0] 2/9/2003
DEBUG   (2003-02-18) 09:24.53:874   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Trying to set
column pcm_contract.contract_status from request-param using getAttribute
method
DEBUG   (2003-02-18) 09:24.53:875   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_status [0] 1
DEBUG   (2003-02-18) 09:24.53:876   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: ====> row no.
0
DEBUG   (2003-02-18) 09:24.53:877   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_name[0] to Date Test
DEBUG   (2003-02-18) 09:24.53:919   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_type[0] to 1
DEBUG   (2003-02-18) 09:24.53:922   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.contract_code[0] to TEMP 123
DEBUG   (2003-02-18) 09:24.53:928   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.job_number[0] to
DEBUG   (2003-02-18) 09:24.53:930   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.misc_code[0] to
DEBUG   (2003-02-18) 09:24.53:932   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Setting
column pcm_contract.start_date[0] to 2/9/2003
DEBUG   (2003-02-18) 09:24.53:940   [sitemap.action.DatabaseUpdateAction]
(/pcm1/contract_admin.contract.html) Thread-26/DatabaseAction: Rolling back
transaction. Caused by null
DEBUG   (2003-02-18) 09:24.53:975   [sitemap]
(/pcm1/contract_admin.contract.html) Thread-26/DefaultComponentFactory:
ComponentFactory decommissioning instance of
org.apache.cocoon.acting.modular.DatabaseUpdateAction.


Thanks!!!

> -----Original Message-----
> From: Christian Haul [mailto:haul@informatik.tu-darmstadt.de]
> Sent: Tuesday, February 18, 2003 3:18 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: MySQL date conversion with modular database action
>
>
> Andre Taube wrote:
> > Thanks, that's exactly what I need.  However, my date is in MM/dd/YYYY
> > format, how could I pass a format string to the
> DateMetaInputModule?  API
> > says: "Configuration options: child element "input-module"
> holds InputModule
> > to obtain the string from, attribute "format" to "input-module"
> that holds a
> > java.text.SimpleDateFormat format string"
> >
> > but the following does not work for me:
> >
> > <value name="start_date" type="date">
> >    <!-- if "attrib" is requested, convert string to a Date using the
> >         date conversion module -->
> >    <mode name="datemeta" type="attrib">
> >       <!-- pass the following as attribute name to the nested module -->
> >       <parameter>start_date</parameter>
>          <format>MM/dd/YYYY</format>
> >       <!-- use the request parameter module to obtain the string -->
>          <input-module name="request-param"/>
> >    </mode>
> > </value>
>
> If this doesn't work, make sure that a) you are running a recent
> snapshot (either branch) and b) include complete file (i.e. table-set)
> and logs showing invokation of your action.
>
> 	Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>      fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message