You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Tuomo L <tl...@cc.hut.fi> on 2004/04/16 11:49:29 UTC

Custom generators and configuration parameters

Hi all,

Is it possible to provide configuration parameters in sitemap for
generators? Like this:

<map:generator name="my-generator src="MyGenerator">
  <some-parameter>foobar</some-parameter>
</map:generator>

This is possible for at least transformers and actions.

If so, how do I read those parameters in the code?

-Tuomo


Re: AW: Custom generators and configuration parameters

Posted by Tuomo L <tl...@cc.hut.fi>.
Thanks a lot! I'll give it a try.

-Tuomo

On Fri, 16 Apr 2004, Marco Rolappe wrote:

> hi tuomo,
>
> implement avalon's Configurable interface. you'll then be provided with a
> Configuration object.
>
> in your example you'd get some-parameter's value like this:
>
> ...
> 	someParam = config.getChild("some-parameter").getValue();
> ...
>
>
> > -----Ursprungliche Nachricht-----
> > Von: dev-return-59505-m_rolappe=web.de@cocoon.apache.org
> > [mailto:dev-return-59505-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> > von Tuomo L
> > Gesendet: Freitag, 16. April 2004 11:49
> > An: dev@cocoon.apache.org
> > Betreff: Custom generators and configuration parameters
> >
> >
> > Hi all,
> >
> > Is it possible to provide configuration parameters in sitemap for
> > generators? Like this:
> >
> > <map:generator name="my-generator src="MyGenerator">
> >   <some-parameter>foobar</some-parameter>
> > </map:generator>
> >
> > This is possible for at least transformers and actions.
> >
> > If so, how do I read those parameters in the code?
> >
> > -Tuomo
> >
>
>

AW: Custom generators and configuration parameters

Posted by Marco Rolappe <m_...@web.de>.
hi tuomo,

implement avalon's Configurable interface. you'll then be provided with a
Configuration object.

in your example you'd get some-parameter's value like this:

...
	someParam = config.getChild("some-parameter").getValue();
...


> -----Ursprungliche Nachricht-----
> Von: dev-return-59505-m_rolappe=web.de@cocoon.apache.org
> [mailto:dev-return-59505-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> von Tuomo L
> Gesendet: Freitag, 16. April 2004 11:49
> An: dev@cocoon.apache.org
> Betreff: Custom generators and configuration parameters
>
>
> Hi all,
>
> Is it possible to provide configuration parameters in sitemap for
> generators? Like this:
>
> <map:generator name="my-generator src="MyGenerator">
>   <some-parameter>foobar</some-parameter>
> </map:generator>
>
> This is possible for at least transformers and actions.
>
> If so, how do I read those parameters in the code?
>
> -Tuomo
>