cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Morandini <>
Subject Re: Flowscript parameters access
Date Fri, 06 Mar 2009 17:43:03 GMT
Jose Luis Carmona wrote:
> I'm building a generator Who will be invoked from a flowscript Who pass 
> a JSONObject. I want to access to this JSONObject from the generator but 
> i don't know how to do that.
> In my flowscript I use
> cocoon.sendPage("foo", JSONObject);

More probably something like:
cocoon.sendPage("foo", {json: JSONObject});

> <map:match pattern="foo">
>    <map:generate type="fooGenerator"/>
>    <map:transform type="xmldb"/>
>    <map:serialize type="xml"/>
> </map:match>

Almost, let's reshuffle the generation stage a bit:
<map:generate type="fooGenerator">
   <map:parameter name="json" value="{flow-attr:json}"/>

> I think I have to access to the JSONObject from the method "configure" 
> inside my "fooGenerator".

Not quite: "configure" is used to set the component in the <generators> 
section of the sitemap, while "setup" is used to retrieve parameters 
specified in the pipeline (i.e. the generation stage).

To get "json" you have to search it in the "parameters" argument passed 
to the "setup" method of your generator.


    Luca Morandini

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message