You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Aurélien DEHAY <ad...@zorel.org> on 2005/09/15 12:40:00 UTC

i18n, date & binding framework.

Hi all.

I'm trying to i18n the date in a form. I've got no problem for
displaying the i18nized date, but I wonder how I could, when the client
edit the form, display him a correct date.

I've got:
<fd:convertor type="formatting" variant="date" style="short">
   <fd:patterns>
      <fd:pattern>MM/dd/yyyy</fd:pattern>
      <fd:pattern locale="fr">dd-MM-yyyy</fd:pattern>
   </fd:patterns>
</fd:convertor>

in my form_definition.xml file and
<fd:convertor type="formatting" datatype="date">
   <fd:patterns>
      <fd:pattern>MM/dd/yyyy</fd:pattern>
   </fd:patterns>
</fd:convertor>

in my form_binding.xml file, but the behaviour is really strange. I
think I've missed something.

Can someome give me the trick? Regards.
-- 
Aurélien DEHAY

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


Re: i18n, date & binding framework.

Posted by Aurélien DEHAY <ad...@zorel.org>.
Thomas Lutz a écrit :
> Aurélien DEHAY wrote:
> 
>> Hi.
>>
>> Thomas Lutz a écrit :
>>  
>>
>>> What exactly does not work ?
>>>   
>>
>>
>> The displayed date & the date in the input field are not consistant.
>>
>> For example I'd like, in en locale, the following behaviour: the client
>> enter 01/13/2000 in the forms. When displaying in en locale =>
>> 01/13/2000, and when displaying in fr locale => 13/01/2000.
>>  
>>
> ok, this sounds familiar :-).
> 
> looks like your form takes the hosts locale...
> 
> have a look at
> 
> http://www.mail-archive.com/dev@cocoon.apache.org/msg33411.html
> 
> i use javaflow and had to add two constructors to FormInstance.java to
> pass the user agents locale. If you use JavaScript as flow engine
> Leszek's first answer will do it.
> 

Hmmmmm... I was hoping Cocoon/Cforms/i18n could handle that with no
modification of my flows. Thank you for the answer.

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


Re: i18n, date & binding framework.

Posted by Thomas Lutz <ma...@gmx.at>.
Aurélien DEHAY wrote:

>Hi.
>
>Thomas Lutz a écrit :
>  
>
>>What exactly does not work ?
>>    
>>
>
>The displayed date & the date in the input field are not consistant.
>
>For example I'd like, in en locale, the following behaviour: the client
>enter 01/13/2000 in the forms. When displaying in en locale =>
>01/13/2000, and when displaying in fr locale => 13/01/2000.
>  
>
ok, this sounds familiar :-).

looks like your form takes the hosts locale...

have a look at

http://www.mail-archive.com/dev@cocoon.apache.org/msg33411.html

i use javaflow and had to add two constructors to FormInstance.java to 
pass the user agents locale. If you use JavaScript as flow engine 
Leszek's first answer will do it.

HTH,
tom

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


RE: Need advice on post-request

Posted by Andreas Busch <An...@ilogics.de>.
Can work, if I record the saxStream and put it parallel into the pipeline!
I have to research (Havy Framework, need havy time :-)) 
What is TeeTransformer ? 

-- Andreas


-----Original Message-----
From: Joose Vettenranta [mailto:joose@iki.fi] 
Sent: Thursday, September 15, 2005 2:25 PM
To: users@cocoon.apache.org
Subject: Re: Need advice on post-request

how about like this:

streamgenerator
YourOwnTransformer  <<---
processing...
serialize

and yourowntransformer could be a fork from TeeTransformer where you just
modfiy it to save data to DB instead of the filesystem.

- Joose

Andreas Busch kirjoitti 15.9.2005 kello 15:00:

>  Hi gurus,
> I have a problem to solve.
> I get a XML-File as http-post into the pipeline.
> Generate the pipe with stream-generator and do the processing.
>
> BUT: I need to store the hole XML into the database (CLOB Oracle) And 
> have no solution.
>
>  tryed : use an action and store the Inputstream into CLOB ..  
> Works , but Streamgenerator see no more this Inputstream
>
> I had a look on the stream-generator and belive that the same happens 
> when I read the stream for inserting in database
>
> Do i miss something (rewinding stream) Any Advice ?

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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



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


Re: Need advice on post-request

Posted by Joose Vettenranta <jo...@iki.fi>.
how about like this:

streamgenerator
YourOwnTransformer  <<---
processing...
serialize

and yourowntransformer could be a fork from TeeTransformer where you  
just modfiy it to save data to DB instead of the filesystem.

- Joose

Andreas Busch kirjoitti 15.9.2005 kello 15:00:

>  Hi gurus,
> I have a problem to solve.
> I get a XML-File as http-post into the pipeline.
> Generate the pipe with stream-generator and do the processing.
>
> BUT: I need to store the hole XML into the database (CLOB Oracle)
> And have no solution.
>
>  tryed : use an action and store the Inputstream into CLOB ..  
> Works , but Streamgenerator see no more this Inputstream
>
> I had a look on the stream-generator and belive that the same  
> happens when I read the stream for inserting in database
>
> Do i miss something (rewinding stream)
> Any Advice ?

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Need advice on post-request

Posted by Andreas Busch <An...@ilogics.de>.
 Hi gurus,
I have a problem to solve.
I get a XML-File as http-post into the pipeline.
Generate the pipe with stream-generator and do the processing.

BUT: I need to store the hole XML into the database (CLOB Oracle)
And have no solution.

 tryed : use an action and store the Inputstream into CLOB .. Works , but Streamgenerator see no more this Inputstream

I had a look on the stream-generator and belive that the same happens when I read the stream for inserting in database 

Do i miss something (rewinding stream)
Any Advice ?

Thanks a million

Andreas Busch
ILOGICS GmbH ∙ Berduxstr. 22 ∙ D-81245 München
Andreas.Busch@ilogics.de
Tel: +49 89 896667-0
Fax: +49 89 896667-29
www.ilogics.de





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


Re: i18n, date & binding framework.

Posted by Aurélien DEHAY <ad...@zorel.org>.
Hi.

Thomas Lutz a écrit :
> What exactly does not work ?

The displayed date & the date in the input field are not consistant.

For example I'd like, in en locale, the following behaviour: the client
enter 01/13/2000 in the forms. When displaying in en locale =>
01/13/2000, and when displaying in fr locale => 13/01/2000.

> 
> I had problems with forms, dates and i18n, too.
> 
> With some debugging I figured out that the form engine took the hosts
> locale as default, so no matter which locale I set in the browser, the
> date formatter always took the hosts locale, so setting the locale for
> the form instance with the user agents locale in flow (javaflow in my
> case) did the job in my application.
> 


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


Re: i18n, date & binding framework.

Posted by Thomas Lutz <ma...@gmx.at>.
What exactly does not work ?

I had problems with forms, dates and i18n, too.

With some debugging I figured out that the form engine took the hosts 
locale as default, so no matter which locale I set in the browser, the 
date formatter always took the hosts locale, so setting the locale for 
the form instance with the user agents locale in flow (javaflow in my 
case) did the job in my application.

regards,
tom

Aurélien DEHAY wrote:

>Hi all.
>
>I'm trying to i18n the date in a form. I've got no problem for
>displaying the i18nized date, but I wonder how I could, when the client
>edit the form, display him a correct date.
>
>I've got:
><fd:convertor type="formatting" variant="date" style="short">
>   <fd:patterns>
>      <fd:pattern>MM/dd/yyyy</fd:pattern>
>      <fd:pattern locale="fr">dd-MM-yyyy</fd:pattern>
>   </fd:patterns>
></fd:convertor>
>
>in my form_definition.xml file and
><fd:convertor type="formatting" datatype="date">
>   <fd:patterns>
>      <fd:pattern>MM/dd/yyyy</fd:pattern>
>   </fd:patterns>
></fd:convertor>
>
>in my form_binding.xml file, but the behaviour is really strange. I
>think I've missed something.
>
>Can someome give me the trick? Regards.
>  
>


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