I have a lot of flowscript top level variables (application context, currently logged in user context, application statistics). I would like to provide them to ALL application views. Right now sendPage implements a PUSH politics (I have to specify explicitly what I would like to make available to the view). Including top level variables manually in every sendPage is messy and error prone.
Is there any way to implement something like AOP for variables? I mean every bizData gets appended a set of common variables? This would make flow closer to a PULL model Controller exposes everything it got - in the boundaries of sanity of course - the view gets only what it wants. Exposing everything might not be a good idea but some controlled set might help a lot. moreover one would like to provide JXTemplateGenerator with additional functionality as in http://marc.theaimsgroup.com/?t=108212968300007&r=1&w=2&n=6 jx template generator has a number and date formatter but if application defines additional features in flowscript the easiest way would be to add it to every bizData. <Chris-code> I guess you could even avoid the sax buffer and stream it directly in the template: // flowscript fragment var message = ...; sendPage("page.html", {message: message, streamer: {toSAX: toSAX}}); // jx template fragment <jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"> ... <jx:set var="ignored" value="${streamer.toSAX(message.content, cocoon.consumer}}"/> ... </jx/template> </Chris-code> WDYT? lg -- __ | / \ | Leszek Gawron // \\ \_\\ //_/ [EMAIL PROTECTED] _\\()//_ .'/()\'. Phone: +48(501)720812 / // \\ \ \\ // recursive: adj; see recursive | \__/ |