[Zope3-checkins] SVN: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ Oops, revert accidental checkins; previous change only applied to one test

Martijn Pieters mj at zopatista.com
Sun Oct 10 12:48:30 EDT 2004


Log message for revision 27925:
  Oops, revert accidental checkins; previous change only applied to one test
  file.
  


Changed:
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/configure.zcml
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py
  D   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py
  D   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespacesadapter.py
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py


-=-
Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/configure.zcml
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/configure.zcml	2004-10-10 16:47:54 UTC (rev 27924)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/configure.zcml	2004-10-10 16:48:30 UTC (rev 27925)
@@ -107,23 +107,7 @@
       for="*"
       permission="zope.Public"
       factory=".adapter.DAVSchemaAdapter" />
-
-  <!-- XXX: This interface needs to be split up so we can apply seperate 
-       permissions for reading and writing -->
-  <adapter
-      factory=".opaquenamespacesadapter.DAVOpaqueNamespacesAdapter"
-      provides="zope.app.dav.interfaces.IDAVOpaqueNamespaces"
-      for="zope.app.annotation.interfaces.IAnnotatable"
-      trusted="true"
-      />
-      
-  <class class=".opaquenamespacesadapter.DAVOpaqueNamespacesAdapter">
-    <require
-        permission="zope.ManageContent"
-        interface=".interfaces.IDAVOpaqueNamespaces"
-        />
-  </class>
-
+  
   <dav:provideInterface
       for="http://purl.org/dc/1.1"
       interface="zope.app.dublincore.interfaces.IZopeDublinCore" />

Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py	2004-10-10 16:47:54 UTC (rev 27924)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/interfaces.py	2004-10-10 16:48:30 UTC (rev 27925)
@@ -18,7 +18,6 @@
 __docformat__ = 'restructuredtext'
 
 from zope.interface import Interface
-from zope.interface.common.mapping import IMapping
 from zope.schema import Text
 from zope.app.form.interfaces import IWidget
 
@@ -204,12 +203,3 @@
 class ISequenceDAVWidget(IDAVWidget):
     """A DAV widget for sequences."""
 
-
-class IDAVOpaqueNamespaces(IMapping):
-    """Opaque storage for non-registered DAV namespace properties.
-
-    Any unknown (no interface registered) DAV properties are stored opaquely
-    keyed on their namespace URI, so we can return them later when requested.
-    Thus this is a mapping of a mapping.
-    
-    """

Deleted: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py	2004-10-10 16:47:54 UTC (rev 27924)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py	2004-10-10 16:48:30 UTC (rev 27925)
@@ -1,53 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Attribute Annotations implementation 
-
-$Id: attribute.py 26632 2004-07-19 14:56:53Z jim $
-"""
-__docformat__ = 'restructuredtext'
-
-from UserDict import DictMixin
-
-from zope.interface import implements
-
-from interfaces import IDAVOpaqueNamespaces
-
-
-class DAVOpaqueNamespaces(DictMixin):
-    """Opaque storage for DAV properties."""
-    
-    implements(IDAVOpaqueNamespaces)
-
-    def __init__(self, mapping=None):
-        if mapping is None:
-            mapping = {}
-        self._mapping = mapping
-        
-    def _changed(self):
-        self._p_changed = True
-
-    def get(self, key, default=None):
-        self._mapping.get(key, default)
-
-    def __getitem__(self, key):
-        return self._mapping[key]
-        
-    def keys(self):
-        return self._mapping.keys()
-    
-    def __setitem__(self, key, value):
-        self._mapping[key] = value
-
-    def __delitem__(self, key):
-        del self._mapping[key]

Deleted: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespacesadapter.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespacesadapter.py	2004-10-10 16:47:54 UTC (rev 27924)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespacesadapter.py	2004-10-10 16:48:30 UTC (rev 27925)
@@ -1,48 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""DAV Opaque Properties Annotatable Adapter
-
-$Id: annotatableadapter.py 26734 2004-07-23 21:55:49Z pruggera $
-"""
-__docformat__ = 'restructuredtext'
-
-from BTrees.OOBTree import OOBTree
-
-from zope.app.annotation.interfaces import IAnnotations, IAnnotatable
-from zope.app.dav.opaquenamespaces import DAVOpaqueNamespaces
-from zope.app.location import Location
-
-DANkey = "zope.app.dav.DAVOpaqueProperties"
-
-
-class DAVOpaqueNamespacesAdapter(DAVOpaqueNamespaces, Location):
-    """Adapt annotatable objects to DAV opaque property storage."""
-
-    __used_for__ = IAnnotatable
-
-    annotations = None
-
-    def __init__(self, context):
-        annotations = IAnnotations(context)
-        oprops = annotations.get(DANkey)
-        if oprops is None:
-            self.annotations = annotations
-            oprops = OOBTree()
-
-        super(DAVOpaqueNamespacesAdapter, self).__init__(oprops)
-
-    def _changed(self):
-        if self.annotations is not None:
-            self.annotations[DANkey] = self._mapping
-            self.annotations = None

Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py	2004-10-10 16:47:54 UTC (rev 27924)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/propfind.py	2004-10-10 16:48:30 UTC (rev 27925)
@@ -19,7 +19,7 @@
 from zope.schema import getFieldNamesInOrder
 from zope.app import zapi
 from zope.app.container.interfaces import IReadContainer
-from zope.app.dav.interfaces import IDAVWidget, IDAVOpaqueNamespaces
+from zope.app.dav.interfaces import IDAVWidget
 from zope.app.form.utility import setUpWidgets
 
 from interfaces import IDAVNamespace
@@ -78,15 +78,11 @@
         r_url = response.createTextNode(resource_url)
         href.appendChild(r_url)
         _avail_props = {}
-        
-        # List all *registered* DAV interface namespaces and their properties
+        # TODO: For now, list the propnames for the all namespaces
+        # but later on, we need to list *all* propnames from *all* known
+        # namespaces that this object has.
         for ns, iface in zapi.getUtilitiesFor(IDAVNamespace):
             _avail_props[ns] = getFieldNamesInOrder(iface)
-            
-        # List all opaque DAV namespaces and the properties we know of
-        for ns, oprops in IDAVOpaqueNamespaces(self.context, {}).items():
-            _avail_props[ns] = oprops.keys()
-        
         propname = xmldoc.getElementsByTagNameNS(self.default_ns, 'propname')
         if propname:
             self._handlePropname(response, re, _avail_props)



More information about the Zope3-Checkins mailing list