[CalendarServer-changes] [8083] CalendarServer/branches/users/glyph/other-html/twistedcaldav/ directory/calendaruserproxy.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 13 12:11:15 PDT 2011
Revision: 8083
http://trac.macosforge.org/projects/calendarserver/changeset/8083
Author: glyph at apple.com
Date: 2011-09-13 12:11:15 -0700 (Tue, 13 Sep 2011)
Log Message:
-----------
fill out all values for calendar user proxy listing
Modified Paths:
--------------
CalendarServer/branches/users/glyph/other-html/twistedcaldav/directory/calendaruserproxy.py
Modified: CalendarServer/branches/users/glyph/other-html/twistedcaldav/directory/calendaruserproxy.py
===================================================================
--- CalendarServer/branches/users/glyph/other-html/twistedcaldav/directory/calendaruserproxy.py 2011-09-13 19:11:04 UTC (rev 8082)
+++ CalendarServer/branches/users/glyph/other-html/twistedcaldav/directory/calendaruserproxy.py 2011-09-13 19:11:15 UTC (rev 8083)
@@ -43,6 +43,9 @@
from twisted.web.template import XMLFile, Element, renderer
from twisted.python.modules import getModule
from twistedcaldav.extensions import DirectoryElement
+from twistedcaldav.directory.principal import formatLink
+from twistedcaldav.directory.principal import formatLinks
+from twistedcaldav.directory.principal import formatPrincipals
from twistedcaldav.config import config, fullServerPath
from twistedcaldav.database import AbstractADBAPIDatabase, ADBAPISqliteMixin,\
@@ -112,25 +115,29 @@
"""
Top-level renderer in the template.
"""
+ record = self.resource.parent.record
+ resource = self.resource
+ parent = self.resource.parent
return tag.fillSlots(
- directoryGUID="<PLACEHOLDER>",
- realm="<PLACEHOLDER>",
- guid="<PLACEHOLDER>",
- recordType="<PLACEHOLDER>",
- shortNames="<PLACEHOLDER>",
- fullName="<PLACEHOLDER>",
- principalUID="<PLACEHOLDER>",
- principalURL="<PLACEHOLDER>",
- proxyPrincipalUID="<PLACEHOLDER>",
- proxyPrincipalURL="<PLACEHOLDER>",
- alternateURIs="<PLACEHOLDER>",
- groupMembers="<PLACEHOLDER>",
- groupMemberships="<PLACEHOLDER>",
+ directoryGUID=record.service.guid,
+ realm=record.service.realmName,
+ guid=record.guid,
+ recordType=record.recordType,
+ shortNames=record.shortNames,
+ fullName=record.fullName,
+ principalUID=parent.principalUID(),
+ principalURL=formatLink(parent.principalURL()),
+ proxyPrincipalUID=resource.principalUID(),
+ proxyPrincipalURL=formatLink(resource.principalURL()),
+ alternateURIs=formatLinks(resource.alternateURIs()),
+ groupMembers=resource.groupMembers().addCallback(formatPrincipals),
+ groupMemberships=resource.groupMemberships().addCallback(
+ formatPrincipals
+ ),
)
-
class ProxyPrincipalElement(DirectoryElement):
"""
L{ProxyPrincipalElement} is a renderer for proxy details.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110913/87aa0b80/attachment.html>
More information about the calendarserver-changes
mailing list