[CalendarServer-changes] [528]
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Mon Nov 20 11:48:39 PST 2006
Revision: 528
http://trac.macosforge.org/projects/calendarserver/changeset/528
Author: cdaboo at apple.com
Date: 2006-11-20 11:48:38 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
Fix principal collection lookup.
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py 2006-11-20 18:55:14 UTC (rev 527)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py 2006-11-20 19:48:38 UTC (rev 528)
@@ -37,12 +37,12 @@
from twistedcaldav.extensions import ReadOnlyResourceMixIn
from twistedcaldav.resource import CalendarPrincipalCollectionResource
-from twistedcaldav.static import CalendarPrincipalFile
+from twistedcaldav.static import CalDAVFile, CalendarPrincipalFile
from twistedcaldav.directory.idirectory import IDirectoryService
# FIXME: These should not be tied to DAVFile
-class DirectoryPrincipalProvisioningResource (ReadOnlyResourceMixIn, CalendarPrincipalCollectionResource, DAVFile):
+class DirectoryPrincipalProvisioningResource (ReadOnlyResourceMixIn, CalDAVFile):
"""
Collection resource which provisions directory principals as its children.
"""
@@ -52,9 +52,9 @@
@param url: the canonical URL for the resource.
@param directory: an L{IDirectoryService} to provision principals from.
"""
- CalendarPrincipalCollectionResource.__init__(self, url)
- DAVFile.__init__(self, path)
+ CalDAVFile.__init__(self, path)
+ self._url = url
self.directory = IDirectoryService(directory)
# FIXME: Smells like a hack
@@ -102,8 +102,8 @@
return None
return typeResource.getChild(record.shortName)
- def principalCollections(self, request):
- return succeed((self.principalCollectionURL(),))
+ def collectionURL(self):
+ return self._url
class DirectoryPrincipalTypeResource (ReadOnlyResourceMixIn, CalendarPrincipalCollectionResource, DAVFile):
"""
@@ -115,7 +115,7 @@
@param directory: an L{IDirectoryService} to provision calendars from.
@param recordType: the directory record type to provision.
"""
- CalendarPrincipalCollectionResource.__init__(self, joinURL(parent.principalCollectionURL(), recordType))
+ CalendarPrincipalCollectionResource.__init__(self, joinURL(parent.collectionURL(), recordType))
DAVFile.__init__(self, path)
self.directory = parent.directory
@@ -151,8 +151,8 @@
def listChildren(self):
return (record.shortName for record in self.directory.listRecords(self.recordType))
- def principalCollections(self, request):
- return self._parent.principalCollections(request)
+ def principalForUser(self, user):
+ return self._parent.principalForUser(user)
class DirectoryPrincipalResource (ReadOnlyResourceMixIn, CalendarPrincipalFile):
"""
@@ -248,9 +248,6 @@
def groupMemberships(self):
return self._getRelatives("groups")
- def principalCollections(self, request):
- return self._parent.principalCollections(request)
-
##
# CalDAV
##
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py 2006-11-20 18:55:14 UTC (rev 527)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py 2006-11-20 19:48:38 UTC (rev 528)
@@ -285,6 +285,12 @@
authorizationPrincipal = deferredGenerator(authorizationPrincipal)
+ def principalCollections(self, request):
+ """
+ Get the values cached in CalendarPrincipalCollectionResource.
+ """
+ return succeed(CalendarPrincipalCollectionResource.principleCollectionSet.keys())
+
##
# CalDAV
##
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061120/c6eccf76/attachment.html
More information about the calendarserver-changes
mailing list