[CalendarServer-changes] [557] CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/ directory

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 22 11:58:20 PST 2006


Revision: 557
          http://trac.macosforge.org/projects/calendarserver/changeset/557
Author:   cdaboo at apple.com
Date:     2006-11-22 11:58:19 -0800 (Wed, 22 Nov 2006)

Log Message:
-----------
Directory record specfic calendar user address setting. Also ensure that inbox/outbox URL properties on principals
are properly setup.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/directory.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/idirectory.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/xmlfile.py

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/directory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/directory.py	2006-11-22 19:38:41 UTC (rev 556)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/directory.py	2006-11-22 19:58:19 UTC (rev 557)
@@ -79,12 +79,13 @@
     def __repr__(self):
         return "<%s[%s@%s] %s(%s) %r>" % (self.__class__.__name__, self.recordType, self.service, self.guid, self.shortName, self.fullName)
 
-    def __init__(self, service, recordType, guid, shortName, fullName=None):
+    def __init__(self, service, recordType, guid, shortName, fullName=None, cuaddrs=None):
         self.service    = service
         self.recordType = recordType
         self.guid       = guid
         self.shortName  = shortName
         self.fullName   = fullName
+        self.cuaddrs    = cuaddrs
 
     def __cmp__(self, other):
         if not isinstance(other, DirectoryRecord):

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/idirectory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/idirectory.py	2006-11-22 19:38:41 UTC (rev 556)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/idirectory.py	2006-11-22 19:58:19 UTC (rev 557)
@@ -69,6 +69,7 @@
     guid       = Attribute("The GUID of this record.")
     shortName  = Attribute("The name of this record.")
     fullName   = Attribute("The full name of this record.")
+    cuaddrs    = Attribute("The list of calendar user addresses for this record.")
 
     def members():
         """

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py	2006-11-22 19:38:41 UTC (rev 556)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py	2006-11-22 19:58:19 UTC (rev 557)
@@ -286,17 +286,26 @@
             self.record.service.calendarHomesCollection.homeForDirectoryRecord(self.record).url(),
         )
 
+    def scheduleInboxURL(self):
+        """
+        @return: the schedule INBOX URL for this principal.
+        """
+        return joinURL(self.calendarHomeURLs()[0], "inbox/")
+
+    def scheduleOutboxURL(self):
+        """
+        @return: the schedule OUTBOX URL for this principal.
+        """
+        return joinURL(self.calendarHomeURLs()[0], "outbox/")
+        
     def calendarUserAddresses(self):
-        return (
-            # Principal URL
-            self.principalURL(),
-
-            # Need to implement GUID->record->principal resource lookup first
-            #"urn:uuid:%s" % (self.record.guid,)
-
-            # Need to add email attribute to records if we want this
-            #"mailto:%s" % (self.record.emailAddress)
-
-            # This one needs a valid scheme.  If we make up our own, need to check the RFC for character rules.
-            #"urn:calendarserver.macosforge.org:webdav:principal:%s:%s" % (self.record.recordType, self.record.shortName),
-        )
+        # Each directory service record must define the set of calendar user addresses itself.
+        # This may vary with the directory service actually being used.
+        # All we do here is ensure that the principalURL is always in the set.
+        if self.record.cuaddrs:
+            if self.principalURL() not in self.record.cuaddrs:
+                return tuple(self.record.cuaddrs) + (self.principalURL(),)
+            else:
+                return tuple(self.record.cuaddrs)
+        else:
+            return (self.principalURL(),)

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/xmlfile.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/xmlfile.py	2006-11-22 19:38:41 UTC (rev 556)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/xmlfile.py	2006-11-22 19:58:19 UTC (rev 557)
@@ -100,6 +100,7 @@
             guid       = None,
             shortName  = shortName,
             fullName   = xmlPrincipal.name,
+            cuaddrs    = xmlPrincipal.cuaddrs
         )
 
         self.password = xmlPrincipal.pswd

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061122/9ab143df/attachment.html


More information about the calendarserver-changes mailing list