AW: [Zope3-dev] getService() call local from global Bug/Hook

Roger Ineichen r.ineichen at projekt01.ch
Tue Jun 1 06:52:31 EDT 2004


Jim Fulton wrote:
> Stephan Richter wrote:
> > On Thursday 27 May 2004 18:33, Roger Ineichen wrote:
> > 
> >>If I lookup the principal annotation service
> >>from the local utility I use:
> >>
> >>zapi.getService(self.context, PrincipalAnnotationServiceName)
> > 
> > 
> > This should suffice to get you the local or global version based on 
> > the
> > context. If not, that would be a bug.
> 
> No, you should not pass a context argument any more.
> 
> I really need to turn the warnings on for using the old call 
> form. Perhaps I can do that tomorrow.
> 
> Jim

Ok, that's working fine now:
zapi.getService(PrincipalAnnotationServiceName)

for to use in a adapter where adapts local or global utilities.

The method getService(PrincipalAnnotationServiceName) in a adapter returns
the principal annotation service on global utilities form a service manager
above. Then the principal annotation service exist as a local service and is
above the service manager where the adapter adapts the global utility. And
there was no easy way for to make shure the adapter could be used for global
and local utilities, becaus of their different lookup of the local principal
annotation servcice from the global or local context of the utility.

Regards
Roger




More information about the Zope3-dev mailing list