cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinhard Poetz" <reinh...@apache.org>
Subject RE: [Flow] Support for interceptions
Date Sun, 07 Sep 2003 10:42:44 GMT

From: Sylvain Wallez

> Looks yummy, but without continuation support, a big piece is 
> missing. 
> Is there a blocking problem with that ?

... the first answer is "It is work in progress." ;), 
... the second is "I wanted to share my code ASAP" 
... and the third answer "We (I) have to think more about that." 
;)

The support for interceptions is a static concept. If a script is added
to the JS context it is converted by the AspectWeaver (--> all the
interceptions are added). The question for me now is, when do I add the
interception?

Following script is given:

 function myFunc() {

    var x = "bla";
    sendPageAndWait( "page1.html", { x : x } );
    var y = "bla";
    sendPageAndWait( "page2.html", { y : y } );
    var z = "bla";
    sendPageAndWait( "page3.html", { z : z } );
    sendPage( "page4.html" );
 }

If we have following additional events:

 - before-continuation()
 - after-continuation()

they are added the function has following structure:
(note that there is an after event necessary at line3 to be consistent).

 function myFunc() {
   before()
   after-continuation():
    var x = "bla";
   before-continuation();
    sendPageAndWait( "page1.html", { x : x } );
   after-continuation():

    var y = "bla";
   before-continuation();
    sendPageAndWait( "page2.html", { y : y } );
   after-continuation():

    var z = "bla";
   before-continuation();
    sendPageAndWait( "page3.html", { z : z } );
   after-continuation();

    sendPage( "page4.html" );
   after();
 }

Interception defintion file:

 function my* {

   before-continuation( sendPageAndWait ): {
         // e.g. release pooled component here
   }

   after-continuation( sendPageAndWait ): {
         // e.g. lookup pooled component here
   }

 }

My problem is that this notation is not correct because it should be
"before-function-call" and "after-function-call" or is it enough to
react on sendPageAndWait(..) only? If yes, how to we deal with e.g.
special JXForms or Woody functions were you have to call "sendView(..)"
or woody.send()? A possible solution could be

cocoon.load( "jxFormsFunctionsScript.js", [ aspects1.js, aspects2.js ]
);

And you apply your aspects to the dynamically loaded script.
But where do I have to intercept it? Maybe static interception is not
enough ... :(

What do you think?

Reinhard









Mime
View raw message