[CalendarServer-changes] [12700] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:17:23 PDT 2014


Revision: 12700
          http://trac.calendarserver.org//changeset/12700
Author:   cdaboo at apple.com
Date:     2014-02-14 09:58:44 -0800 (Fri, 14 Feb 2014)
Log Message:
-----------
Need to correctly handle WebDAV properties that are dynamically computed by the server and may not be present if empty, i.e. not quite live properties and not quite dead properties - hrrm zombie properties!

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/storebridge.py
    CalendarServer/trunk/txweb2/dav/resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2014-02-14 16:28:01 UTC (rev 12699)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2014-02-14 17:58:44 UTC (rev 12700)
@@ -2440,6 +2440,12 @@
         return existing
 
 
+    def dynamicProperties(self):
+        return super(CalendarHomeResource, self).dynamicProperties() + tuple(
+            DefaultAlarmPropertyMixin.ALARM_PROPERTIES.keys()
+        )
+
+
     def _hasGlobalProperty(self, property, request):
         """
         Need to special case schedule-calendar-transp for backwards compatability.
@@ -2936,6 +2942,7 @@
         req.credentialFactories = factories
 
 
+
 ##
 # Utilities
 ##

Modified: CalendarServer/trunk/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/storebridge.py	2014-02-14 16:28:01 UTC (rev 12699)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py	2014-02-14 17:58:44 UTC (rev 12700)
@@ -1223,6 +1223,14 @@
         return caldavxml.CalendarData
 
 
+    def dynamicProperties(self):
+        return super(CalendarCollectionResource, self).dynamicProperties() + tuple(
+            DefaultAlarmPropertyMixin.ALARM_PROPERTIES.keys()
+        ) + (
+            caldavxml.CalendarTimeZone.qname(),
+        )
+
+
     def _hasGlobalProperty(self, property, request):
         """
         Need to special case schedule-calendar-transp for backwards compatability.

Modified: CalendarServer/trunk/txweb2/dav/resource.py
===================================================================
--- CalendarServer/trunk/txweb2/dav/resource.py	2014-02-14 16:28:01 UTC (rev 12699)
+++ CalendarServer/trunk/txweb2/dav/resource.py	2014-02-14 17:58:44 UTC (rev 12700)
@@ -164,6 +164,18 @@
         )
 
 
+    def dynamicProperties(self):
+        """
+        These are not live but are generated by the server not from the dead
+        property store.
+        """
+
+        return (
+            (dav_namespace, "quota-available-bytes"),
+            (dav_namespace, "quota-used-bytes"),
+        )
+
+
     def deadProperties(self):
         """
         Provides internal access to the WebDAV dead property store.
@@ -453,14 +465,13 @@
         qnames = set(self.liveProperties())
 
         # Add dynamic live properties that exist
-        dynamicLiveProperties = (
-            (dav_namespace, "quota-available-bytes"),
-            (dav_namespace, "quota-used-bytes"),
-        )
-        for dqname in dynamicLiveProperties:
+        for dqname in self.dynamicProperties():
             has = (yield self.hasProperty(dqname, request))
             if not has:
-                qnames.remove(dqname)
+                if dqname in qnames:
+                    qnames.remove(dqname)
+            else:
+                qnames.add(dqname)
 
         for qname in self.deadProperties().list():
             if (
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/69323fa9/attachment.html>


More information about the calendarserver-changes mailing list