cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Foster <>
Subject Sitemap Transformations
Date Tue, 04 Jun 2002 17:57:46 GMT
What is the feeling on the list regarding having a special pipeline that is 
use to transform the sitemap before it is interpreted?

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:read src="/site/user/subsite/images/{0}"/>
     <map:read src="/site/user/images/{0}"/>
   <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:

     <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/"/>

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.

Jason Foster

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

View raw message