[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ContentDirective - ContentDirective.py:1.9 meta.zcml:1.5

R. David Murray bitz@bitdance.com
Wed, 6 Nov 2002 17:30:52 -0500


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

Modified Files:
	ContentDirective.py meta.zcml 
Log Message:
Merge of rdmurray-metameta-branch.  See checkin message for 
doc/zcml/meta.stx for a more comprehensive checkin comment.


=== Zope3/lib/python/Zope/App/ContentDirective/ContentDirective.py 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/ContentDirective/ContentDirective.py:1.8	Tue Oct  1 08:47:49 2002
+++ Zope3/lib/python/Zope/App/ContentDirective/ContentDirective.py	Wed Nov  6 17:30:21 2002
@@ -18,6 +18,7 @@
 from types import ModuleType
 from Interface.Implements import implements
 from Zope.Configuration.INonEmptyDirective import INonEmptyDirective
+from Zope.Configuration.ISubdirectiveHandler import ISubdirectiveHandler
 from Zope.ComponentArchitecture import getService
 from Zope.Configuration.Exceptions import ConfigurationError
 from Zope.Configuration.Action import Action
@@ -35,7 +36,8 @@
 
 class ContentDirective:
 
-    __implements__ = INonEmptyDirective
+    __class_implements__ = INonEmptyDirective
+    __implements__ = ISubdirectiveHandler
 
     def __init__(self, _context, class_):
         self.__id = class_        


=== Zope3/lib/python/Zope/App/ContentDirective/meta.zcml 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/ContentDirective/meta.zcml:1.4	Tue Oct  1 08:47:49 2002
+++ Zope3/lib/python/Zope/App/ContentDirective/meta.zcml	Wed Nov  6 17:30:21 2002
@@ -1,20 +1,91 @@
 <zopeConfigure xmlns='http://namespaces.zope.org/zope'>
 
-  <!-- Zope.App.ContentDirective -->
-  <directives namespace="http://namespaces.zope.org/zope">
-    <directive name="content"
-               attributes="class"
-               handler="Zope.App.ContentDirective." >
-      <subdirective name="implements"
-                    attributes="interface" />
-      <subdirective name="require"
-                    attributes="permission attributes interface
-                                like_class set_attributes" />
-      <subdirective name="allow"
-                    attributes="attributes interface" />
-      <subdirective name="factory"
-                    attributes="id permission title description" />
-    </directive>
-  </directives>
+<!-- Zope.App.ContentDirective -->
+<directives namespace="http://namespaces.zope.org/zope">
+
+  <directive
+      name="content"
+      handler="Zope.App.ContentDirective." 
+      description="Make a component available as a content object type"
+  >
+    <attribute
+        name="class"
+        required="yes"
+        description="resolvable name of a class" />
+
+    <subdirective
+        name="implements"
+        description="Declare that the class given by the content
+            directive's class attribute implements a given interface"
+    >
+      <attribute
+          name="interface"
+          required="yes"
+          description="resolvable name of an Interface" />
+    </subdirective>
+
+    <subdirective
+        name="require"
+        description="Indicate that the a specified list of names or the
+          names in a given Interface require a given permission for
+          access."
+    >
+      <attribute
+          name="permission"
+          required="yes"
+          description="a permission id" />
+      <attribute
+          name="attributes"
+          description="space-separated list of attribute names" />
+      <attribute
+          name="interface"
+          description="the resolvable name of an interface" />
+      <attribute
+          name="like_class"
+          description="a class on which the security requirements
+              for this class will be based" />
+    </subdirective>
+
+    <subdirective
+        name="allow"
+        description="Declare a part of the class to be publicly
+            viewable (that is, requires the Zope.Public
+            permission).  Only one of the following two
+            attributes may be used."
+    >
+      <attribute
+          name="attributes"
+          description="space-separated list of attribute names" />
+      <attribute
+          name="interface"
+          description="the resolvable name of an interface" />
+    </subdirective>
+    <subdirective
+        name="factory"
+        description="Specify the factory used to create this
+            content object"
+    >
+      <attribute
+          name="permission"
+          description="permission id required to use this factory.
+              Although optional, this attribute should normally
+              be specified." />
+      <attribute
+          name="id"
+          description="the identifier for this factory in the
+              ZMI factory identification scheme.  If not given, defaults
+              to the literal string given as the content directive's
+              'class' attribute." />
+      <attribute
+          name="title"
+          description="text suitable for use in the 'add content' menu of
+              a management interface" />
+      <attribute
+          name="description"
+          description="longer narrative description of what this
+              factory does" />
+    </subdirective> 
+  </directive>
+</directives>
 
 </zopeConfigure>