cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Producers
Date Mon, 06 Dec 1999 21:53:57 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.

> 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.

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.

- donald


Mime
View raw message