[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - PublicationTraverse.py:1.1.2.15

Gary Poster garyposter@earthlink.net
Mon, 22 Apr 2002 15:03:55 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv31509/App/ZopePublication

Modified Files:
      Tag: Zope-3x-branch
	PublicationTraverse.py 
Log Message:
1. As per ZopeTop discussion, moved Addable out of ZMI into the Services folder, and turned it into a true service (this involved a lot of small changes, particularly in the folders and a number of tests) and gave it some hooks
2. used SteveA's ContextWrapper.ContextMethod to make the ServiceManager and Services placefully look up to parent placeful equivalents
3. Made Event into a more standard service, and gave it some hooks
4. Built the beginning of a placeful EventService (will need tests, and views, and EventChannels, and more meat; just wanted to check this in for now)
5. made it so you can't add an item to a folder with a blank string id, and updated the folder interface
6. some typos fixed here and there
7. a few more tests here and there

I'm checking this in then checking it out again to check my work; also tagged previous version as gary-service_update.



=== Zope3/lib/python/Zope/App/ZopePublication/PublicationTraverse.py 1.1.2.14 => 1.1.2.15 ===
 
 from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
-from Zope.ComponentArchitecture import getRequestView
+from Zope.ComponentArchitecture import getRequestView, getService
 from Zope.App.Security.SecurityManagement import getSecurityManager
 from Zope.Publisher.Exceptions import NotFound
 from types import StringTypes
 from Zope.ContextWrapper import Wrapper, getcontext
 
-from Zope.App.ZMI.Addable import ContentAddables
 from Zope.App.OFS.Container.IContainer import IWriteContainer
 from Zope.App.OFS.ApplicationControl.ApplicationControl \
      import ApplicationController
 
 class DuplicateNamespaces(Exception):
-    """More than one namespave was specified in a request"""
+    """More than one namespace was specified in a request"""
     
 class UnknownNamespace(Exception):
     """A parameter specified an unknown namespace"""
 
 class ExcessiveWrapping(NotFound):
-    """Too many levels of acquisition wrapping. We don't beleive them."""
+    """Too many levels of acquisition wrapping. We don't believe them."""
 
 class PublicationTraverse:
 
@@ -181,9 +180,9 @@
         raise ExcessiveWrapping(origOb, name, request)
     
     def _traversecreate(self, request, ob, name): 
-        for addable in ContentAddables.getAddables(ob):
-            if addable.id() == name:
-                return addable
+        for addable in getService(ob,'AddableContent').getAddables(ob):
+            if addable.id == name:
+                return self._wrap(addable, ob, name, name)
         raise NotFound(ob, name, request)