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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to