[CalendarServer-changes] [6416] CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Oct 12 13:20:27 PDT 2010


Revision: 6416
          http://trac.macosforge.org/projects/calendarserver/changeset/6416
Author:   cdaboo at apple.com
Date:     2010-10-12 13:20:26 -0700 (Tue, 12 Oct 2010)
Log Message:
-----------
Make sure directory gateway has the correct properties on it. Sync report is disabled.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py

Modified: CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py	2010-10-12 20:17:45 UTC (rev 6415)
+++ CalendarServer/trunk/twistedcaldav/directorybackedaddressbook.py	2010-10-12 20:20:26 UTC (rev 6416)
@@ -25,6 +25,7 @@
 from twext.python.log import Logger
 from twext.web2 import responsecode
 from twext.web2.dav import davxml
+from twext.web2.dav.element.extensions import SyncCollection
 from twext.web2.dav.resource import TwistedACLInheritable
 from twext.web2.http import HTTPError, StatusResponse
 
@@ -34,6 +35,8 @@
 from twistedcaldav.config import config
 from twistedcaldav.resource import CalDAVResource
 
+import uuid
+
 log = Logger()
 
 
@@ -113,9 +116,23 @@
            ),
         )
 
+    def supportedReports(self):
+        result = super(DirectoryBackedAddressBookResource, self).supportedReports()
+        if config.EnableSyncReport:
+            # Not supported on the directory backed address book
+            result.remove(davxml.Report(SyncCollection(),))
+        return result
+
     def resourceType(self):
         return davxml.ResourceType.directory
 
+    def resourceID(self):
+        if self.directory:
+            resource_id = uuid.uuid5(uuid.UUID("5AAD67BF-86DD-42D7-9161-6AF977E4DAA3"), self.directory.baseGUID).urn
+        else:
+            resource_id = "tag:unknown"
+        return resource_id
+
     def isDirectoryBackedAddressBookCollection(self):
         return True
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101012/fcda571e/attachment.html>


More information about the calendarserver-changes mailing list