Carsten Ziegeler wrote:
Reinhard Poetz wrote:
Yes, the problem imho is that it "sounds" this way. Although thisCarsten Ziegeler wrote:
resolves relativeThanks Vadim for the test case.
Ok, we have a minor problem here :)
The contract of the SourceResolver is that it always
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?initialization of the
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
generator is started from the sub sitemap and the subsitemap of course
phase of aruns in the context of the location of the sub sitemap.
Now, we could solve this by "surrounding" the initialization
component with a change of the current context. So, all initmethods of
a component run in the context of the sitemap where the component is defined. All other methods run in the context of the sitemapwhere the
component is used.
WDYT?
Sounds to be the solution that is expected by the user.
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 :)
Usually you declare component once, and re-use in several sitemaps. In this case, relative URLs in configuration are not possible, only context:// URLs. So, I'd say, nobody should expect such behavior, at least, it is not intuitive.
Now question, suppose that this component looks up some other component -- this second component, which sitemap will be current for it?
Vadim
