cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@apache.org>
Subject Re: [Flow]: Modularizing flow scripts
Date Wed, 08 Jan 2003 21:10:13 GMT

On Wednesday, Jan 8, 2003, at 12:55 US/Pacific, Ugo Cei wrote:

> Ovidiu Predescu wrote:
>> The 'cocoon' object has a load() function, which takes as parameter 
>> the name of the script you want to load. Please let me know if this 
>> works for you.
>
> If I put a list of cocoon.load instructions at the beginning of a 
> script, will they be executed when the file is first loaded?

Yes, it is executed as any top-level JavaScript code when the script is 
first executed in a scope. But:

As I'm looking at the code, I believe there might actually be a problem 
with the script include functionality. This used to work fine, but I 
had to change the behavior some time ago to allow scripts to be shared. 
It may be the case that cocoon.load() is broken in its current state. 
I'll check this behavior and let you know if it is still correct; if 
it's not, I'll remove it from JSCocoon.java.

The safest thing to do right now though is to split your code among 
multiple JS files and include them all in the sitemap:

   <map:flow language="JavaScript">
       <map:script src="script1.js"/>
       <map:script src="script2.js"/>
       <map:script src="script3.js"/>
       <map:script src="script4.js"/>
   </map:flow>

This should work just fine.

Regards,
-- 
Ovidiu Predescu <ovidiu@apache.org>
http://webweavertech.com/ovidiu/weblog/


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message