cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <>
Subject Re: [C2] Allowing actions to select transformer type
Date Mon, 30 Apr 2001 20:47:13 GMT

On Mon, 30 Apr 2001, Leo Sutic wrote:

> All,
> I would like to be able to let the action that runs before the pipeline is
> executed to select the type of transformer to be used:
>   <map:pipeline>
>    <map:match pattern="testpage.html">
>     <map:act type="action">
>      <map:generate type="testgenerator"/>
>      <map:transform type="{transformer}" src="{stylesheet}"/>
>      <map:serialize type="html"/>
>     </map:act>
>    </map:match>
>   </map:pipeline>
> Currently, substitution is only done for the src attribute of
> <map:transform/>, and not for the type attribute, which causes Cocoon to
> crash, as the transformer selector can't find a suitable transformer for the
> hint "{transformer}".


> I'm sure the same effect can be achieved via a selector that tests on
> sitemap parameters, however: Since the substitution model is used for the
> sitemap parameters set by actions everywhere else, it would be more
> consistent to substitute the type attribute as well.

Carefull! While one could argument it would be consistent syntactically
I say it doesn't make sense semantically. The type attribute is meant as
an idref for a component not a resource or an arbitrary value.

Of course it is Cocoons job to select from thousands of resources in one
pipeline but it smells like FS (Flexibility Syndrom) to select among a
few component only because it is doable.

I see this as a hidden Reactor Pattern which has proven to be dangerous
because it forces distribution of control, which creates too many
contracts between the different contexts. Result: increase of management

I still like the old pyramid model of site management. It forces a
better separation between the working contexts (content, style and
logic) and the management context.

And for those reasons I'm -1 on substitution in type attributes


> I'd like to hear some opinions about this before submitting a patch for
> review. (Most of all, it would be nice to hear that this is already possible
> in a much easier way than I know of. :-))
> The possible patches I see are:
> 0) No patch, this is already possible.
> 1) Change lines 1197, 1213, 1218 of
> xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/sit
> emap.xsl. This is the way I'd like to do it.
> 2) Create a new selector that tests on sitemap parameters.
> /LS
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message