[CalendarServer-changes] [1627] CalendarServer/branches/users/cdaboo/more-od-schema-1617

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 28 09:39:39 PDT 2007


Revision: 1627
          http://trac.macosforge.org/projects/calendarserver/changeset/1627
Author:   cdaboo at apple.com
Date:     2007-06-28 09:39:39 -0700 (Thu, 28 Jun 2007)

Log Message:
-----------
Change 'delegate' to 'proxy'.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts-test.xml
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.dtd
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.xml
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/appleopendirectory.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/calendaruserproxy.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/directory.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/principal.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/accounts.xml
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_principal.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_xmlfile.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlaccountsparser.py
    CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlfile.py

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts-test.xml
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts-test.xml	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts-test.xml	2007-06-28 16:39:39 UTC (rev 1627)
@@ -47,9 +47,9 @@
     <password>resource%02d</password>
     <name>Resource %02d</name>
     <auto-schedule/>
-    <delegates>
+    <proxies>
       <member type="users">user01</member>
-    </delegates>
+    </proxies>
   </resource>
   <group>
     <uid>group01</uid>

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.dtd
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.dtd	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.dtd	2007-06-28 16:39:39 UTC (rev 1627)
@@ -25,10 +25,10 @@
   <!ELEMENT group (uid, guid, password, name, members, cuaddr*)>
     <!ATTLIST group repeat CDATA "1">
 
-  <!ELEMENT resource (uid, guid, password, name, cuaddr*, auto-schedule?, delegates?)>
+  <!ELEMENT resource (uid, guid, password, name, cuaddr*, auto-schedule?, proxies?)>
     <!ATTLIST resource repeat CDATA "1">
 
-  <!ELEMENT location (uid, guid, password, name, cuaddr*, auto-schedule?, delegates?)>
+  <!ELEMENT location (uid, guid, password, name, cuaddr*, auto-schedule?, proxies?)>
     <!ATTLIST location repeat CDATA "1">
 
   <!ELEMENT member (#PCDATA)>
@@ -41,5 +41,5 @@
   <!ELEMENT cuaddr        (#PCDATA)>
   <!ELEMENT members       (member*)>
   <!ELEMENT auto-schedule EMPTY>
-  <!ELEMENT delegates     (member*)>
+  <!ELEMENT proxies       (member*)>
 >

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.xml
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.xml	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/conf/accounts.xml	2007-06-28 16:39:39 UTC (rev 1627)
@@ -43,9 +43,9 @@
     <password>mercury</password>
     <name>Mecury Conference Room, Building 1, 2nd Floor</name>
     <auto-schedule/>
-    <delegates>
+    <proxies>
       <member type="users">test</member>
-    </delegates>
+    </proxies>
   </location>
 </accounts>
 

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/appleopendirectory.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/appleopendirectory.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -336,14 +336,14 @@
 
         @param plist: the plist that is the attribute value.
         @type plist: str
-        @return: a C{tuple} of C{bool} for auto-accept and C{str} for delegate GUID.
+        @return: a C{tuple} of C{bool} for auto-accept and C{str} for proxy GUID.
         """
         plist = readPlistFromString(plist)
         wpframework = plist.get("com.apple.WhitePagesFramework", {})
         autoaccept = wpframework.get("AutoAcceptsInvitation", False)
-        delegate = wpframework.get("CalendaringDelegate")
+        proxy= wpframework.get("CalendaringDelegate")
         
-        return (autoaccept, delegate,)
+        return (autoaccept, proxy,)
 
     def recordTypes(self):
         return (
@@ -504,13 +504,13 @@
 
             # Special case for resources and locations
             autoSchedule = False
-            delegateGUIDs = ()
+            proxyGUIDs = ()
             if recordType in (DirectoryService.recordType_resources, DirectoryService.recordType_locations):
                 resourceInfo = value.get(dsattributes.kDSNAttrResourceInfo)
                 if resourceInfo is not None:
-                    autoSchedule, delegate = self._parseResourceInfo(resourceInfo)
-                    if delegate:
-                        delegateGUIDs = (delegate,)
+                    autoSchedule, proxy = self._parseResourceInfo(resourceInfo)
+                    if proxy:
+                        proxyGUIDs = (proxy,)
 
             records[recordShortName] = OpenDirectoryRecord(
                 service               = self,
@@ -521,7 +521,7 @@
                 calendarUserAddresses = cuaddrset,
                 memberGUIDs           = memberGUIDs,
                 autoSchedule          = autoSchedule,
-                delegateGUIDs         = delegateGUIDs,
+                proxyGUIDs            = proxyGUIDs,
             )
 
             #log.debug("Populated record: %s" % (records[recordShortName],))
@@ -559,7 +559,7 @@
     """
     Open Directory implementation of L{IDirectoryRecord}.
     """
-    def __init__(self, service, recordType, guid, shortName, fullName, calendarUserAddresses, memberGUIDs, autoSchedule, delegateGUIDs):
+    def __init__(self, service, recordType, guid, shortName, fullName, calendarUserAddresses, memberGUIDs, autoSchedule, proxyGUIDs):
         super(OpenDirectoryRecord, self).__init__(
             service               = service,
             recordType            = recordType,
@@ -570,7 +570,7 @@
             autoSchedule          = autoSchedule,
         )
         self._memberGUIDs = tuple(memberGUIDs)
-        self._delegateGUIDs = tuple(delegateGUIDs)
+        self._proxyGUIDs = tuple(proxyGUIDs)
 
     def members(self):
         if self.recordType != DirectoryService.recordType_groups:
@@ -588,24 +588,24 @@
             if self.guid in groupRecord._memberGUIDs:
                 yield groupRecord
 
-    def delegates(self):
+    def proxies(self):
         if self.recordType not in (DirectoryService.recordType_resources, DirectoryService.recordType_locations):
             return
 
-        for guid in self._delegateGUIDs:
-            delegateRecord = self.service.recordWithGUID(guid)
-            if delegateRecord is None:
-                log.err("No record for delegate in %s with GUID %s" % (self.shortName, guid))
+        for guid in self._proxyGUIDs:
+            proxyRecord = self.service.recordWithGUID(guid)
+            if proxyRecord is None:
+                log.err("No record for proxy in %s with GUID %s" % (self.shortName, guid))
             else:
-                yield delegateRecord
+                yield proxyRecord
 
-    def delegateFor(self):
-        for delegateRecord in itertools.chain(
+    def proxyFor(self):
+        for proxyRecord in itertools.chain(
                                   self.service.recordsForType(DirectoryService.recordType_resources).itervalues(),
                                   self.service.recordsForType(DirectoryService.recordType_locations).itervalues()
                               ):
-            if self.guid in delegateRecord._delegateGUIDs:
-                yield delegateRecord
+            if self.guid in proxyRecord._proxyGUIDs:
+                yield proxyRecord
 
     def verifyCredentials(self, credentials):
         if isinstance(credentials, UsernamePassword):

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/calendaruserproxy.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/calendaruserproxy.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/calendaruserproxy.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -130,11 +130,11 @@
         assert isinstance(property, davxml.WebDAVElement)
 
         if property.qname() == (dav_namespace, "group-member-set"):
-            if self.parent.lockedDelegates():
+            if self.parent.lockedProxies():
                 raise HTTPError(
                     StatusResponse(
                         responsecode.FORBIDDEN,
-                        "Delegates cannot be changed."
+                        "Proxies cannot be changed."
                     )
                 )
             else:
@@ -219,7 +219,7 @@
                 """Principal UID: %s\n"""          % (self.principalUID(),),
                 """Principal URL: %s\n"""          % (link(self.principalURL()),),
                 """\nAlternate URIs:\n"""          , format_list(self.alternateURIs()),
-                """\nGroup members (%s):\n"""      % ({False:"Unlocked", True:"Locked"}[self.parent.lockedDelegates()]), format_list(link(p.principalURL()) for p in self.groupMembers()),
+                """\nGroup members (%s):\n"""      % ({False:"Unlocked", True:"Locked"}[self.parent.lockedProxies()]), format_list(link(p.principalURL()) for p in self.groupMembers()),
                 """\nGroup memberships:\n"""       , format_list(link(p.principalURL()) for p in self.groupMemberships()),
                 """</pre></blockquote></div>""",
                 output
@@ -254,11 +254,11 @@
         return self.parent.principalCollections()
 
     def groupMembers(self):
-        # If parent principal has fixed set of delegates use those
-        if self.parent.lockedDelegates():
-            # Fixed delegates are only for read-write - the read-only list is empty
+        # If parent principal has fixed set of proxies use those
+        if self.parent.lockedProxies():
+            # Fixed proxies are only for read-write - the read-only list is empty
             if self.proxyType == "calendar-proxy-write":
-                return self.parent.delegates()
+                return self.parent.proxies()
             else:
                 return ()
         else:

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/directory.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/directory.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/directory.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -195,13 +195,13 @@
     def groups(self):
         return ()
 
-    def delegates(self):
+    def proxies(self):
         return ()
 
-    def delegateFor(self):
+    def proxyFor(self):
         return ()
 
-    def lockedDelegates(self):
+    def lockedProxies(self):
         return self.recordType in (DirectoryService.recordType_resources, DirectoryService.recordType_locations)
 
     def verifyCredentials(self, credentials):

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/principal.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/principal.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/principal.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -433,8 +433,8 @@
         groups = self._getRelatives("groups")
 
         if config.EnableProxyPrincipals:
-            # Get any directory specified delegates
-            groups.update(self._getRelatives("delegateFor", proxy=True))
+            # Get any directory specified proxies
+            groups.update(self._getRelatives("proxyFor", proxy=True))
 
             # Get proxy group GUIDs and map to principal resources
             proxies = self._map_calendar_user_proxy_guids(self._calendar_user_proxy_index().getMemberships(self.principalUID()))
@@ -468,11 +468,11 @@
     def autoSchedule(self):
         return self.record.autoSchedule
     
-    def delegates(self):
-        return self._getRelatives("delegates")
+    def proxies(self):
+        return self._getRelatives("proxies")
 
-    def lockedDelegates(self):
-        return self.record.lockedDelegates()
+    def lockedProxies(self):
+        return self.record.lockedProxies()
 
     def scheduleInbox(self, request):
         home = self._calendarHome()

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/accounts.xml
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/accounts.xml	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/accounts.xml	2007-06-28 16:39:39 UTC (rev 1627)
@@ -123,9 +123,9 @@
     <name>Gemini Twelve</name>
     <cuaddr>mailto:gemini at example.com</cuaddr>
     <auto-schedule/>
-    <delegates>
+    <proxies>
       <member>wsanchez</member>
-    </delegates>
+    </proxies>
   </location>
   <location>
     <uid>apollo</uid>

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_principal.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_principal.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_principal.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -229,13 +229,13 @@
         for provisioningResource, recordType, recordResource, record in self._allRecords():
             self.failUnless(set(record.groups()).issubset(set(r.record for r in recordResource.groupMemberships() if hasattr(r, "record"))))
 
-    def test_delegates(self):
+    def test_proxies(self):
         """
-        DirectoryPrincipalResource.delegates()
+        DirectoryPrincipalResource.proxies()
         """
         for provisioningResource, recordType, recordResource, record in self._allRecords():
-            self.failUnless(set(record.delegates()).issubset(set(r.record for r in recordResource.delegates())))
-            self.assertEqual(record.lockedDelegates(), recordResource.lockedDelegates())
+            self.failUnless(set(record.proxies()).issubset(set(r.record for r in recordResource.proxies())))
+            self.assertEqual(record.lockedProxies(), recordResource.lockedProxies())
 
     def test_principalUID(self):
         """

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_xmlfile.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_xmlfile.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/test/test_xmlfile.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -164,7 +164,7 @@
 
         self.assertRaises(ValueError, _findRecords)
 
-    def test_okDelegates(self):
+    def test_okProxies(self):
         service = self.service()
 
         self.xmlFile().open("w").write(
@@ -181,9 +181,9 @@
     <password>nimda</password>
     <name>Super User</name>
     <auto-schedule/>
-    <delegates>
+    <proxies>
         <member>test</member>
-    </delegates>
+    </proxies>
   </location>
 </accounts>
 """
@@ -198,10 +198,10 @@
                 set(r.shortName for r in service.listRecords(recordType)),
                 set(expectedRecords)
             )
-        self.assertEqual(set([("users", "test",)],), service.recordWithShortName(DirectoryService.recordType_locations, "my office")._delegates)
-        self.assertEqual(set([("locations", "my office",)],), service.recordWithShortName(DirectoryService.recordType_users, "test")._delegateFor)
+        self.assertEqual(set([("users", "test",)],), service.recordWithShortName(DirectoryService.recordType_locations, "my office")._proxies)
+        self.assertEqual(set([("locations", "my office",)],), service.recordWithShortName(DirectoryService.recordType_users, "test")._proxyFor)
 
-    def test_badDelegates(self):
+    def test_badProxies(self):
         service = self.service()
 
         self.xmlFile().open("w").write(
@@ -212,9 +212,9 @@
     <uid>my office</uid>
     <password>nimda</password>
     <name>Super User</name>
-    <delegates>
+    <proxies>
         <member>12345-GUID-67890</member>
-    </delegates>
+    </proxies>
   </user>
 </accounts>
 """

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlaccountsparser.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlaccountsparser.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlaccountsparser.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -45,7 +45,7 @@
 ELEMENT_MEMBER       = "member"
 ELEMENT_CUADDR       = "cuaddr"
 ELEMENT_AUTOSCHEDULE = "auto-schedule"
-ELEMENT_DELEGATES    = "delegates"
+ELEMENT_PROXIES      = "proxies"
 
 ATTRIBUTE_REALM      = "realm"
 ATTRIBUTE_REPEAT     = "repeat"
@@ -103,12 +103,12 @@
                 if item is not None:
                     item.groups.add(group.shortName)
 
-        def updateDelegateFor(delegatee):
-            # Update delegate membership
-            for recordType, shortName in delegatee.delegates:
+        def updateProxyFor(proxier):
+            # Update proxy membership
+            for recordType, shortName in proxier.proxies:
                 item = self.items[recordType].get(shortName, None)
                 if item is not None:
-                    item.delegateFor.add((delegatee.recordType, delegatee.shortName))
+                    item.proxyFor.add((proxier.recordType, proxier.shortName))
 
         for child in node._get_childNodes():
             child_name = child._get_localName()
@@ -132,11 +132,11 @@
                     newprincipal = principal.repeat(i)
                     self.items[recordType][newprincipal.shortName] = newprincipal
                     updateMembership(newprincipal)
-                    updateDelegateFor(newprincipal)
+                    updateProxyFor(newprincipal)
             else:
                 self.items[recordType][principal.shortName] = principal
                 updateMembership(principal)
-                updateDelegateFor(principal)
+                updateProxyFor(principal)
 
 class XMLAccountRecord (object):
     """
@@ -155,8 +155,8 @@
         self.groups = set()
         self.calendarUserAddresses = set()
         self.autoSchedule = False
-        self.delegates = set()
-        self.delegateFor = set()
+        self.proxies = set()
+        self.proxyFor = set()
 
     def repeat(self, ctr):
         """
@@ -190,7 +190,7 @@
         result.members = self.members
         result.calendarUserAddresses = calendarUserAddresses
         result.autoSchedule = self.autoSchedule
-        result.delegates = self.delegates
+        result.proxies = self.proxies
         return result
 
     def parseXML(self, node):
@@ -220,11 +220,11 @@
                 if self.recordType not in (DirectoryService.recordType_resources, DirectoryService.recordType_locations):
                     raise ValueError("<auto-schedule> element only allowed for Resources and Locations: %s" % (child_name,))
                 self.autoSchedule = True
-            elif child_name == ELEMENT_DELEGATES:
+            elif child_name == ELEMENT_PROXIES:
                 # Only Resources & Locations
                 if self.recordType not in (DirectoryService.recordType_resources, DirectoryService.recordType_locations):
                     raise ValueError("<auto-schedule> element only allowed for Resources and Locations: %s" % (child_name,))
-                self._parseMembers(child, self.delegates)
+                self._parseMembers(child, self.proxies)
             else:
                 raise RuntimeError("Unknown account attribute: %s" % (child_name,))
 

Modified: CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlfile.py
===================================================================
--- CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlfile.py	2007-06-27 19:16:20 UTC (rev 1626)
+++ CalendarServer/branches/users/cdaboo/more-od-schema-1617/twistedcaldav/directory/xmlfile.py	2007-06-28 16:39:39 UTC (rev 1627)
@@ -114,8 +114,8 @@
         self.password     = xmlPrincipal.password
         self._members     = xmlPrincipal.members
         self._groups      = xmlPrincipal.groups
-        self._delegates   = xmlPrincipal.delegates
-        self._delegateFor = xmlPrincipal.delegateFor
+        self._proxies     = xmlPrincipal.proxies
+        self._proxyFor    = xmlPrincipal.proxyFor
 
     def members(self):
         for recordType, shortName in self._members:
@@ -125,12 +125,12 @@
         for shortName in self._groups:
             yield self.service.recordWithShortName(DirectoryService.recordType_groups, shortName)
 
-    def delegates(self):
-        for recordType, shortName in self._delegates:
+    def proxies(self):
+        for recordType, shortName in self._proxies:
             yield self.service.recordWithShortName(recordType, shortName)
 
-    def delegateFor(self):
-        for recordType, shortName in self._delegateFor:
+    def proxyFor(self):
+        for recordType, shortName in self._proxyFor:
             yield self.service.recordWithShortName(recordType, shortName)
 
     def verifyCredentials(self, credentials):

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070628/7726f095/attachment.html


More information about the calendarserver-changes mailing list