[Zope3-checkins] CVS: Zope3/src/zope/app/contentdirective - contentdirective.py:1.11

Philipp von Weitershausen philikon@philikon.de
Wed, 9 Apr 2003 16:52:01 -0400


Update of /cvs-repository/Zope3/src/zope/app/contentdirective
In directory cvs.zope.org:/tmp/cvs-serv3948/contentdirective

Modified Files:
	contentdirective.py 
Log Message:
* introduced IXMLRepresentable interface for objects representing xml.

* introduced a new ZCML directive to register XML Schemas as interfaces
  by specifying their URI.

* changed the way interfaces are resolved in all configuration directives
  and some other places. Thus, you can now also specify the URI of an
  XML schema instead of a dotted interface name everywhere you are required
  to specify an interface name.


=== Zope3/src/zope/app/contentdirective/contentdirective.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/contentdirective/contentdirective.py:1.10	Fri Mar 21 16:03:41 2003
+++ Zope3/src/zope/app/contentdirective/contentdirective.py	Wed Apr  9 16:51:31 2003
@@ -24,6 +24,7 @@
 from zope.configuration.exceptions import ConfigurationError
 from zope.configuration.action import Action
 from zope.app.component.classfactory import ClassFactory
+from zope.app.component.metaconfigure import resolveInterface
 from zope.app.security.protectclass \
     import protectLikeUnto, protectName, checkPermission, protectSetAttribute
 from zope.app.security.registries.permissionregistry import permissionRegistry
@@ -65,7 +66,7 @@
         r = []
         for interface in interface.strip().split():
 
-            resolved_interface = _context.resolve(interface)
+            resolved_interface = resolveInterface(_context, interface)
             r += [
                 Action(
                     discriminator = ('ContentDirective', self.__class, object()),
@@ -137,7 +138,7 @@
 
     def __protectByInterface(self, interface, permission_id, r):
         "Set a permission on names in an interface."
-        interface = self.__context.resolve(interface)
+        interface = resolveInterface(self.__context, interface)
         for n, d in interface.namesAndDescriptions(1):
             self.__protectName(n, permission_id, r)
         r.append(
@@ -170,7 +171,7 @@
 
     def __protectSetSchema(self, schema, permission_id, r):
         "Set a permission on a bunch of names."
-        schema = self.__context.resolve(schema)
+        schema = resolveInterface(self.__context, schema)
         for name in schema:
             field = schema[name]
             if IField.isImplementedBy(field) and not field.readonly: