cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <>
Subject Nasty flowscript issue - nailed
Date Mon, 05 Jul 2004 21:16:09 GMT
We had an interesting night here, dealing with a really nasty  
flowscript issue  
( Thanks to  
the precious help of Jerm, Andrew and Paul Russell, our small hackaton  
seemed to be successful in at least nailing the issue.

So, there you go: you have different sitemaps, dealing with different  
flowscripts each BUT all residing in the same directory and mounted  
using uri-prefix as follows:

<map:mount src="something.xmap" uri-prefix="something"  

<map:mount src="else.xmap" uri-prefix="else" check-reloads="true"/>

In that case, FOM_JavaScriptInterpreter screws up because of scope  
handling: scopes are kept in memory and indexed using a string coming  
from the internal getSitemapPath() function call which, a bit naively,  
is as follows:

    private String getSitemapPath() throws Exception {
         Source src = this.sourceresolver.resolveURI(".");
         try {
             return src.getURI();
         } finally {

Now, whether you ask for /url /something/url or /else/url, that method  
will always return file://$COCOON_HOME/build/webapp/. This means that  
the list of available functions will always point to the first set of  
scripts being evaluated, and on your subsequent requests to seemingly  
different URLs you get a nice function not found error.

I changed that to

    private String getSitemapPath() throws Exception {
         return ObjectModelHelper.getRequest(

but being a freshman on Cocoon flow internals, I'm afraid this is going  
to introduce a nasty set of regressions. Can anyone more knowleadgeable  
verify the problem and possibly provide a more clever solution?

Gianugo Rabellino
Pro-netics s.r.l. -
Orixo, the XML business alliance:

View raw message