You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolas Bielza <ni...@gmail.com> on 2004/11/19 18:43:54 UTC

how to remove a continuation object ?

Hi,

I have several pages in my webapp that are using WebContinuations, the
continuation-id is placed in a hidden form field and the sitemap looks
like this:


		<map:match pattern="titi">
			<map:match type="request-parameter" pattern="continuation-id">
				<map:call continuation="{1}"/>
			</map:match>
			<map:call function="titi"/>
		</map:match>

		<map:match pattern="toto">
			<map:match type="request-parameter" pattern="continuation-id">
				<map:call continuation="{1}"/>
			</map:match>
			<map:call function="toto"/>
		</map:match>

Now, function toto is like:

function toto()
{
    var form = new Form("forms/toto.xml");

    form.showForm("toto-display-pipeline");

    var model = form.getModel();
		
cocoon.sendPageAndWait("toto-confirm");
				
		if(getParam("confirmation") == "true") {
			cocoon.sendPage("toto-end");
		} else {
			cocoon.sendPage("titi"); // this causes an infinite loop
		}
}

Now the problem is that the matcher for "titi" in the sitemap invokes
the continuation that was created in function toto(), causing an
infinite loop.
I tried to invalidate the continuation but then I get an
InvalidContinuationException. What I'd like to do is to remove the
Continuation object from the context (or from the request ?) so that
the request-parameter matcher won't see it.
Does anyone know of a way to do so ?

Thanks,
Nicolas.

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


Re: how to remove a continuation object ?

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Nicolas Bielza wrote:
> Hi,
> 
> I have several pages in my webapp that are using WebContinuations, the
> continuation-id is placed in a hidden form field and the sitemap looks
> like this:
> 
> 
> 		<map:match pattern="titi">
> 			<map:match type="request-parameter" pattern="continuation-id">
> 				<map:call continuation="{1}"/>
> 			</map:match>
> 			<map:call function="titi"/>
> 		</map:match>
> 
> 		<map:match pattern="toto">
> 			<map:match type="request-parameter" pattern="continuation-id">
> 				<map:call continuation="{1}"/>
> 			</map:match>
> 			<map:call function="toto"/>
> 		</map:match>
> 
> Now, function toto is like:
> 
> function toto()
> {
>     var form = new Form("forms/toto.xml");
> 
>     form.showForm("toto-display-pipeline");
> 
>     var model = form.getModel();
> 		
> cocoon.sendPageAndWait("toto-confirm");
> 				
> 		if(getParam("confirmation") == "true") {
> 			cocoon.sendPage("toto-end");
> 		} else {
> 			cocoon.sendPage("titi"); // this causes an infinite loop
should be:
                         cocoon.sendPage( "someView" );
                         titi();

You should invoke your function and not call it via pipeline.


> 		}
> }
> 
> Now the problem is that the matcher for "titi" in the sitemap invokes
> the continuation that was created in function toto(), causing an
> infinite loop.
> I tried to invalidate the continuation but then I get an
> InvalidContinuationException. What I'd like to do is to remove the
> Continuation object from the context (or from the request ?) so that
> the request-parameter matcher won't see it.
> Does anyone know of a way to do so ?
> 
> Thanks,
> Nicolas.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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