Hi Johan,

why are you trying to misuse the system so hard? Can you provide us with your 
original use case?

On Tuesday 16 August 2005 18:23, Johan Carlsson wrote:
> 1. Resources gets registered as adapters in the Global Site Manager.


> 2. The adapter is registerd to adapt from the current layer interface
> (defaults to IDefaultBrowserLayer) to the Interface interface (strange,
> why is that so I wounder?)

The Interface interface is just the default. Sometimes you want views to 
provide other interfaces.

> 3. The layer interface I can look up byt calling:
> zapi.getUtility(ILayer, 'my_layer')
> Ok, fine. So from my View class I try the following:
>          gsm=zapi.getGlobalSiteManager()
>          layer = zapi.getUtility(ILayer, 'my_test')
>          adapter=gsm.queryAdapter(layer, Interface, 'test_me.html')

This will not work, because layer is the actual layer interface. However, 
queryAdapter expects an object that provides the layer interface. This object 
is usually known as the request.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to