cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: How to configure a producer
Date Thu, 17 Aug 2000 16:56:37 GMT
Robin Green wrote:
> 
> Ricardo Rocha <ricardo@apache.org> wrote:
> >Jochen Wiedmann wrote:
> > >
> > > Hi,
> > >
> > > how do I access the cocoon.properties from within a producer?
> > > Sorry, if this is something I should know, but I really didn't
> > > get it from reading the sources.
> >
> >Given:
> >
> >   public class MyProducer extends AbstractProducer
> >     String fileExtension = null;
> >     . . .
> >     public void init(Configurations conf)
> >       throws InitializationException {
> >       this.fileExtension =
> >         (String) conf.get("fileExtension");
> >     }
> >     . . .
> >   }
> >
> >your cocoon.properties should contain:
> >
> >   producer.type.xxx = MyProducer
> >   producer.xxx.fileExtension = html
> >
> >
> >Hope this helps,
> >
> >Ricardo
> 
> Er.... 'fraid that won't work.
> 
> public interface Producer extends Actor, Changeable
> {...}
> 
> public interface Actor
> {...}
> 
> public interface Changeable {...}
> 
> No mention of implementing Configurable. Producer should definitely
> implement Configurable, IMO.

Oops! Yes, a Producer _must_ implement Configurable for the above to
work:

  public class MyProducer
    extends AbstractProducer
    implements Configurable {
    . . .
  }

Other than this, the above example works: I copied it from a
working Producer :-))

Mime
View raw message