cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett McLaughlin" <bmcla...@algx.net>
Subject Re: Producers
Date Mon, 06 Dec 1999 22:00:06 GMT
> On Mon, 6 Dec 1999, Brett McLaughlin wrote:
>
> > I can't say that I have a firm grasp on Producers.  I am not new to XML,
but
> > am to Cocoon somewhat.  I am also spending most of my days on Turbine
and
> > other frameworks, so you may have to help me twist my brain around the
> > different response/request model.  Could someone give me a _short_
overview
> > of producers, just enough to get me going?
>
> Sure. A producer creates an XML document, currently in the form of a DOM
> object, in response to an HTTP request. Note that sometime in the future
> this will probably switch to generating SAX events instead, but you get
> the picture.

Yup, it will be nice when it goes all SAX... so much easier for FOP and such
big documents...

>
> > I looked at DummyProducer, and the xml.apache.org docs, and they talk
about
> > how to write producers, etc., but there is little about the details of
how
> > to incorporate one into a real practical situation.  That's what I'm
looking
> > for more than anything.
>
> I find Processors much more useful. A processor creates an XML document,
> currently in the form of a DOM object, in response to an HTTP request
> _and_ an XML document. That is to say, it takes in an XML document, and
> returns an XML document (possibly the same one that came in with some
> modifications). Only _one_ producer can act on a request but multiple
> processors can act. Also, producers in general must be configured through
> HTTP parameters, while processors can use the HTTP parameters _and_
> the input XML document for configuration purposes.

So why would you ever use producers instead of processors?

>
> Take a look at the SQLProcessor code. It doesn't suck too badly and it's
> fairly coherent. I've also got a MapProducer that uses a site map file to
> determine which XML to read initially instead of using the standard
> FileProducer mapping if you really want a Producer code example to play
> with.

Thanks.  I'm sure there will be more questions to come... i'll do work in
return, though, i promise ;-)

-Brett

>
> - donald
>
>


Mime
View raw message