cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Sitemap problem... help! :-)
Date Sun, 30 Jan 2005 11:07:48 GMT
Sylvain Wallez wrote:
> Mark Lundquist wrote:
> 
>>
>> OK, I figured out the problem (qv. 
>> http://marc.theaimsgroup.com/?t=110701945100004&r=1&w=2).
>>
>> I had one matcher in the root sitemap that handled all continuation 
>> URIs, even those that are generated from pipelines in subsitemaps.
>>
>> So apparently, the context for the redirector invoked from the 
>> flowscript after the continuation is resumed is the context that 
>> matched the continuation resource, *not* the context that originally 
>> invoked the flow.
You should have errors in your log files when getting this kind of 
InvalidContinuationException:

>         if (!kont.interpreterMatches(interpreterId)) {
>             getLogger().error(
>                     "WK: Continuation (" + kont.getId()
>                             + ") lookup for wrong interpreter. Bound to: "
>                             + kont.getInterpreterId() + ", looked up for: "
>                             + interpreterId);
>             return null;
>         }


>>
>> You guys who know this stuff inside and out are probably saying, 
>> "well, of course!" :-)... but am I weird to find this 
>> counterintuitive?  WDYT?
I' have to put an appropriate comment in the docs about that.
> 
> 
> 
> Leszek could tell more about this, but there has been some recent 
> modifications to forbid this: a continuation can only be called within 
> the sitemap where it was created.

It is YOU that have to assure that the continuations gets resumed in the 
same context. As you see in the code pasted above current implementation 
of ContinuationsManager requests the flow interpreter to identify 
itself. Interpreter ID is being compared to the one stored in 
continuation - if it doesn't match you won't be able to resume it.

What you request is not a trivial change. Currently it is the 
interpreter that is resolved first (based on current sitemap context). 
Then it is interpreter's responsibility to lookup and resume a proper 
continuation. I do not know if it is possible to invert the behaviour:
- first the continuations gets looked up
- the sitemap context is changed based on the interpreter info stored in 
continuation (the id is not enough as it is a resource path that would 
have to get parsed every time)
- the flow interpreter bound to sitemap is being invoked with ready to 
go WebContinuation.


-- 
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

Mime
View raw message