[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ContentDirective - ContentDirective.py:1.5

Jim Fulton jim@zope.com
Sun, 23 Jun 2002 13:04:11 -0400


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

Modified Files:
	ContentDirective.py 
Log Message:
Finished implementing
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/AddMenuProposalAndEndOfZmiNamespace

Updated the service manager to use a menu.

Ripped out the old adder registry code.



=== Zope3/lib/python/Zope/App/ContentDirective/ContentDirective.py 1.4 => 1.5 ===
 from Zope.App.Security.protectClass \
     import protectLikeUnto, protectName, checkPermission
-from Zope.App.ZMI.IGenericCreatorMarker import IGenericCreatorMarker
 from Zope.Security.Proxy import ProxyFactory
 from Zope.Security.Checker import NamesChecker
 
@@ -124,7 +123,8 @@
         return ()
 
 
-    def factory(self, _context, permission, title, id=None, description=''):
+    def factory(self, _context,
+                permission=None, title="", id=None, description=''):
         """Register a zmi factory for this class"""
 
         id = id or self.__id
@@ -134,21 +134,22 @@
         # same namespace, despite the service/content division
         return [
             Action(
-                discriminator = ('AddableFactory', id),
+                discriminator = ('FactoryFromClass', id),
                 callable = provideClass,
                 args = (id, self.__class,
                         permission, title, description)
                 )
             ]
     
-def provideClass(id, _class, permission,
-                 title, description=''):
+def provideClass(id, _class, permission=None,
+                 title='', description=''):
     """Provide simple class setup
 
     - create a component
 
     - set component permission
     """
+
     factory = ClassFactory(_class)
     if permission and (permission != 'Zope.Public'):
         # XXX should getInterfaces be public, as below?