cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: Wrong restauration of environment context after pass-through
Date Sat, 29 Jan 2005 18:41:38 GMT
Sylvain Wallez wrote:
> Carsten Ziegeler wrote:
> 
>> Sylvain Wallez wrote:
>>
>>> Carsten Ziegeler wrote:
>>>
>>
>>> I don't understand what is this "last context": does it have to 
>>> behave like a stack, or is it the context in which the internal 
>>> pipeline has been built?
>>
>>
>>
>> It is the context in which the internal pipeline will run; it's not a 
>> stack. Internal pipeline calls are done in two phases: the first one 
>> building the pipeline and the second on invoking the pipeline. As only 
>> during the first phase the tree processor is invoke, the environment 
>> context (or the location of the sitemap used for the pipeline) is 
>> lost. Therefore the environment wrapper stores the last sitemap used 
>> (which is currently the deepest sitemap used during processing).
>>
>> And I think this is exactly the problem with the pass through, because 
>> with pass-through the sitemap that should be used for running the 
>> pipeline is not the deepest one, but a different one.
>> So, rethinking everything this could be fixed perhaps more easily than 
>> I thought. If the flow comes back from a sub sitemap without a match 
>> (pass through) then the last context of the wrapper should be 
>> overwritten with the current context.
>>
>> I'm just testing a fix for this - stay tuned.
> 
> 
> 
> Damn, I was just testing my own fix!

:)

> 
> I looked at your modifications, and mine are mostly code removal rather 
> than code additions: I removed all the changeToLastContext() stuff and 
> added a test in MountNode so that the environment's context is set to 
> its previous value *only* if the mounted sitemap has not sucessfully 
> built a pipeline.
> 
> That way, the environment keeps the context in which the pipeline was 
> built, which is just what we want, and we no more need to keep track of 
> the last context (which as we've seen, is difficult to define in the 
> case of pass-through).
> 
> This seems to work just fine (I went through most of the samples), and I 
> would like to apply these changes as they simplify things.
> 
> WDYT?
> 
Hmm, yeah seems ok for me - go ahead.

Carsten

Mime
View raw message