Unico Hommes wrote: > > Carsten Ziegeler wrote: > > > > How can I get the role of a component in an Accessor? > > > > I looked into the context passed to the access() method, but > > it doesn't seem to contain the role name, e.g. > > a context.get( "component.name" ) doesn't work. > > > > Haven't tried it myself but I think you should be able to get the > MetaInfoManager via the ServiceManager that you can get from the Context > object. > > ServiceManager services = > context.get(ContainerManagerConstants.SERVICE_MANAGER); > MetaInfoManager meta = services.lookup(MetaInfoManager.ROLE); > Wow, that's what I call simple :) Thanks!
> Could you provide some background as to why you need this? Just trying > to think along with you :-) > Yepp, of course. I'm trying to get the SitemapConfigurable in Cocoon 2.2 working. There you have an extra configuration in the sitemap for a component. So, you have a map of configurations where the key is the role of the component. Now, when the component is looked up, the lifecycle extension has to pass the correct configuration to the component. Therefore it needs the role of the component. Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
