You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2004/03/10 18:58:31 UTC

Bookmark continuations (was Re: Aack!)

(I changed the subject line now that I have a clue what this is 
about... "Aack!" is not very helpful to the community, me thinks :-)

On Mar 10, 2004, at 7:25 AM, Christopher Oliver wrote:

> See the use of form.setBookmark() in the v2 API. It allows you to 
> reacquire your bizData each time the form is redisplayed.
>
> Chris

Thanks Chris... sounds like this will help.

I checked the samples... the only example of bookmarking continuations 
is the "back" button in a multipage ('wizard') form sequence.  No 
example of setBookmark().  I tried searching the v2 API itself, the FOM 
source code, and finally Google, and came up bone-dry.

Then I ran across this, right there in the "Advanced Flow Control" page 
of the Cocoon docs:

createWebContinuation

Function [WebContinuation] createWebContinuation()

Creates a new "bookmark" WebContinuation object. When invoked it will 
cause the script to resume right after the call. By calling this 
function prior to sendPageAndWait() you can be create a "bookmark" 
which will cause the page to be redisplayed in the browser. Note: the 
WebContinuation associated with sendPageAndWait() doesn't do this. 
Rather it resumes execution after the the page is submitted.

  For example:

function processPage() {

   var bkm = cocoon.createWebContinuation();
   var biz = getBizData();
   cocoon.sendPageAndWait("uri",
                          {bookmark: bkm, biz: biz},
                          function() { releaseData(biz); });
}


This looks like it might be on the right track... is it?  If so, I have 
some more questions...  I don't understand at all what is going on in 
the call to sendPageAndWait in this example.  So there's this 
javascript object literal:

	{bookmark: bkm, biz: biz}

and it would seem that this object is the bizdata as far as 
sendPageAndWait is concerned...?  So I'm confused about where/how the 
'bookmark' property of that object achieves it effect. The doc says 
what the bookmark will do "when invoked"... but how/where is it 
invoked?  Looking at the implementation of sendPageAndWait, it always 
creates a new WebContinuation to pass to sendPage... Do I still specify 
the <form action="..."> in the same way, or am I supposed to reference 
previousContinuation or something, or what?

And all this begs the question of how to use this bookmark approach 
with the Woody/Flow integration, where you want to be calling 
showForm() instead of sendPageAndWait() directly... and in particular, 
with the v2 API, where apparently the widget tree is the (implicit) 
bizdata (?)

So many questions... so little time to get all this working... :-/

Thanks a lot for all the help so far!
Mark


Re: Bookmark continuations (was Re: Aack!)

Posted by Christopher Oliver <re...@verizon.net>.
Sorry, I think this is post 2.1.4. You'll need to get the CVS version. 
The example flowscript shows how to use it.

Chris

Mark Lundquist wrote:

> (I changed the subject line now that I have a clue what this is 
> about... "Aack!" is not very helpful to the community, me thinks :-)
>
> On Mar 10, 2004, at 7:25 AM, Christopher Oliver wrote:
>
>     See the use of form.setBookmark() in the v2 API. It allows you to
>     reacquire your bizData each time the form is redisplayed.
>
>     Chris
>
>
> Thanks Chris... sounds like this will help.
>
> I checked the samples... the only example of bookmarking continuations 
> is the "back" button in a multipage ('wizard') form sequence. No 
> example of setBookmark(). I tried searching the v2 API itself, the FOM 
> source code, and finally Google, and came up bone-dry.
>
> Then I ran across this, right there in the "Advanced Flow Control" 
> page of the Cocoon docs:
>
> *createWebContinuation
>
> */Function/ [WebContinuation] createWebContinuation()
>
> Creates a new "bookmark" WebContinuation object. When invoked it will 
> cause the script to resume right after the call. By calling this 
> function prior to sendPageAndWait() you can be create a "bookmark" 
> which will cause the page to be redisplayed in the browser. Note: the 
> WebContinuation associated with sendPageAndWait() doesn't do this. 
> Rather it resumes execution after the the page is submitted.
>
> For example:
>
> function processPage() {
>
> var bkm = cocoon.createWebContinuation();
> var biz = getBizData();
> cocoon.sendPageAndWait("uri",
> {bookmark: bkm, biz: biz},
> function() { releaseData(biz); });
> }
>
>
> This looks like it might be on the right track... is it? If so, I have 
> some more questions... I don't understand at all what is going on in 
> the call to sendPageAndWait in this example. So there's this 
> javascript object literal:
>
> {bookmark: bkm, biz: biz}
>
> and it would seem that this object /is/ the bizdata as far as 
> sendPageAndWait is concerned...? So I'm confused about where/how the 
> 'bookmark' property of that object achieves it effect. The doc says 
> what the bookmark will do "when invoked"... but how/where is it 
> invoked? Looking at the implementation of sendPageAndWait, it always 
> creates a new WebContinuation to pass to sendPage... Do I still 
> specify the <form action="..."> in the same way, or am I supposed to 
> reference previousContinuation or something, or what?
>
> And all this begs the question of how to use this bookmark approach 
> with the Woody/Flow integration, where you want to be calling 
> showForm() instead of sendPageAndWait() directly... and in particular, 
> with the v2 API, where apparently the widget tree is the (implicit) 
> bizdata (?)
>
> So many questions... so little time to get all this working... :-/
>
> Thanks a /lot/ for all the help so far!
> Mark
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org