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 22:24:24 GMT
On Mon, 6 Dec 1999, Brett McLaughlin wrote:

> > >
> > > So why would you ever use producers instead of processors?
> >
> > Because you have to have _some_ method of creating an XML document
> > initially, right? FileProducer works for most instances, but some people
> > want their initial XML file to come from a remote server (URLProducer),
> > some people want their initial XML file to come from a SQL query
> > (DatabaseProducer, though I still think this is better handled by
> > SQLProcessor ;)), some people want to have a more configurable mapping of
> > request->file than is offered by FileProducer (MapProducer), etc.
> 
> OK, so that makes sense.  So I can create a producer, and that would do all
> my logic, act as my controller for business stuff.  Then at the end I have
> some XML document that I have created, and I want to have it transformed,
> etc.  So I want to return that from getStream(), and then it goes....? here
> is where I get confused.  How can I make that then undergo XSLT?  or
> anything else for that matter?

After the XML document is created by the Producer, it's passed to cocoon's
reactor. The reactor looks through the document for <?cocoon-process?> PIs
and if it finds one, it invoked the processor indicated by the type
attribute. After processing, it repeats the cycle until no more
<?cocoon-process?> PI's are found. This reactor pattern is likely to
change with the advent of the sitemap, but despite one naive suggestion,
no work has been forthcoming on this (nudge, nudge).

- donald


Mime
View raw message