cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: CopySourceAction , seems trivial but can't make it works
Date Tue, 28 Sep 2004 08:37:54 GMT
Frédéric Glorieux wrote:
>>> I would like to make work this simple idea, when an URI (**.html) is 
>>> requested for the first time, it's generated and a file is written 
>>> somewhere ; otherwise, cocoon cache handle. I have implemented a bad 
>>> patch of my own, directly on pipeline, but if an action can do the 
>>> job...
> I should explain a real life situation. Authors are working on their 
> lan, there's no server admin to keep a cocoon runing on the Internet but 
>  static http is possible (IIS :o( ). So, the cocoon is used as a lan 
> production tool for HTML (and other formats).
>> IMO, you'd better use Cocoon's CLI which is exactly suited for this job.
> Not exactly, but I should. The problem is, it wasn't working with my app 
> (xsp) on cocoon2.1.3, I will test with cocoon2.1.5
> For cocoon-users and the archives of this list :
> I ask you if I have to double each pipe
> you answer me this simple piece of code
> copy/paste here for everyone

A precision that you forgot to copy/paste: the sitemap below can be used 
with any existing sitemap: just rename the original sitemap to 
"dynamic.xmap" and put the one below in the regular "sitemap.xmap", 
which will act as a front-end to the original one.

> <map:match pattern="_production/**">
>  <map:mount src="dynamic.xmap" uri-prefix="_production"/>
> </map:match>
> <map:match pattern="**">
>  <map:select type="resource-exists">
>    <map:parameter name="prefix" value="generated/{0}">
>    <map:when test="">
>      <!-- nothing to do, file already generated -->
>    </map:when>
>    <map:otherwise>
>      <!-- generate -->
>      <map:act type="copy-source" src="cocoon:/_production/{0}">
>        <map:parameter name="dest" value="generated/{0}"/>
>      </map:act>
>    </map:otherwise>
>  </map:select>
>  <map:read src="generated/{0}"/>
> </map:match>
> Very nice. Could be an idea of a sitemap configurable filesystem cache. 
> The problem is ---v
>> Note however, that once generated, the document validity will *never* 
>> be checked unless the generated file is deleted.
> That's what my patched pipeline do, but not enough generic to be 
> commited to cocoon.
> Thanks a lot to have explain more the "copy-source" action.

You're welcome :-)


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

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

View raw message