cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject flowscript bizData "AOP"
Date Sat, 17 Apr 2004 18:02:56 GMT
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

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
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.

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="">
<jx:set var="ignored" value="${streamer.toSAX(message.content, 
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |

View raw message