cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Morandini <lmorand...@ieee.org>
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}"/>
</map:generate>


> 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.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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


Mime
View raw message