cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Sitemap problem... help! :-)
Date Sun, 30 Jan 2005 13:21:57 GMT
Leszek Gawron wrote:

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


I don't think we should go that far: IMO, having an exception with a 
clear reason message is enough, as it shows that there is a bug in the 
application that needs to be fixed. Mark had no such exception, and 
that's why he spent much time to find the problem.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message