[Commits] (pavlov) making sharing use clouds for exporting

commits at osafoundation.org commits at osafoundation.org
Mon Aug 23 14:11:02 PDT 2004


Commit by: pavlov
Modified files:
chandler/parcels/osaf/framework/webdav/DAVItem.py 1.8 1.9
chandler/parcels/osaf/framework/webdav/Dav.py 1.10 1.11
chandler/parcels/osaf/framework/webdav/Sync.py 1.11 1.12
chandler/parcels/osaf/framework/webdav/TestDAV.py 1.6 1.7

Log message:
making sharing use clouds for exporting
fixing DAVItem(headersOnly=True) to only get uuid and kind and not all the other properties


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/DAVItem.py.diff?r1=text&tr1=1.8&r2=text&tr2=1.9
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Dav.py.diff?r1=text&tr1=1.10&r2=text&tr2=1.11
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Sync.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/TestDAV.py.diff?r1=text&tr1=1.6&r2=text&tr2=1.7

Index: chandler/parcels/osaf/framework/webdav/Dav.py
diff -u chandler/parcels/osaf/framework/webdav/Dav.py:1.10 chandler/parcels/osaf/framework/webdav/Dav.py:1.11
--- chandler/parcels/osaf/framework/webdav/Dav.py:1.10	Fri Aug 20 11:20:27 2004
+++ chandler/parcels/osaf/framework/webdav/Dav.py	Mon Aug 23 14:11:01 2004
@@ -74,15 +74,18 @@
         else:
             item.sharedURL = self.url
 
-        self.sync(item)
-
-    def sync(self, item):
-        """
         clouds = item.itsKind.getClouds('default')
         for cloud in clouds:
             for i in cloud.getItems(item):
-                Sync.syncItem(self, i)
-        """
+                defaultURL = self.url.join(i.itsUUID.str16())
+                durl = i.getAttributeValue('sharedURL', default=defaultURL)
+                i.sharedURL = durl
+                sharing.itemMap[i.itsUUID] = i.itsUUID
+                DAV(durl).sync(i)
+
+        #self.sync(item)
+
+    def sync(self, item):
         Sync.syncItem(self, item)
 
     etag = property(_getETag)

Index: chandler/parcels/osaf/framework/webdav/DAVItem.py
diff -u chandler/parcels/osaf/framework/webdav/DAVItem.py:1.8 chandler/parcels/osaf/framework/webdav/DAVItem.py:1.9
--- chandler/parcels/osaf/framework/webdav/DAVItem.py:1.8	Fri Aug 20 11:20:27 2004
+++ chandler/parcels/osaf/framework/webdav/DAVItem.py	Mon Aug 23 14:11:01 2004
@@ -30,15 +30,16 @@
 
     def _getprops(self, url, headersOnly=False):
         """ Fetch all the properties of a resource """
-        # XXX this doesn't work, but should...
-        #        if headersOnly:
-        #            props = '<O:uuid/><O:kind/>'
-        #        else:
-        #            props = '<D:allprop/>'
+        if headersOnly:
+            props = '<D:prop>' + \
+                    '<O:uuid/><O:kind/><D:getetag/><D:getlastmodified/>' + \
+                    '</D:prop>'
+        else:
+            props = '<D:allprop/><D:getetag/><D:getlastmodified/>'
 
         body = davlib.XML_DOC_HEADER + \
                '<D:propfind xmlns:D="DAV:" xmlns:O="//core">' + \
-               '<D:allprop/><D:getetag/><D:getlastmodified/>' + \
+               props + \
                '</D:propfind>'
 
         r = self.dav.newConnection().propfind(url, body, 0)

Index: chandler/parcels/osaf/framework/webdav/Sync.py
diff -u chandler/parcels/osaf/framework/webdav/Sync.py:1.11 chandler/parcels/osaf/framework/webdav/Sync.py:1.12
--- chandler/parcels/osaf/framework/webdav/Sync.py:1.11	Mon Aug 23 13:35:48 2004
+++ chandler/parcels/osaf/framework/webdav/Sync.py	Mon Aug 23 14:11:01 2004
@@ -116,7 +116,7 @@
                     defaultURL = dav.url.join(i.itsUUID.str16())
                     durl = i.getAttributeValue('sharedURL', default=defaultURL)
                     # mmm, recursion
-                    DAV(durl).put(i)
+                    #DAV(durl).put(i)
                     listData += '<itemref>' + unicode(durl) + '</itemref>'
                 else:
                     #XXX fix this (Value is a PersistentList here??)
@@ -128,7 +128,7 @@
             if isinstance(value, Item):
                 defaultURL = dav.url.join(value.itsUUID.str16())
                 durl = value.getAttributeValue('sharedURL', default=defaultURL)
-                DAV(durl).put(value)
+                #DAV(durl).put(value)
                 props += makePropString(name, namespace, '<itemref>%s</itemref>' % (unicode(durl)))
             else:
                 atypepath = "%s" % (atype.itsPath)

Index: chandler/parcels/osaf/framework/webdav/TestDAV.py
diff -u chandler/parcels/osaf/framework/webdav/TestDAV.py:1.6 chandler/parcels/osaf/framework/webdav/TestDAV.py:1.7
--- chandler/parcels/osaf/framework/webdav/TestDAV.py:1.6	Fri Aug 20 11:39:24 2004
+++ chandler/parcels/osaf/framework/webdav/TestDAV.py	Mon Aug 23 14:11:01 2004
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.6 $"
-__date__      = "$Date: 2004/08/20 18:39:24 $"
+__revision__  = "$Revision: 1.7 $"
+__date__      = "$Date: 2004/08/23 21:11:01 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -52,6 +52,7 @@
         if testExportCollection:
             # export item collections
             ic = ItemCollection.NamedCollection()
+            ic.displayName = "DAV Test Collection"
             for index in range(3):
                 ic.add(GenerateItems.GenerateCalendarEvent(100))
 



More information about the Commits mailing list