[Zope3-checkins] SVN: Zope3/trunk/src/ Merged from ZopeX3-3.0 branch:

Jim Fulton jim at zope.com
Fri Aug 27 17:22:43 EDT 2004


Log message for revision 27311:
  Merged from ZopeX3-3.0 branch:
  
    r27290 | jim | 2004-08-27 10:28:21 -0400 (Fri, 27 Aug 2004) | 12 lines
  
  Refactored xmlrpc:
  
  - Made it possible to define xml-rpc methods on content. This made the
    "default view" mechanism unnecessary.
  
  - Removed the default-view mechanism.  This is backward incompatable, 
    but it's better to do this now, rather than after X3.0.
  
  This allowed the custom publication object to basically go away.
  
  - Added documentation in the form of a doctest.
  


Changed:
  U   Zope3/trunk/src/bugtracker/configure.zcml
  U   Zope3/trunk/src/zope/app/i18n/xmlrpc/configure.zcml
  U   Zope3/trunk/src/zope/app/publication/tests/test_xmlrpcpublication.py
  U   Zope3/trunk/src/zope/app/publication/xmlrpc.py
  A   Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/__init__.py
  A   Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/meta.zcml
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/metaconfigure.py
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/metadirectives.py
  A   Zope3/trunk/src/zope/app/publisher/xmlrpc/t
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/test_directives.py
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc.zcml
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml


-=-
Modified: Zope3/trunk/src/bugtracker/configure.zcml
===================================================================
--- Zope3/trunk/src/bugtracker/configure.zcml	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/bugtracker/configure.zcml	2004-08-27 21:22:43 UTC (rev 27311)
@@ -326,42 +326,27 @@
 
   <!-- XML-RPC presentation -->
   <xmlrpc:view
-      name="methods"
       for=".interfaces.IBugTracker"
       permission="bugtracker.ViewBug" 
-      allowed_attributes="getBugNames addBug deleteBug"
+      methods="getBugNames addBug deleteBug"
       class=".xmlrpc.BugTrackerMethods" />
 
-  <xmlrpc:defaultView
-      name="methods"
-      for=".interfaces.IBugTracker" />
-
   <xmlrpc:view
-      name="methods"
       for=".interfaces.IBug"
       permission="bugtracker.ViewBug" 
-      allowed_attributes="getProperties setProperties 
+      methods="getProperties setProperties 
                        getCommentNames addComment deleteComment
                        getAttachmentNames addAttachment deleteAttachment
                        "
       class=".xmlrpc.BugMethods" />
 
-  <xmlrpc:defaultView
-      name="methods"
-      for=".interfaces.IBug" />
-
   <xmlrpc:view
-      name="methods"
       for=".interfaces.IComment"
       permission="bugtracker.ViewBug" 
-      allowed_attributes="getBody setBody"
+      methods="getBody setBody"
       class=".xmlrpc.CommentMethods" />
 
-  <xmlrpc:defaultView
-      name="methods"
-      for=".interfaces.IComment" />
 
-
   <!-- Register Mailer and Mail Service -->
 
   <mail:smtpMailer name="bugs-smtp" hostname="localhost" port="25" />

Modified: Zope3/trunk/src/zope/app/i18n/xmlrpc/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/i18n/xmlrpc/configure.zcml	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/i18n/xmlrpc/configure.zcml	2004-08-27 21:22:43 UTC (rev 27311)
@@ -6,15 +6,11 @@
   <!-- Translation Domain View Directives -->
 
   <xmlrpc:view
-      name="methods"
       for="zope.i18n.interfaces.ITranslationDomain"
       permission="zope.ManageContent" 
-      allowed_attributes="getAllLanguages getMessagesFor"
-      class=".methods.Methods" />
+      methods="getAllLanguages getMessagesFor"
+      class=".methods.Methods" 
+      />
       
-  <xmlrpc:defaultView
-      name="methods"
-      for="zope.i18n.interfaces.ITranslationDomain" />
-     
 
 </configure>

Modified: Zope3/trunk/src/zope/app/publication/tests/test_xmlrpcpublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/tests/test_xmlrpcpublication.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publication/tests/test_xmlrpcpublication.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -30,6 +30,7 @@
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
 from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
 from zope.publisher.xmlrpc import TestRequest
+from zope.app.tests import ztapi
 
 
 class SimpleObject(object):
@@ -99,6 +100,14 @@
                 pass
             implements(IXMLRPCPresentation)
 
+
+        # Register the simple traverser so we can traverse without @@
+        from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
+        from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
+        from zope.app.publication.traversers import SimpleComponentTraverser
+        ztapi.provideView(Interface, IXMLRPCRequest, IXMLRPCPublisher, '',
+                          SimpleComponentTraverser)
+
         r = self._createRequest('/@@spam', pub)
         provideView = getService(Presentation).provideView
         provideView(I, 'spam', IXMLRPCRequest, V)
@@ -109,39 +118,6 @@
         self.assertEqual(removeAllProxies(ob2).__class__, V)
         
 
-    def testTraverseNameDefaultView(self):
-        pub = self.klass(self.db)
-
-        class I(Interface):
-            pass
-
-        class C(object):
-            implements(I)
-
-        ob = C()
-
-        class V(object):
-            implements(IXMLRPCPresentation)
-
-            def __init__(self, context, request):
-                pass
-
-            def spam(self):
-                return 'foo'
-
-        r = self._createRequest('/spam', pub)
-        provideView = getService(Presentation).provideView
-        setDefaultViewName = getService(Presentation).setDefaultViewName
-        provideView(I, 'view', IXMLRPCRequest, V)
-        setDefaultViewName(I, IXMLRPCRequest, 'view')
-
-        ob2 = pub.traverseName(r, ob, '@@spam')
-        self.assertEqual(removeAllProxies(ob2).__name__, V.spam.__name__)
-
-        ob2 = pub.traverseName(r, ob, 'spam')
-        self.assertEqual(removeAllProxies(ob2).__name__, V.spam.__name__)
-
-
     def testTraverseNameServices(self):
         pub = self.klass(self.db)
         class C(object):

Modified: Zope3/trunk/src/zope/app/publication/xmlrpc.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/xmlrpc.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publication/xmlrpc.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -19,67 +19,11 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.component import queryView, queryDefaultViewName
-from zope.proxy import removeAllProxies
-from zope.app.publisher.interfaces.xmlrpc import IXMLRPCPresentation
-from zope.security.checker import ProxyFactory
 from zope.app.publication.http import BaseHTTPPublication
 
-class XMLRPCPublication(BaseHTTPPublication):
-    """XML-RPC publication handling."""
+# Don't need any special handling for xml-rpc
+XMLRPCPublication = BaseHTTPPublication
 
-    def traverseName(self, request, ob, name):
-        """Traverse the name.
-
-        The method should try the following things in this order:
-
-        1. Check whether `ob` is a view; if so try to find a public method
-           having the passed name.
-
-        2. If `ob` is not a view, then we try to find a view for it. This
-           can be done in two ways:
-
-           (a) Look whether there is a view registered for this name.
-
-           (b) Check whether the default view has a matching method called
-           name.
-
-        3. See whether the object has a subobject of this name. This test is
-           done last, since this is done by `ZopePublication`, and it knows how
-           to create all the correct error messages. No need for us to do that.
-
-        """
-        naked_ob = removeAllProxies(ob)
-
-        # Use the real view name
-        view_name = name
-        if view_name.startswith('@@'):
-            view_name = view_name[2:]
-
-        # If ob is a presentation object, then we just get the method
-        if (IXMLRPCPresentation.providedBy(naked_ob) and 
-            hasattr(ob, view_name)
-            ):
-            return ProxyFactory(getattr(ob, view_name))
-
-        # Let's check whether name could be a view 
-        view = queryView(ob, view_name, request)
-        if view is not None:
-            return ProxyFactory(view)
-
-        # Now let's see whether we have a default view with a matching method
-        # name
-        defaultName = queryDefaultViewName(ob, request)
-
-        if defaultName is not None:
-            view = queryView(ob, defaultName, request, object)
-            if hasattr(view, view_name):
-                return ProxyFactory(getattr(view, view_name))
-
-        # See whether we have a subobject
-        return super(XMLRPCPublication, self).traverseName(request, ob, name)
-
-# For now, have a factory that returns a singleton
 class XMLRPCPublicationFactory(object):
 
     def __init__(self, db):

Copied: Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt (from rev 27290, Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/xmlrpc/README.txt)


Property changes on: Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/__init__.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/__init__.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -28,3 +28,4 @@
     def __init__(self, context, request):
         self.context = context
         self.request = request
+

Copied: Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py (from rev 27290, Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/xmlrpc/ftests.py)


Property changes on: Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/meta.zcml	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/meta.zcml	2004-08-27 21:22:43 UTC (rev 27311)
@@ -8,10 +8,4 @@
        schema=".metadirectives.IViewDirective"
        handler=".metaconfigure.view" />
 
-  <meta:directive
-      namespace="http://namespaces.zope.org/xmlrpc"
-      name="defaultView"
-      schema=".metadirectives.IDefaultViewDirective"
-      handler=".metaconfigure.defaultView" />
-
 </configure>

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/metaconfigure.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/metaconfigure.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -17,78 +17,108 @@
 """
 
 from zope.component.servicenames import Presentation
+from zope.configuration.exceptions import ConfigurationError
 from zope.app.component.metaconfigure import handler
-from zope.configuration.exceptions import ConfigurationError
+import zope.interface
+
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
 from zope.security.checker import CheckerPublic, Checker
 from zope.app.component.interface import provideInterface
 
+import zope.app.location
 
-def view(_context, name, class_=None, for_=None, layer=None,
-         permission=None, allowed_interface=None, allowed_attributes=None):
-
-    if layer is not None:
-        raise ConfigurationError("Layers are not supported for XML-RPC.")
+def view(_context, for_=None, interface=None, methods=None,
+         class_=None,  permission=None, name=None):
     
-    if name is None:
-        raise ConfigurationError("You must specify a view name.") 
-    
-    if ((allowed_attributes or allowed_interface)
-        and ((name is None) or not permission)):
-        raise ConfigurationError(
-            "Must use name attribute with allowed_interface or "
-            "allowed_attributes"
-            )
-    
-    allowed_interface = allowed_interface or []
-    allowed_attributes = allowed_attributes or []
+    interface = interface or []
+    methods = methods or []
 
     # If there were special permission settings provided, then use them
-    if permission:
-        if permission == 'zope.Public':
-            permission = CheckerPublic
-    
-        require = {}
-        for attr_name in allowed_attributes:
-            require[attr_name] = permission
-    
-        if allowed_interface:
-            for iface in allowed_interface:
-                for field_name in iface:
-                    require[field_name] = permission
-    
-        checker = Checker(require)
-    
-        def proxyView(context, request, class_=class_, checker=checker):
-            view = class_(context, request)
-            # We need this in case the resource gets unwrapped and
-            # needs to be rewrapped
-            view.__Security_checker__ = checker
-            return view
-    
-        class_ =  proxyView
+    if permission == 'zope.Public':
+        permission = CheckerPublic
 
-    # Register the new view.
-    _context.action(
-        discriminator = ('view', tuple(for_), name, IXMLRPCRequest),
-        callable = handler,
-        args = (Presentation, 'provideAdapter', IXMLRPCRequest, class_,
-                name, for_) )
+    require = {}
+    for attr_name in methods:
+        require[attr_name] = permission
 
-    # Register the used interfaces with the interface service
-    for iface in for_:
-        if iface is not None:
+    if interface:
+        for iface in interface:
+            for field_name in iface:
+                require[field_name] = permission
             _context.action(
                 discriminator = None,
                 callable = provideInterface,
-                args = ('', iface)
+                args = ('', for_)
                 )
+
+    if name:
+        # Register a single view
         
+        if permission:
+            checker = Checker(require)
 
-def defaultView(_context, name, for_=None):
-    """Declare the view having the passed name as the default view."""
-    _context.action(
-        discriminator = ('defaultViewName', for_, IXMLRPCRequest, name),
-        callable = handler,
-        args = (Presentation, 'setDefaultViewName', for_, IXMLRPCRequest, name)
-        )
+            def proxyView(context, request, class_=class_, checker=checker):
+                view = class_(context, request)
+                # We need this in case the resource gets unwrapped and
+                # needs to be rewrapped
+                view.__Security_checker__ = checker
+                return view
+
+            class_ =  proxyView
+
+        # Register the new view.
+        _context.action(
+            discriminator = ('view', for_, name, IXMLRPCRequest),
+            callable = handler,
+            args = (Presentation, 'provideAdapter', IXMLRPCRequest, class_,
+                    name, (for_, )) )
+    else:
+        if permission:
+            checker = Checker({'__call__': permission})
+        else:
+            checker = None
+            
+        for name in require:
+            _context.action(
+                discriminator = ('view', for_, name, IXMLRPCRequest),
+                callable = handler,
+                args = (Presentation, 'provideAdapter', IXMLRPCRequest,
+                        MethodFactory(class_, name, checker),
+                        name, (for_, )) )
+
+    # Register the used interfaces with the interface service
+    if for_ is not None:
+        _context.action(
+            discriminator = None,
+            callable = provideInterface,
+            args = ('', for_)
+            )
+        
+
+
+class MethodFactory:
+
+    def __init__(self, cls, name, checker):
+        self.cls, self.name, self.checker = cls, name, checker
+
+    def __call__(self, context, request):
+        ob = self.cls(context, request)
+        ob = getattr(ob, self.name)
+        if self.checker is not None:
+            ob = ProtectedMethod(ob, self.checker)
+        return ob
+
+
+class ProtectedMethod:
+
+    zope.interface.implements(zope.app.location.ILocation)
+
+    __parent__ = __name__ = None
+
+    def __init__(self, ob, checker):
+        self.ob = ob
+        self.__Security_checker__ = checker
+
+    def __call__(self, *args):
+        return self.ob(*args)
+    

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/metadirectives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/metadirectives.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/metadirectives.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -15,42 +15,73 @@
 
 $Id$
 """
-from zope.app.component.metadirectives import IBasicViewInformation
-from zope.configuration.fields import GlobalObject
-from zope.interface import Interface
-from zope.schema import TextLine
+import zope.configuration.fields
+import zope.interface
+import zope.schema
 
-class IViewDirective(IBasicViewInformation):
+import zope.app.security.fields
+
+class IViewDirective(zope.interface.Interface):
     """View Directive for XML-RPC methods."""
+    
+    for_ = zope.configuration.fields.GlobalObject(
+        title=u"Published Object Type",
+        description=u"""The types of objects to be published via XML-RPC
 
-    name = TextLine(
-        title=u"The name of the view.",
-        description=u"The name shows up in URLs/paths. For example 'foo'.",
-        required=False)
+        This can be expressed with either a class or an interface
+        """,
+        required=True,
+        )
 
+    interface = zope.configuration.fields.Tokens(
+        title=u"Interface to be published.",
+        required=False,
+        value_type=zope.configuration.fields.GlobalObject()
+        )
 
-class IDefaultViewDirective(Interface):
-    """
-    The name of the view that should be the default.
-              
-    This name refers to view that should be the
-    view used by default (if no view name is supplied
-    explicitly).
-    """
-
-    name = TextLine(
-        title=u"The name of the view that should be the default.",
-        description=u"""
-        This name refers to view that should be the view used by
-        default (if no view name is supplied explicitly).""",
-        required=True
+    methods = zope.configuration.fields.Tokens(
+        title=u"Methods (or attributes) to be published",
+        required=False,
+        value_type=zope.configuration.fields.PythonIdentifier()
         )
 
-    for_ = GlobalObject(
-        title=u"The interface this view is the default for.",
-        description=u"""Specifies the interface for which the view is
-        registered. All objects implementing this interface can make use of
-        this view. If this attribute is not specified, the view is available
-        for all objects.""",
+    class_ = zope.configuration.fields.GlobalObject(
+        title=u"Class",
+        description=u"A class that provides attributes used by the view.",
         required=False
         )
+
+    permission = zope.app.security.fields.Permission(
+        title=u"Permission",
+        description=u"""The permission needed to use the view.
+
+        If this option is used and a name is given for the view, then
+        the names defined by the given methods or interfaces will be
+        under the given permission.
+
+        If a name is not given for the view, then, this option is
+        required and the the given permission is required to call the
+        individual views defined by the given interface and methods.
+
+        (See the name attribute.)
+
+        If no permission is given, then permissions should be declared
+        for the view using other means, such as the class directive.
+        """,
+        required=False, )
+
+    name = zope.schema.TextLine(
+        title=u"The name of the view.",
+        description=u"""
+        
+        If a name is given, then rpc methods are accessed by
+        traversing the name and then accessing the methods.  In this
+        case, the class should implement
+        zope.pubisher.interfaces.IPublishTraverse.
+
+        If no name is provided, then the names given by the attributes
+        and interfaces are published directly as callable views.
+
+        """,
+        required=False,
+        )

Copied: Zope3/trunk/src/zope/app/publisher/xmlrpc/t (from rev 27290, Zope3/branches/ZopeX3-3.0/src/zope/app/publisher/xmlrpc/t)

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/test_directives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2004-08-27 21:22:43 UTC (rev 27311)
@@ -43,31 +43,31 @@
 
     def testView(self):
         self.assertEqual(queryView(ob, 'test', request), None)
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         self.assertEqual(queryView(ob, 'test', request).__class__, V1)
 
     def testInterfaceProtectedView(self):
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         v = getView(ob, 'test2', request)
         v = ProxyFactory(v)
         self.assertEqual(v.index(), 'V1 here')
         self.assertRaises(Exception, getattr, v, 'action')
 
     def testAttributeProtectedView(self):
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         v = getView(ob, 'test3', request)
         v = ProxyFactory(v)
         self.assertEqual(v.action(), 'done')
         self.assertRaises(Exception, getattr, v, 'index')
 
     def testInterfaceAndAttributeProtectedView(self):
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         v = getView(ob, 'test4', request)
         self.assertEqual(v.index(), 'V1 here')
         self.assertEqual(v.action(), 'done')
 
     def testDuplicatedInterfaceAndAttributeProtectedView(self):
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         v = getView(ob, 'test5', request)
         self.assertEqual(v.index(), 'V1 here')
         self.assertEqual(v.action(), 'done')
@@ -76,11 +76,16 @@
         self.assertRaises(ConfigurationError, xmlconfig.file,
                           "xmlrpc_error.zcml", xmlrpc.tests)
 
-    def testDefaultView(self):
-        context = xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
-        self.assertEqual(getDefaultViewName(ob, request), 'test')
+    def test_no_name(self):
+        xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
+        v = getView(ob, 'index', request)
+        self.assertEqual(v(), 'V1 here')
+        v = getView(ob, 'action', request)
+        self.assertEqual(v(), 'done')
 
+        
 
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(DirectivesTest),

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc.zcml	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc.zcml	2004-08-27 21:22:43 UTC (rev 27311)
@@ -8,40 +8,46 @@
   <xmlrpc:view 
       name="test"
       class="zope.app.component.tests.views.V1"
-      for="zope.app.component.tests.views.IC" />
+      for="zope.app.component.tests.views.IC" 
+      />
 
   <xmlrpc:view 
       name="test2"
       class="zope.app.component.tests.views.V1"
       for="zope.app.component.tests.views.IC"
       permission="zope.Public"
-      allowed_interface="zope.app.component.tests.views.IV" />
+      interface="zope.app.component.tests.views.IV" 
+      />
 
   <xmlrpc:view 
       name="test3"
       class="zope.app.component.tests.views.V1"
       for="zope.app.component.tests.views.IC"
       permission="zope.Public"
-      allowed_attributes="action" />
+      methods="action" />
 
   <xmlrpc:view 
       name="test4"
       class="zope.app.component.tests.views.V1"
       for="zope.app.component.tests.views.IC"
       permission="zope.Public"
-      allowed_attributes="action"
-      allowed_interface="zope.app.component.tests.views.IV" />
+      methods="action"
+      interface="zope.app.component.tests.views.IV" />
 
   <xmlrpc:view 
       name="test5"
       class="zope.app.component.tests.views.V1"
       for="zope.app.component.tests.views.IC"
       permission="zope.Public"
-      allowed_attributes="action index"
-      allowed_interface="zope.app.component.tests.views.IV" />
+      methods="action index"
+      interface="zope.app.component.tests.views.IV" />
 
-  <xmlrpc:defaultView 
-      name="test"
-      for="zope.app.component.tests.views.IC" />
+ 
+  <xmlrpc:view 
+      class="zope.app.component.tests.views.V1"
+      for="zope.app.component.tests.views.IC" 
+      interface="zope.app.component.tests.views.IV"
+      methods="action"
+      />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml	2004-08-27 21:06:15 UTC (rev 27310)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml	2004-08-27 21:22:43 UTC (rev 27311)
@@ -8,6 +8,6 @@
         name="test"
         factory="zope.component.tests.views.V1"
         for="zope.component.tests.views.IC"
-        allowed_attributes="action index" />
+        methods="action index" />
 
 </configure>



More information about the Zope3-Checkins mailing list