cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steinar Jonsson <sjons...@online.no>
Subject Re: Are nested flowscripts possible?
Date Fri, 28 Nov 2003 02:16:50 GMT
On Thursday 27 November 2003 23:53, Marc Portier wrote:
> Steinar Jonsson wrote:
> > A flowscript does a sendPageAndWait( request ), and the
> > request happens to start a second flowscript.
> >
> > When that second flowscript has completed its work,
> > how does it get back to where the first one left off?
> >
> > I can't see how to get hold of that continuation id.
> > Am I just being blind, or is this a bad idea altogether?
>
> yep, it's not how you use this stuff
>
>
> what I think you try to do is this:
>
> uri-1 --> calls function1
> function1() {
>   // do-stuff
>   sendPageAndWait(nextPage-uri);
> }
>
> on the produced page there is NOT a link with the continuation, but
> rather a link to some uri-2 -->  calls function2
>
> function2() {
>    //do other stuff.
>
> }
>
>
> this creates completely separate trees of continuations (meaning they
> are not nested at all)
>
>
>
> rather one would go for this:
>
> uri-1 --> calls function1
> function1() {
>    // do stuff
>
>    function2(); //nested call to function 2
>
>    // when function2 is finished, we continue here
>    // do more...
> }
>
> function2() {
>    sendPageAndWait(nextPage-uri);
>    // do whatever with the return
>
> }
>
> and make sure that the return page _is_ just producing the link back to
> the generated continuation.
>
> you can still have some uri-2 that starts off with function2 immediately
> (not nested inside function1 I mean)
>

Good analysis and explanation. Thanks.

Your suggested pattern can certainly provide the functionality required, 
but I also had this idea about a way of partitioning my application, 
sort of a really poor man "real blocks".

Let me try to explain: 
Function 1 is a framework that serves status and navigation pages. From 
config or a workflow component or whatever, it gets a list of uri's of the 
"application parts" it can start. 

Each "application part" is packaged in its own subdirectory, and parts can 
be added or removed just by adding or removing subdirectories in sync 
with the config / workflow setup. 

The framework script knows how to start a part using its uri. A part knows 
how to return to the framework script by using the continuation id. 
(There's more to it of course. Parameters, status, skins etc.)

This scheme actually seems workable in those cases where the part being 
called has access to the continuation id, like a JXTemplateGenerator. 
I'd be surprised if it wasn't technically possible to pass continuation id 
through sendPageAndWait() to a flowscript as well.

I would be happy to have comments on this, even explanations of why this 
can't or shouldn't be done. 

Do not assume that I know what I'm talking about, because I don't. This 
is just part of my struggle to understand how to use cocoon efficiently. 

Many thanks to you Marc and all you others that take the time to answer 
questions here. I've been lurking for some time, and have learned a lot.

Regards
Steinar Jonsson

Mime
View raw message