[CalendarServer-changes] [5635] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Thu May 20 13:03:36 PDT 2010


Revision: 5635
          http://trac.macosforge.org/projects/calendarserver/changeset/5635
Author:   cdaboo at apple.com
Date:     2010-05-20 13:03:34 -0700 (Thu, 20 May 2010)
Log Message:
-----------
Support for CS:shared-url property.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/customxml.py
    CalendarServer/trunk/twistedcaldav/resource.py

Modified: CalendarServer/trunk/twistedcaldav/customxml.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/customxml.py	2010-05-20 20:02:36 UTC (rev 5634)
+++ CalendarServer/trunk/twistedcaldav/customxml.py	2010-05-20 20:03:34 UTC (rev 5635)
@@ -687,6 +687,8 @@
     """
     namespace = calendarserver_namespace
     name = "shared-url"
+    protected = True
+    hidden = True
 
 class SharedAs (davxml.WebDAVElement):
     """

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2010-05-20 20:02:36 UTC (rev 5634)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2010-05-20 20:03:34 UTC (rev 5635)
@@ -195,6 +195,7 @@
                 baseProperties += (
                     customxml.Invite.qname(),
                     customxml.AllowedSharingModes.qname(),
+                    customxml.SharedURL.qname(),
                 )
 
             elif config.Sharing.AddressBooks.Enabled and self.isAddressBookCollection():
@@ -415,6 +416,14 @@
             elif config.Sharing.Enabled and config.Sharing.AddressBooks.Enabled and self.isAddressBookCollection():
                 returnValue(customxml.AllowedSharingModes(customxml.CanBeShared()))
 
+        elif qname == customxml.SharedURL.qname():
+            isvirt = (yield self.isVirtualShare(request))
+            
+            if isvirt:
+                returnValue(customxml.SharedURL(davxml.HRef.fromString(self._share.hosturl)))
+            else:
+                returnValue(None)
+
         result = (yield super(CalDAVResource, self).readProperty(property, request))
         returnValue(result)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100520/e8285301/attachment-0001.html>


More information about the calendarserver-changes mailing list