You can declare your Generator as Configurable [1], and pass the config file
to the component in the component definition.

You can then do whatever you want with the configuration information in the
configure() method.

See the LinkStatusGenerator for an example.

[1]
http://avalon.apache.org/framework/api/org/apache/avalon/framework/configura
tion/Configurable.html

> -----Original Message-----
> From: Christian Rosenberger [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 20, 2004 9:25 AM
> To: [EMAIL PROTECTED]
> Subject: Global parameters for custom generator
> 
> 
> Hello!
> 
> I have developed my custom generator and now i want to pass a 
> parameter to
> all generators of this type on the sitemap.
> 
> My idea would be to define a generator this way:
> 
> <map:generators default="file">
>    <map:generator name="mygen" src="de.myapp.MyGenerator" >   
>          
>       <parameter name="configfile" value="/opt/test/test.cfg"/>
>    </map:generator>
> </map:generators>
> 
> Can I do it this way? How can I access the value of my 
> parameter in my java
> class? I don't want to use the <map:parameter> tag, because I 
> would have to
> definie the tag in each <map:generate> element. Would not be 
> a nice solution
> in my point of view.
> 
> Thanks for your help in advance!
> 
> Regards,
> Christian
> 
> -- 
> NEU : GMX Internet.FreeDSL
> Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or 
its affiliates (which may be known outside the United States as Merck Frosst, Merck 
Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary 
copyrighted and/or legally privileged. It is intended solely for the use of the 
individual or entity named on this message.  If you are not the intended recipient, 
and have received this message in error, please notify us immediately by reply e-mail 
and then delete it from your system.
------------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to