cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Sitemap Transformations
Date Wed, 05 Jun 2002 12:41:30 GMT
Jason Foster wrote:
> What is the feeling on the list regarding having a special pipeline that is
> use to transform the sitemap before it is interpreted?


Sorry, I have a special alarm tuned exactly for that and it went on :)

> My goal is to allow for customizations to the sitemap without having to
> create new components.  Here's my use case:
> Consider a situation where an image file could exist in one or more of:
>    - /site/images/
>    - /site/user/images/
>    - /site/user/subsite/images/
> I'd like to be able to set up a single pipeline that will check these 3
> locations in turn, looking for the file.  Assuming that a new action called
> "FileNotExistsAction" exists, the appropriate way would be:
>    <map:act type="file-not-exists">
>      <map:parameter name="filename" value="{0}"/>
>      <map:parameter name="prefix" value="/site/images/"/>
>      <map:act type="file-not-exists">
>        <map:parameter name="filename" value="{../0}"/>
>        <map:parameter name="prefix" value="/site/user/images/"/>
>        <map:act type="file-not-exists">
>          <map:parameter name="filename" value="{../0}"/>
>          <map:parameter name="prefix" value="/site/user/subsite/images/"/>
>          <map:read src="missing-image.png"/>
>        </map:act>
>        <map:read src="/site/user/subsite/images/{0}"/>
>      </map:act>
>      <map:read src="/site/user/images/{0}"/>
>    </map:act>
>    <map:read src="/site/images/{0}"/>
> Actually, this won't even work.  But you get the idea.  Anyways, it would
> be nice if I could say:
>    <extension:fallback-reader>
>      <map:parameter name="filename" value="{0}"/>
>      <map:parameter name="1" value="/site/user/subsite/images/"/>
>      <map:parameter name="2" value="/site/user/images/"/>
>      <map:parameter name="999" value="/site/images/"/>
>    </extension:fallback-reader>
> And then create a stylesheet that would transform my extension into the
> nested set of actions, parameters, and readers.
> Comments?  I could be completely off the mark here, and instead should get
> off my duff and write a new reader, but that strikes me as being a
> developer-oriented solution where it isn't necessarily appropriate.

I would *strongly* suggest you to write a new reader.

I totally understand that tweaking the sitemap sounds 'easier' because
the try/fail cycle is *much* faster now, but I tend to believe that
until we have the flowmap in place, we should avoid to add anymore
dynamism to the sitemap, or people will start to use it and come up with
even more things to deprecate or keep to maintain forever.

Hope you get my point.

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche

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

View raw message