I'm wondering if we want to make the access to the current sitemap (component/service) manager official?
Currently (2.1), we have a static method at the CocoonComponentManager
that allows to get the current sitemap component manager.
This is useful in some scenarios when you want to access a
sitemap component. If your own component is declared not in the
current sitemap but in any parent than usually it can't access
the components declared in the current sitemap. E.g. the SourceWritingTransformer needs access to the serializers
for writing the content. (Let's not discuss if the SWTransformer
is the best solution for the task it does - it's just one
example).
I think there are other parts already using the unofficial way.
So, the question is: do we want it to make an offical api?
And if yes, how? I personally don't like the static method.
And I would prefer a more indirect way, like making it available
through the Avalon Context passed to a contextualizable component.
I agree with this need, and the context approach is definitely better than the static method.
Another approach can be to shield this behind the ServiceManager that is given to all Serviceable components so that components are always looked up relative to the current sitemap. This would solve all problems at once, but maybe it would have some nasty side effects.
Thoughts?
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com
