[CalendarServer-changes] [2675] CalendarServer/branches/users/sagen/xmpp/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 10 14:44:44 PDT 2008


Revision: 2675
          http://trac.macosforge.org/projects/calendarserver/changeset/2675
Author:   sagen at apple.com
Date:     2008-07-10 14:44:43 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
Broke xmpp-uri out into its own DAV property, leaving node and notify properties in case we want to support them at some point

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/xmpp/twistedcaldav/customxml.py
    CalendarServer/branches/users/sagen/xmpp/twistedcaldav/static.py
    CalendarServer/branches/users/sagen/xmpp/twistedcaldav/test/test_notify.py

Modified: CalendarServer/branches/users/sagen/xmpp/twistedcaldav/customxml.py
===================================================================
--- CalendarServer/branches/users/sagen/xmpp/twistedcaldav/customxml.py	2008-07-10 21:34:24 UTC (rev 2674)
+++ CalendarServer/branches/users/sagen/xmpp/twistedcaldav/customxml.py	2008-07-10 21:44:43 UTC (rev 2675)
@@ -267,7 +267,6 @@
     allowed_children = {
         (pubsubnode_namespace, "service"): (0, 1),
         (pubsubnode_namespace, "nodeid"): (0, 1),
-        (calendarserver_namespace, "xmpp-uri"): (0, 1),
     }
 
 class PubSubNodeId (davxml.WebDAVTextElement):
@@ -284,9 +283,10 @@
     namespace = pubsubnode_namespace
     name = "service"
 
-class PubSubXMPPURI (davxml.WebDAVTextElement):
+class PubSubXMPPURIProperty (davxml.WebDAVTextElement):
     """
-    The XMPP URI for a particular pubsub node
+    A calendarhomefile property to indicate the pubsub XMPP URI to subscribe to
+    for notifications.
     """
     namespace = calendarserver_namespace
     name = "xmpp-uri"

Modified: CalendarServer/branches/users/sagen/xmpp/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/sagen/xmpp/twistedcaldav/static.py	2008-07-10 21:34:24 UTC (rev 2674)
+++ CalendarServer/branches/users/sagen/xmpp/twistedcaldav/static.py	2008-07-10 21:44:43 UTC (rev 2675)
@@ -563,6 +563,7 @@
     cacheNotifierFactory = DisabledCacheNotifier
 
     liveProperties = CalDAVFile.liveProperties + (
+        (customxml.calendarserver_namespace, "xmpp-uri"),
         (customxml.pubsubnode_namespace, "node"),
         (customxml.pubsubnotify_namespace, "notify"),
     )
@@ -616,14 +617,20 @@
         else:
             qname = property.qname()
 
+        if qname == (customxml.calendarserver_namespace, "xmpp-uri"):
+            pubSubConfiguration = getPubSubConfiguration(config)
+            if pubSubConfiguration['enabled']:
+                return succeed(customxml.PubSubXMPPURIProperty(
+                    getPubSubXMPPURI(self.url(), pubSubConfiguration)))
+            else:
+                return succeed(customxml.PubSubXMPPURIProperty())
+
         if qname == (customxml.pubsubnode_namespace, "node"):
             pubSubConfiguration = getPubSubConfiguration(config)
             if pubSubConfiguration['enabled']:
                 return succeed(customxml.PubSubNodeProperty(
                     customxml.PubSubService(pubSubConfiguration['service']),
                     customxml.PubSubNodeId(getPubSubPath(self.url(),
-                        pubSubConfiguration)),
-                    customxml.PubSubXMPPURI(getPubSubXMPPURI(self.url(),
                         pubSubConfiguration))))
             else:
                 return succeed(customxml.PubSubNodeProperty())

Modified: CalendarServer/branches/users/sagen/xmpp/twistedcaldav/test/test_notify.py
===================================================================
--- CalendarServer/branches/users/sagen/xmpp/twistedcaldav/test/test_notify.py	2008-07-10 21:34:24 UTC (rev 2674)
+++ CalendarServer/branches/users/sagen/xmpp/twistedcaldav/test/test_notify.py	2008-07-10 21:44:43 UTC (rev 2675)
@@ -435,7 +435,6 @@
             fieldElement['var'] = field[0]
             fieldElement.addElement('value', content=field[1])
 
-        print response.toXml()
         self.assertEquals(len(self.xmlStream.elements), 0)
         self.notifier.responseFromConfigurationForm("testNodeName", response)
         self.assertEquals(len(self.xmlStream.elements), 1)
@@ -452,7 +451,6 @@
         formElement = list(configElement.elements())[0]
         self.assertEquals(formElement['type'], "submit")
         for field in formElement.elements():
-            print field.name, field['var']
             valueElement = _getChild(field, "value")
             if valueElement is not None:
                 self.assertEquals(expectedFields[field['var']],
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080710/5bb5c845/attachment-0001.html 


More information about the calendarserver-changes mailing list