diff options
author | Jim Fulton <jim@zope.com> | 2005-09-08 10:17:23 +0000 |
---|---|---|
committer | Jim Fulton <jim@zope.com> | 2005-09-08 10:17:23 +0000 |
commit | 2d32134a40b63e7cfdebd1363ba57f9f9a870377 (patch) | |
tree | 0b7828cec95925c99bece79115c773c33e9fea3c | |
download | zope-traversing-2d32134a40b63e7cfdebd1363ba57f9f9a870377.tar.gz |
First cut at adapter-registry refactoring. The refactoring makesmonolithic-zope3-zope-app-jim-adapter-redesign
adapter lookup work more like method lookup. This provides:
- a much simpler algorithm,
- a basis for super-like adapter lookup, and
- a fix for a bug in multi-adapter lookup.
These changes also remove the distinction between objects with no
interface declarations and objects that declare that they provide
Interface.
Unfortunately, these version is *much* too slow. I'm checking this
version in to save it before trying some variations.
-rw-r--r-- | browser/configure.zcml | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/browser/configure.zcml b/browser/configure.zcml new file mode 100644 index 0000000..a2cefab --- /dev/null +++ b/browser/configure.zcml @@ -0,0 +1,85 @@ +<configure + xmlns="http://namespaces.zope.org/zope" + xmlns:browser="http://namespaces.zope.org/browser"> + + <view + for="zope.interface.Interface" + type="zope.publisher.interfaces.browser.IBrowserRequest" + provides="zope.publisher.interfaces.browser.IBrowserPublisher" + factory="zope.app.publication.traversers.SimpleComponentTraverser" + permission="zope.Public" + /> + + <adapter + for="types.MethodType zope.publisher.interfaces.browser.IBrowserRequest" + provides="zope.publisher.interfaces.browser.IBrowserPublisher" + factory="zope.app.publication.traversers.NoTraverser" + /> + + <view + for="zope.app.container.interfaces.IItemContainer" + type="zope.publisher.interfaces.browser.IBrowserRequest" + provides="zope.publisher.interfaces.browser.IBrowserPublisher" + factory="zope.app.container.traversal.ItemTraverser" + permission="zope.Public" + /> + + <view + for="zope.app.container.interfaces.ISimpleReadContainer" + type="zope.publisher.interfaces.browser.IBrowserRequest" + provides="zope.publisher.interfaces.browser.IBrowserPublisher" + factory="zope.app.container.traversal.ItemTraverser" + permission="zope.Public" + /> + + <view + for="*" + name="absolute_url" + factory=".AbsoluteURL" + type="zope.publisher.interfaces.http.IHTTPRequest" + permission="zope.Public" + allowed_interface=".interfaces.IAbsoluteURL" + /> + + <view + for="*" + factory=".AbsoluteURL" + type="zope.publisher.interfaces.http.IHTTPRequest" + permission="zope.Public" + provides=".interfaces.IAbsoluteURL" + /> + + <view + for="zope.app.traversing.interfaces.IContainmentRoot" + name="absolute_url" + factory=".SiteAbsoluteURL" + type="zope.publisher.interfaces.http.IHTTPRequest" + permission="zope.Public" + allowed_interface=".interfaces.IAbsoluteURL" + /> + + <view + for="zope.app.traversing.interfaces.IContainmentRoot" + factory=".SiteAbsoluteURL" + type="zope.publisher.interfaces.http.IHTTPRequest" + permission="zope.Public" + provides=".interfaces.IAbsoluteURL" + /> + + <browser:page + for="*" + name="absolute_url" + class=".AbsoluteURL" + permission="zope.Public" + allowed_interface=".interfaces.IAbsoluteURL" + /> + + <browser:page + for="zope.app.traversing.interfaces.IContainmentRoot" + name="absolute_url" + class=".SiteAbsoluteURL" + permission="zope.Public" + allowed_interface=".interfaces.IAbsoluteURL" + /> + +</configure> |