cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Nettingsmeier <>
Subject flowscript caching and evaluation question
Date Thu, 19 Oct 2006 08:05:50 GMT
hi !

the lenya cms provides a usecase framework with a generic flowscript 
that allows users to create their own usecases and views easily without 
touching javascript *if* their flow needs are very simple.

to allow for more flexibility, i would like to add a way for users to 
add their own flow code to their usecases.

it is supposed to work like this:

the generic usecase handler checks if the user provided a custom 
flowscript uri with the usecase configuration (usecases are Configurable 
avalon components), which implements the functions "customLoopFlow" and 
"customSubmitFlow" the former is used while the usecase is "looping", 
i.e. not yet submitted or cancelled, and the latter is invoked when user 
finally submits or cancels.

it then uses cocoon.load(customUri) to load the custom code.

the question is:
will the flowscript always be re-evaluated? the sitemap just says 
"<map:flow src="genericUsecaseHandler.js"/>, so cocoon might well think 
it can cache and/or even precompile the flowscript once and re-use it. 
(my tests suggest that this is indeed the case.)

the reason i'm using cocoon.load rather than parsing the customUri file 
myself and create the custom functions with "new Function() {}" (which 
would be guaranteed to be re-evaluated each time) is that those 
on-the-fly function objects are a nightmare to debug because you do not 
get line numbers in case of an error.

how can i solve this? any hints or pointers to flowscript 
caching/compiling/evaluation docs (even code) are appreciated.



Jörn Nettingsmeier

"Hofstadter's Law: It always takes longer than you expect,
even when you take into account Hofstadter's Law."
	- Douglas R. Hofstadter

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

View raw message