You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thomas Kjeldahl Nilsson <tn...@marcello.no> on 2004/06/28 08:59:01 UTC
Some questions about continuations!
Hello,
A few (possibly stupid) questions on continuations:
1: Do active continuations "time out"? In my project we have quite a few
pages where we in the flow do a sendPageAndWait(), then present a page
where the user is able to go elsewhere thus not letting the current
continuation finish (by calling sendPage()).
What happens with this unactive continuation?
2: In my app, when the user does something wrong when submitting a form,
I want to restart the function, and present the first page with an error
msg in at the top of the page. How best to do this?
----
function doStuff(){
// Prepare page
cocoon.sendPageAndWait("first.xml");
// Process form submitted by user:
//IF (any errors) THEN restart doStuff(), show "first.xml" with errorMsg
// ELSE cocoon.sendPageAndWait("second.xml");
}
----
regards,
Thomas Kjeldahl Nilsson
Oslo, Norway
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Some questions about continuations!
Posted by Thomas Kjeldahl Nilsson <tn...@marcello.no>.
Thanks for the quick reply, Ugo.
Bit of a head-smacking-moment for me looking at your flowscript
suggestion! "Of course!" :)
Regards,
Thomas N
Ugo Cei wrote:
> Thomas Kjeldahl Nilsson wrote:
>
>> 1: Do active continuations "time out"? In my project we have quite a
>> few pages where we in the flow do a sendPageAndWait(), then present a
>> page where the user is able to go elsewhere thus not letting the
>> current continuation finish (by calling sendPage()).
>
>
> Yes, they do expire after a timeout that is set in cocoon.xconf (search
> for the <continuations-manager> element).
>
>> What happens with this unactive continuation?
>
>
> It triggers an invalid continuation exception if invoked.
>
>> 2: In my app, when the user does something wrong when submitting a
>> form, I want to restart the function, and present the first page with
>> an error msg in at the top of the page. How best to do this?
>
>
> var error = null;
> while true() {
> cocoon.sendPageAndWait("view", { "error" : error });
> error = validateUserInput();
> if (error == null) break;
> }
>
>
> Ugo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Some questions about continuations!
Posted by Ugo Cei <u....@cbim.it>.
Thomas Kjeldahl Nilsson wrote:
> 1: Do active continuations "time out"? In my project we have quite a few
> pages where we in the flow do a sendPageAndWait(), then present a page
> where the user is able to go elsewhere thus not letting the current
> continuation finish (by calling sendPage()).
Yes, they do expire after a timeout that is set in cocoon.xconf (search
for the <continuations-manager> element).
> What happens with this unactive continuation?
It triggers an invalid continuation exception if invoked.
> 2: In my app, when the user does something wrong when submitting a form,
> I want to restart the function, and present the first page with an error
> msg in at the top of the page. How best to do this?
var error = null;
while true() {
cocoon.sendPageAndWait("view", { "error" : error });
error = validateUserInput();
if (error == null) break;
}
Ugo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org