[Commits] (pavlov) removing old Import/Export code and the unneeded/broken get/put/syncCollection methods

commits at osafoundation.org commits at osafoundation.org
Tue Aug 17 11:42:25 PDT 2004


Commit by: pavlov
Modified files:
chandler/parcels/osaf/framework/webdav/Dav.py 1.5 1.6
chandler/parcels/osaf/framework/webdav/Export.py 1.6 None
chandler/parcels/osaf/framework/webdav/Import.py 1.6 None

Log message:
removing old Import/Export code and the unneeded/broken get/put/syncCollection methods


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Dav.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.6
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Export.py.diff?r1=text&tr1=1.6&r2=text&tr2=None
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Import.py.diff?r1=text&tr1=1.6&r2=text&tr2=None

Index: chandler/parcels/osaf/framework/webdav/Dav.py
diff -u chandler/parcels/osaf/framework/webdav/Dav.py:1.5 chandler/parcels/osaf/framework/webdav/Dav.py:1.6
--- chandler/parcels/osaf/framework/webdav/Dav.py:1.5	Mon Aug 16 17:26:42 2004
+++ chandler/parcels/osaf/framework/webdav/Dav.py	Tue Aug 17 11:42:24 2004
@@ -4,7 +4,7 @@
 from repository.util.URL import URL
 
 import application.Globals as Globals
-import Import, Export, Sync
+import Sync
 
 """
  * If I make ItemCollections use a refcollection under the hood as a real attribute
@@ -53,80 +53,16 @@
         self.sync(item)
 
     def sync(self, item):
-        return Sync.syncItem(self, item)
-
-
-    etag = property(_getETag)
-    lastModified = property(_getLastModified)
-
-
-    def getCollection(self):
-        # this code can't work.
-        """ gives back a new ItemCollection """
-        collection = self.get()
-
-        # XXX i really don't like duplicating the code in Import.py
-        listXmlGoop = collection._getAttribute('http://www.osafoundation.org/', 'items')
-        nodes = Import.makeAndParse(listXmlGoop)
-
-        for node in nodes:
-            item = DAV(node.content).get()
-            collection.add(item)
-
-        # figure out properties of the collection itself.. I should share code
-        # with Import.py here..
-        # get a listing of all items in the collection... propfind depth 1
-
-        # make a new ItemCollection based on the properties of the dav
-        # collection        if not changed:
-
-        # for each resource found in the dav collection, get it and add it to
-        # our itemcollection
-
-
-
-    def putCollection(self, itemCollection):
         """
-        returns a url to a webdav collection containing
-        all of the items in 'itemCollection'
+        clouds = item.itsKind.getClouds('default')
+        for cloud in clouds:
+            for i in cloud.getItems(item):
+                Sync.syncItem(self, i)
         """
-        # just put the item collection as a normal item first
-        self.put(itemCollection)
+        Sync.syncItem(self, item)
 
-        # then attatch extra data to it
-        itemList = '<o:items xmlns:o="http://www.osafoundation.org/">'
-
-        for item in itemCollection:
-            itemURL = self.url.join(item.itsUUID.str16())
-            DAV(itemURL).put(item)
-            itemList = itemList + '<itemref>' + unicode(itemURL) + '</itemref>'
-
-        itemList = itemList + '</o:items>'
-
-        self.newConnection().setprops2(unicode(self.url), itemList)
-
-        return self.url
-
-
-
-
-    def syncCollection(self, itemCollection):
-        """ gives back a new ItemCollection """
-        # this will update the itemcollection if needed
-        self.sync(itemCollection)
-
-
-        # if the collection item itself hasn't changed, sync up the current
-        # items in the collection
-        for item in itemCollection:
-            DAV(item.sharedURL).sync(item)
-            
-            listXmlGoop = collection._getAttribute('http://www.osafoundation.org/', 'items')
-            nodes = Import.makeAndParse(listXmlGoop)
-
-            for node in nodes:
-                item = DAV(node.content).get()
-                collection.add(item)
+    etag = property(_getETag)
+    lastModified = property(_getLastModified)
 
 
 class DAVConnection(davlib.DAV):



More information about the Commits mailing list