cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [C2] Generator affecting future processing
Date Mon, 05 Mar 2001 05:05:02 GMT
Jason Foster wrote:
> 
> Is it possible for a Generator to change the processing chain at runtime?

No.  The Generator does not have any say in the processing chain.  That is
determined by the sitemap, which sets up a ResourcePipeline, and executes
the processing chain.

> When I was playing with the ScriptGenerator, I thought that it would be nice
> for the Generator to be also to do things like choose a skin using
> information from a database.

This would better be done by Actions.  Create an action that chose the skin
from a database by doing something along these lines:

<map:match uri="skinned/*.html">
  <map:act type="SkinChooser">
    <map:generator source="docs/{1}.xml"/>
    <map:transformer source="stylesheets/{skin}2html"/>
    <map:serializer/>
  </map:act>
</map:match>

> My bet is that a generator can create a new parameter, much like {1}, but
> nothing leapt to view.  Does anyone have any suggestions?

The Action object returns a Map.  The Map objects can be used in the sitemap
like the {skin} above.

> The problem with the simple solution proposed above is that some skins might
> require more than one transformation.  Can a Generator specify
> transformations in additional to those in the sitemap? Alternatively can a
> Generator bypass a transformation?

That would be the responsibility of the CodedSelector, responding to parameters
passed from a skin.  Remember this is Cocoon 2, and the Sitemap controls how
things are processed--not the Generator.

> I guess my question is how tightly coupled is Cocoon2 to the sitemap?  The
> sitemap seems much more static than a complex system (say a web-based
> e-journal that includes workflow capabilities) might require.  It certainly
> rocks for less crazily dynamic situations.

Cocoon 2 is pretty much coupled with the sitemap, but the sitemap is not as
static as you think.  Actions allow deviations in processing based on runtime
parameters.  You would be surprised at how flexible it really is.

Mime
View raw message