[CalendarServer-changes] [11118] CalendarServer/branches/users/gaya/directorybacker/twistedcaldav/ directory/opendirectorybacker.py

source_changes at macosforge.org source_changes at macosforge.org
Wed May 1 16:16:53 PDT 2013


Revision: 11118
          http://trac.calendarserver.org//changeset/11118
Author:   gaya at apple.com
Date:     2013-05-01 16:16:53 -0700 (Wed, 01 May 2013)
Log Message:
-----------
if appleInternalServer, add apple dir url

Modified Paths:
--------------
    CalendarServer/branches/users/gaya/directorybacker/twistedcaldav/directory/opendirectorybacker.py

Modified: CalendarServer/branches/users/gaya/directorybacker/twistedcaldav/directory/opendirectorybacker.py
===================================================================
--- CalendarServer/branches/users/gaya/directorybacker/twistedcaldav/directory/opendirectorybacker.py	2013-05-01 23:15:44 UTC (rev 11117)
+++ CalendarServer/branches/users/gaya/directorybacker/twistedcaldav/directory/opendirectorybacker.py	2013-05-01 23:16:53 UTC (rev 11118)
@@ -1571,7 +1571,17 @@
             for url in self.valuesForAttribute(dsattributes.kDSNAttrURL):
                 addPropertyAndLabel(groupCount, "_$!<HomePage>!$_", "URL", url, parameters={"TYPE": ["HOMEPAGE", ]})
 
+            # special case for Apple
+            if self.appleInternalServer:
+                urlbase = {"individual":"adir://employees/",
+                           "group":"adir://groups/",
+                           "org":"adir://groups/",
+                           "location":"adir://conferencerooms/",
+                           }.get(self.kind)
+                if urlbase:
+                    addPropertyAndLabel(groupCount, "\xef\xa3\xbf Directory", "URL", urlbase + self.firstValueForAttribute(dsattributes.kDS1AttrGeneratedUID), parameters={"TYPE": ["HOMEPAGE", ]})
 
+
             # 3.6.9 VERSION Type Definition
             # ALREADY ADDED
 
@@ -1654,15 +1664,19 @@
             if self.appleInternalServer:
                 for manager in self.valuesForAttribute("dsAttrTypeNative:appleManager"):
                     splitManager = manager.split("|")
-                    if len(splitManager) >= 4:
-                        managerValue = "%s %s, %s" % (splitManager[0], splitManager[1], splitManager[3],)
-                    elif len(splitManager) >= 2:
+                    if len(splitManager) >= 2:
+                        # first name, last name
                         managerValue = "%s %s" % (splitManager[0], splitManager[1])
                     else:
                         managerValue = manager
                     addPropertyAndLabel(groupCount, "_$!<Manager>!$_", "X-ABRELATEDNAMES", managerValue, parameters={ "TYPE": ["MANAGER", ]})
 
+                    if len(splitManager) >= 4:
+                        # email
+                        addPropertyAndLabel(groupCount, "_$!<Manager>!$_", "X-ABRELATEDNAMES", splitManager[3], parameters={ "TYPE": ["MANAGER", ]})
 
+
+
             # add apple-defined group vcard properties if record type is group
             if self.kind == "group":
                 vcard.addProperty(Property("X-ADDRESSBOOKSERVER-KIND", "group"))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130501/7a33d3b6/attachment.html>


More information about the calendarserver-changes mailing list