cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: Bug? Foreign SourceResolver in Generator.configure()
Date Fri, 11 Jun 2004 10:30:35 GMT
Carsten Ziegeler wrote:

>Reinhard Poetz wrote:
>  
>
>>Carsten Ziegeler wrote:
>>
>>    
>>
>>>Thanks Vadim for the test case.
>>>
>>>Ok, we have a minor problem here :)
>>>
>>>The contract of the SourceResolver is that it always 
>>>      
>>>
>>resolves relative 
>>    
>>
>>>to the *current sitemap*. The interesting question now is: 
>>>      
>>>
>>what is the 
>>    
>>
>>>"current sitemap" for a component that is instantiated? Is it the 
>>>sitemap the component is declared in or the sitemap of the current 
>>>request?
>>>Now, I tend to the first option. If this is the case we have a bug :(
>>>
>>>To be precise I think we have this behaviour in Cocoon since 2.1.0.
>>>I just tested 2.1.5 and the problem exists there as well.
>>>
>>>The problem is that the lookup and therefore the 
>>>      
>>>
>>initialization of the 
>>    
>>
>>>generator is started from the sub sitemap and the sub 
>>>      
>>>
>>sitemap of course 
>>    
>>
>>>runs in the context of the location of the sub sitemap.
>>>
>>>Now, we could solve this by "surrounding" the initialization 
>>>      
>>>
>>phase of a 
>>    
>>
>>>component with a change of the current context. So, all init 
>>>      
>>>
>>methods of 
>>    
>>
>>>a component run in the context of the sitemap where the component is 
>>>defined. All other methods run in the context of the sitemap 
>>>      
>>>
>>where the 
>>    
>>
>>>component is used.
>>>
>>>WDYT?
>>> 
>>>
>>>      
>>>
>>Sounds to be the solution that is expected by the user.
>>
>>    
>>
>Yes, the problem imho is that it "sounds" this way. Although this
>bug is in Cocoon since years, noone complained about it until
>recently - so either noone needed it until now or the current
>way (the "bug") is the way user expect it :)
>  
>

To make sure we all speak about the same:

main-sitemap:
<map:components>
  <map:generator type="xyz" src="XyzGenerator">
    <confFile>myConfFile.txt</confFile>
  </map:generator>
</map:components>

some sub-sitemap:
<map:generator type="xyz">
  <map:parameter name="confFile" value="confFile2.txt"/>
</map:generator>

myConfFile is located relativ to the main-sitemap
myConfFile is located relativ to the sub-sitemap

That's the way *I* expect it. Another behaviour is IMHO a bug because I 
wouldn't have a chance to set a global configuration file, would I?
2.2 gives us the chance to correct it.

-- 
Reinhard


Mime
View raw message