You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2004/10/25 23:36:13 UTC

Howto drive response payload directly

Hi,

I have a Java object persisted using Hibernate... it contains an image 
(java.sql.Blob) that I need to serve.  I can get the object in 
flowscript, now I just need to stream out this data (e.g. 
"image.getBinaryStream()").  How can I do this?

Thanks,
~ml

Re: pass a variable from flowscript into cfrom text input field

Posted by Nacho Jimenez <na...@ya.com>.
Philipp Rech wrote:

>Hello,
>
>how can i pass a variable from my flowscript into cfrom text input field (as
>a default value)? In the Flow it would be like 
>
>var name = "stefano";
>
>and the CForm would be 
>
><fd:widgets>
>    <fd:field id="name" required="true">
>      <fd:label>Name:</fd:label>
>      <fd:datatype base="string"/>
>     </fd:field>
>
>So when the user opens the page, "stefano" is written in the field. The
>value has to come from the Flowscript that call the form and display
>pipeline though! a simple document.form.name.value = name; wont work, eh?
>  
>
Be careful there.. document.form.name.value is Javascript as you would 
write it on the page so the browser executes it, in flowscript we are 
not working with any object document.

If you're using cforms try:

    yourForm.lookupWidget("name").value="Steffano"

In woody i believe it was something like:

    yourForm.getWidget("name").value="Steffano"

where yourForm is your cform/woody object..


>Thank you very much! Danke!
>phil
>
>
>
>---------------------------------------------------------------------
>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: pass a variable from flowscript into cfrom text input field

Posted by Gunter D'Hondt <gu...@sofico.be>.
Widget nameWidget = form.getWidget("name");
nameWidget.setValu(name);
Gunter




"Philipp Rech" <ph...@gmx.de> 
26-10-2004 11:29
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
pass a variable from flowscript into cfrom text input field






Hello,

how can i pass a variable from my flowscript into cfrom text input field 
(as
a default value)? In the Flow it would be like 

var name = "stefano";

and the CForm would be 

<fd:widgets>
    <fd:field id="name" required="true">
      <fd:label>Name:</fd:label>
      <fd:datatype base="string"/>
     </fd:field>

So when the user opens the page, "stefano" is written in the field. The
value has to come from the Flowscript that call the form and display
pipeline though! a simple document.form.name.value = name; wont work, eh?

Thank you very much! Danke!
phil



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



pass a variable from flowscript into cfrom text input field

Posted by Philipp Rech <ph...@gmx.de>.
Hello,

how can i pass a variable from my flowscript into cfrom text input field (as
a default value)? In the Flow it would be like 

var name = "stefano";

and the CForm would be 

<fd:widgets>
    <fd:field id="name" required="true">
      <fd:label>Name:</fd:label>
      <fd:datatype base="string"/>
     </fd:field>

So when the user opens the page, "stefano" is written in the field. The
value has to come from the Flowscript that call the form and display
pipeline though! a simple document.form.name.value = name; wont work, eh?

Thank you very much! Danke!
phil



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


Re: Howto drive response payload directly

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Oct 26, 2004, at 3:46 AM, Vadim Gritsenko wrote:

> Ugo Cei wrote:
>> Il giorno 26/ott/04, alle 08:54, Leszek Gawron ha scritto:
>>> Mark Lundquist wrote:
>>>
>>>> Hi,
>>>> I have a Java object persisted using Hibernate... it contains an 
>>>> image (java.sql.Blob) that I need to serve. I can get the object in 
>>>> flowscript, now I just need to stream out this data (e.g. 
>>>> "image.getBinaryStream()"). How can I do this?
>>>> Thanks,
>>>> /~ml
>>>> /
>>>
>>> I think you should implement a Reader or a new Source.
>> A Reader is the way to go.
>
> Existing ResourceReader and one of the existing sources reading data 
> from request attribute should work just fine in ths case. Probably, 
> flow attribute input module.
>
> Vadim\

Thx Vadim (and also Ugo for bringing this over from the users' list)... 
  I will check into this!
~ml


Re: Howto drive response payload directly

Posted by Vadim Gritsenko <vg...@apache.org>.
Ugo Cei wrote:
> Il giorno 26/ott/04, alle 08:54, Leszek Gawron ha scritto:
> 
>> Mark Lundquist wrote:
>>
>>> Hi,
>>> I have a Java object persisted using Hibernate... it contains an 
>>> image (java.sql.Blob) that I need to serve. I can get the object in 
>>> flowscript, now I just need to stream out this data (e.g. 
>>> "image.getBinaryStream()"). How can I do this?
>>> Thanks,
>>> /~ml
>>> /
>>
>> I think you should implement a Reader or a new Source.
> 
> 
> A Reader is the way to go.

Existing ResourceReader and one of the existing sources reading data from 
request attribute should work just fine in ths case. Probably, flow attribute 
input module.

Vadim

Re: Howto drive response payload directly

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 26/ott/04, alle 08:54, Leszek Gawron ha scritto:

> Mark Lundquist wrote:
>> Hi,
>> I have a Java object persisted using Hibernate... it contains an 
>> image (java.sql.Blob) that I need to serve. I can get the object in 
>> flowscript, now I just need to stream out this data (e.g. 
>> "image.getBinaryStream()"). How can I do this?
>> Thanks,
>> /~ml
>> /
> I think you should implement a Reader or a new Source.

A Reader is the way to go. Which is a PITA, since it would be much 
nicer if we could have a method in the "cocoon" object that would take 
a byte array or an InputStream and serve a binary response directly 
without going through another pipeline.

I'm redirecting this to the dev- list to see if other developers have 
any thoughts about this.

	Ugo

-- 
Ugo Cei - http://beblogging.com/

Re: Howto drive response payload directly

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 26/ott/04, alle 08:54, Leszek Gawron ha scritto:

> Mark Lundquist wrote:
>> Hi,
>> I have a Java object persisted using Hibernate... it contains an 
>> image (java.sql.Blob) that I need to serve. I can get the object in 
>> flowscript, now I just need to stream out this data (e.g. 
>> "image.getBinaryStream()"). How can I do this?
>> Thanks,
>> /~ml
>> /
> I think you should implement a Reader or a new Source.

A Reader is the way to go. Which is a PITA, since it would be much 
nicer if we could have a method in the "cocoon" object that would take 
a byte array or an InputStream and serve a binary response directly 
without going through another pipeline.

I'm redirecting this to the dev- list to see if other developers have 
any thoughts about this.

	Ugo

-- 
Ugo Cei - http://beblogging.com/

Re: Howto drive response payload directly

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Mark Lundquist wrote:
> Hi,
> 
> I have a Java object persisted using Hibernate... it contains an image 
> (java.sql.Blob) that I need to serve. I can get the object in 
> flowscript, now I just need to stream out this data (e.g. 
> "image.getBinaryStream()"). How can I do this?
> 
> Thanks,
> /~ml
> /
I think you should implement a Reader or a new Source.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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