cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric SCHAEFFER" <eschaef...@posterconseil.com>
Subject Re: Cocoon Questions...
Date Tue, 08 Feb 2000 16:06:20 GMT
I tried this to configure my producer, and I found that you need to specify
the producer nickname in the init function...
(I use Cocoon 1.6.1)

(in "file" producer)
  public void init(Configurations conf) {
    String binary = (String) conf.get("file.binary");
    ...
  }


Eric.

_______________________________________

Eric SCHAEFFER
eschaeffer@posterconseil.com

POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________

----------------------------------------------------------------------------
-----------------------------
 Come to the first official Apache Software Foundation Conference!
-----------------------------------
http://ApacheCon.Com ------------------------------------

----- Original Message -----
From: Stefano Mazzocchi <stefano@apache.org>
To: <cocoon-users@xml.apache.org>
Sent: Tuesday, February 01, 2000 12:05 AM
Subject: Re: Cocoon Questions...


> Mike Engelhart wrote:
> >
> > Ricky Szeto wrote:
> >
> > > Maybe I need to clarify my first question a bit...
> > > I need to pass arguments to the producers only once regarding
initialization
> > > and configuration(ie where the properties file is, where a resource
directory
> > > is.. etc)
> > > I would like to do it such that it is done automatically after the
> > > instantiation of the Producer(before it begins service).
> > >
> > > As for the response obj, looks like I do more reading before I can
decide
> > > which is the best way to go...
> > Sorry about that.  I misunderstood.  hmmm.... have your tried overriding
> > init()? I"m not sure I understand where in the chain of events you need
to
> > initialize the Producer? I mean isn't it potentially created each time
it is
> > accessed, that is if it's not in the cache somewhere?  I don't really
know
>
> Make your producer implement Configurable.
>
> Then write your configurations in cocoon.properties such as
>
> producer.xxx.yyy = zzz
>
> where
>
>  xxx is the nickname of the producer (for example, "file")
>  yyy is the property you want (for example, "binary")
>  zzz is the value (for example. "false)
>
> so
>
>  producer.file.binary="false"
>
> then in your code you write
>
>  public void init(Configurations conf) {
>    String binary = (String) conf.get("binary");
>    ...
>  }
>
> NOTE: Cocoon will take care of removing the front stuff from your
> configuration keys, so that if you change the nickname of your producer,
> your code doesn't change (separation of contexts all over the place :)
>
> All the cocoon modules work that way.
>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <stefano@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>  Come to the first official Apache Software Foundation Conference!
> ------------------------- http://ApacheCon.Com ---------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Mime
View raw message