<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12039] CalendarServer/branches/users/sagen/groupcacher</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12039">12039</a></dd>
<dt>Author</dt> <dd>gaya@apple.com</dd>
<dt>Date</dt> <dd>2013-12-05 16:03:28 -0800 (Thu, 05 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>normalize group attendees</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagengroupcacherconfcaldavdtestplist">CalendarServer/branches/users/sagen/groupcacher/conf/caldavd-test.plist</a></li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwextwhotesttest_groupspy">CalendarServer/branches/users/sagen/groupcacher/twext/who/test/test_groups.py</a></li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwistedcaldavdirectorydirectorypy">CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwistedcaldavdirectoryxmlfilepy">CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/xmlfile.py</a></li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwistedcaldavstdconfigpy">CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/stdconfig.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/</li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwextwhotestaccountsaccountsxml">CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/accounts.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagengroupcachertwextwhotestaccountsresourcesxml">CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/resources.xml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagengroupcacherconfcaldavdtestplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/groupcacher/conf/caldavd-test.plist (12038 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/conf/caldavd-test.plist        2013-12-05 16:42:49 UTC (rev 12038)
+++ CalendarServer/branches/users/sagen/groupcacher/conf/caldavd-test.plist        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -771,6 +771,8 @@
</span><span class="cx"> <false/>
</span><span class="cx"> <key>AllowResourceAsOrganizer</key>
</span><span class="cx"> <false/>
</span><ins>+ <key>AllowGroupAsAttendee</key>
+ <true/>
</ins><span class="cx"> <key>AttendeeRefreshBatch</key>
</span><span class="cx"> <integer>0</integer>
</span><span class="cx"> <key>AttendeeRefreshCountLimit</key>
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwextwhotestaccountsaccountsxml"></a>
<div class="addfile"><h4>Added: CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/accounts.xml (0 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/accounts.xml         (rev 0)
+++ CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/accounts.xml        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+Copyright (c) 2006-2013 Apple Inc. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ -->
+
+<!DOCTYPE accounts SYSTEM "accounts.dtd">
+
+<accounts realm="Test Realm">
+ <user>
+ <uid>admin</uid>
+ <guid>admin</guid>
+ <password>admin</password>
+ <name>Super User</name>
+ <first-name>Super</first-name>
+ <last-name>User</last-name>
+ </user>
+ <user>
+ <uid>apprentice</uid>
+ <guid>apprentice</guid>
+ <password>apprentice</password>
+ <name>Apprentice Super User</name>
+ <first-name>Apprentice</first-name>
+ <last-name>Super User</last-name>
+ </user>
+ <user>
+ <uid>wsanchez</uid>
+ <guid>wsanchez</guid>
+ <email-address>wsanchez@example.com</email-address>
+ <password>test</password>
+ <name>Wilfredo Sanchez Vega</name>
+ <first-name>Wilfredo</first-name>
+ <last-name>Sanchez Vega</last-name>
+ </user>
+ <user>
+ <uid>cdaboo</uid>
+ <guid>cdaboo</guid>
+ <email-address>cdaboo@example.com</email-address>
+ <password>test</password>
+ <name>Cyrus Daboo</name>
+ <first-name>Cyrus</first-name>
+ <last-name>Daboo</last-name>
+ </user>
+ <user>
+ <uid>sagen</uid>
+ <guid>sagen</guid>
+ <email-address>sagen@example.com</email-address>
+ <password>test</password>
+ <name>Morgen Sagen</name>
+ <first-name>Morgen</first-name>
+ <last-name>Sagen</last-name>
+ </user>
+ <user>
+ <uid>dre</uid>
+ <guid>andre</guid>
+ <email-address>dre@example.com</email-address>
+ <password>test</password>
+ <name>Andre LaBranche</name>
+ <first-name>Andre</first-name>
+ <last-name>LaBranche</last-name>
+ </user>
+ <user>
+ <uid>glyph</uid>
+ <guid>glyph</guid>
+ <email-address>glyph@example.com</email-address>
+ <password>test</password>
+ <name>Glyph Lefkowitz</name>
+ <first-name>Glyph</first-name>
+ <last-name>Lefkowitz</last-name>
+ </user>
+ <user>
+ <uid>i18nuser</uid>
+ <guid>i18nuser</guid>
+ <email-address>i18nuser@example.com</email-address>
+ <password>i18nuser</password>
+ <name>まだ</name>
+ <first-name>ま</first-name>
+ <last-name>だ</last-name>
+ </user>
+ <user repeat="101">
+ <uid>user%02d</uid>
+ <uid>User %02d</uid>
+ <guid>user%02d</guid>
+ <password>user%02d</password>
+ <name>User %02d</name>
+ <first-name>User</first-name>
+ <last-name>%02d</last-name>
+ <email-address>user%02d@example.com</email-address>
+ </user>
+ <user repeat="10">
+ <uid>public%02d</uid>
+ <guid>public%02d</guid>
+ <password>public%02d</password>
+ <name>Public %02d</name>
+ <first-name>Public</first-name>
+ <last-name>%02d</last-name>
+ </user>
+ <group>
+ <uid>group01</uid>
+ <guid>group01</guid>
+ <password>group01</password>
+ <name>Group 01</name>
+ <email-address>group01@example.com</email-address>
+ <members>
+ <member type="users">user01</member>
+ </members>
+ </group>
+ <group>
+ <uid>group02</uid>
+ <guid>group02</guid>
+ <password>group02</password>
+ <name>Group 02</name>
+ <members>
+ <member type="users">user06</member>
+ <member type="users">user07</member>
+ </members>
+ </group>
+ <group>
+ <uid>group03</uid>
+ <guid>group03</guid>
+ <password>group03</password>
+ <name>Group 03</name>
+ <members>
+ <member type="users">user08</member>
+ <member type="users">user09</member>
+ </members>
+ </group>
+ <group>
+ <uid>group04</uid>
+ <guid>group04</guid>
+ <password>group04</password>
+ <name>Group 04</name>
+ <members>
+ <member type="groups">group02</member>
+ <member type="groups">group03</member>
+ <member type="users">user10</member>
+ </members>
+ </group>
+ <group> <!-- delegategroup -->
+ <uid>group05</uid>
+ <guid>group05</guid>
+ <password>group05</password>
+ <name>Group 05</name>
+ <members>
+ <member type="groups">group06</member>
+ <member type="users">user20</member>
+ </members>
+ </group>
+ <group> <!-- delegatesubgroup -->
+ <uid>group06</uid>
+ <guid>group06</guid>
+ <password>group06</password>
+ <name>Group 06</name>
+ <members>
+ <member type="users">user21</member>
+ </members>
+ </group>
+ <group> <!-- readonlydelegategroup -->
+ <uid>group07</uid>
+ <guid>group07</guid>
+ <password>group07</password>
+ <name>Group 07</name>
+ <members>
+ <member type="users">user22</member>
+ <member type="users">user23</member>
+ <member type="users">user24</member>
+ </members>
+ </group>
+ <group>
+ <uid>disabledgroup</uid>
+ <guid>disabledgroup</guid>
+ <password>disabledgroup</password>
+ <name>Disabled Group</name>
+ <members>
+ <member type="users">user01</member>
+ </members>
+ </group>
+</accounts>
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwextwhotestaccountsresourcesxml"></a>
<div class="addfile"><h4>Added: CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/resources.xml (0 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/resources.xml         (rev 0)
+++ CalendarServer/branches/users/sagen/groupcacher/twext/who/test/accounts/resources.xml        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+Copyright (c) 2006-2013 Apple Inc. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ -->
+
+<!DOCTYPE accounts SYSTEM "accounts.dtd">
+
+<accounts realm="Test Realm">
+ <location repeat="10">
+ <uid>location%02d</uid>
+ <guid>location%02d</guid>
+ <password>location%02d</password>
+ <name>Room %02d</name>
+ </location>
+ <resource repeat="10">
+ <uid>resource%02d</uid>
+ <guid>resource%02d</guid>
+ <password>resource%02d</password>
+ <name>Resource %02d</name>
+ </resource>
+</accounts>
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwextwhotesttest_groupspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/groupcacher/twext/who/test/test_groups.py (12038 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twext/who/test/test_groups.py        2013-12-05 16:42:49 UTC (rev 12038)
+++ CalendarServer/branches/users/sagen/groupcacher/twext/who/test/test_groups.py        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> record = yield self.xmlService.recordWithUID("__top_group_1__")
</span><span class="cx"> yield self.groupCacher.refreshGroup(txn, record.guid)
</span><span class="cx">
</span><del>- groupID, name, membershipHash = (yield txn.groupByGUID(record.guid))
</del><ins>+ groupID, name, membershipHash = (yield txn.groupByGUID(record.guid)) #@UnusedVariable
</ins><span class="cx"> self.assertEquals(membershipHash, "4b0e162f2937f0f3daa6d10e5a6a6c33")
</span><span class="cx">
</span><span class="cx"> groupGUID, name, membershipHash = (yield txn.groupByID(groupID))
</span><span class="lines">@@ -232,3 +232,132 @@
</span><span class="cx">
</span><span class="cx"> </directory>
</span><span class="cx"> """
</span><ins>+
+
+
+from twisted.trial import unittest
+from twistedcaldav.config import config
+from twistedcaldav.ical import Component, normalize_iCalStr
+
+from txdav.caldav.datastore.test.util import buildCalendarStore
+from txdav.common.datastore.test.util import populateCalendarsFrom, \
+ CommonCommonTests
+
+import os
+from calendarserver.tap.util import directoryFromConfig
+
+class GroupAttendeeReconciliation(CommonCommonTests, unittest.TestCase):
+ """
+ CalendarObject splitting tests
+ """
+
+ @inlineCallbacks
+ def setUp(self):
+ config.Scheduling.Options.AllowGroupAsAttendee = True
+
+ yield super(GroupAttendeeReconciliation, self).setUp()
+ self.patch(config.DirectoryService.params, "xmlFile",
+ os.path.join(
+ os.path.dirname(__file__), "accounts", "accounts.xml"
+ )
+ )
+ self.patch(config.ResourceService.params, "xmlFile",
+ os.path.join(
+ os.path.dirname(__file__), "accounts", "resources.xml"
+ )
+ )
+ self._sqlCalendarStore = yield buildCalendarStore(self, self.notifierFactory, directoryFromConfig(config))
+ yield self.populate()
+
+ self.paths = {}
+
+
+ def storeUnderTest(self):
+ """
+ Create and return a L{CalendarStore} for testing.
+ """
+ return self._sqlCalendarStore
+
+
+ @inlineCallbacks
+ def populate(self):
+ yield populateCalendarsFrom(self.requirements, self.storeUnderTest())
+ self.notifierFactory.reset()
+
+ requirements = {
+ "user01" : {
+ "calendar" : {}
+ },
+ }
+
+ @inlineCallbacks
+ def test_groupAttendeeReconciliation(self):
+ """
+ Test that (manual) splitting of calendar objects works.
+ """
+ calendar = yield self.calendarUnderTest(name="calendar", home="user01")
+
+ data_put = """BEGIN:VCALENDAR
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+LAST-MODIFIED:20040110T032845Z
+TZID:US/Eastern
+BEGIN:DAYLIGHT
+DTSTART:20000404T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
+TZNAME:EDT
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+END:DAYLIGHT
+BEGIN:STANDARD
+DTSTART:20001026T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZNAME:EST
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTAMP:20051222T205953Z
+CREATED:20060101T150000Z
+DTSTART;TZID=US/Eastern:20140101T100000
+DURATION:PT1H
+SUMMARY:event 1
+UID:event1@ninevah.local
+ORGANIZER:MAILTO:user01@example.com
+ATTENDEE:mailto:user01@example.com
+ATTENDEE:mailto:user02@example.com
+ATTENDEE:MAILTO:group01@example.com
+END:VEVENT
+END:VCALENDAR"""
+
+ data_get = """BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+BEGIN:VEVENT
+UID:event1@ninevah.local
+DTSTART;TZID=US/Eastern:20140101T100000
+DURATION:PT1H
+ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:uuid:user01
+ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:uuid:user02
+ATTENDEE;CN=Group 01;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:uuid:group01
+CREATED:20060101T150000Z
+ORGANIZER;CN=User 01;EMAIL=user01@example.com:urn:uuid:user01
+SUMMARY:event 1
+END:VEVENT
+END:VCALENDAR
+"""
+
+ vcalendar = Component.fromString(data_put)
+ cobj = yield calendar.createCalendarObjectWithName("data1.ics", vcalendar)
+ self.assertFalse(hasattr(cobj, "_workItems"))
+ yield self.commit()
+
+ cobj = yield self.calendarObjectUnderTest(name="data1.ics", calendar_name="calendar", home="user01")
+ vcalendar = yield cobj.component()
+ print("normalize_iCalStr(vcalendar)=%s" % (normalize_iCalStr(vcalendar),))
+ print("normalize_iCalStr(data_get)=%s" % (normalize_iCalStr(data_get),))
+ self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get))
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwistedcaldavdirectorydirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/directory.py (12038 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/directory.py        2013-12-05 16:42:49 UTC (rev 12038)
+++ CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/directory.py        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -238,9 +238,15 @@
</span><span class="cx"> else:
</span><span class="cx"> record = self.recordWithShortName(parts[2], parts[3])
</span><span class="cx">
</span><del>- return record if record and record.enabledForCalendaring else None
</del><ins>+ if record:
+ if record.enabledForCalendaring or (
+ config.Scheduling.Options.AllowGroupAsAttendee and
+ record.recordType == record.service.recordType_groups):
+ return record
</ins><span class="cx">
</span><ins>+ return None
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def recordWithCachedGroupsAlias(self, recordType, alias): #@UnusedVariable
</span><span class="cx"> """
</span><span class="cx"> @param recordType: the type of the record to look up.
</span><span class="lines">@@ -1141,8 +1147,11 @@
</span><span class="cx">
</span><span class="cx"> @see: L{IDirectoryRecord.calendarUserAddresses}.
</span><span class="cx"> """
</span><del>- if not self.enabledForCalendaring:
</del><ins>+ if not self.enabledForCalendaring and (
+ not config.Scheduling.Options.AllowGroupAsAttendee and
+ self.recordType != self.service.recordType_groups):
</ins><span class="cx"> return frozenset()
</span><ins>+
</ins><span class="cx"> cuas = set(
</span><span class="cx"> ["mailto:%s" % (emailAddress,)
</span><span class="cx"> for emailAddress in self.emailAddresses]
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwistedcaldavdirectoryxmlfilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/xmlfile.py (12038 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/xmlfile.py        2013-12-05 16:42:49 UTC (rev 12038)
+++ CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/directory/xmlfile.py        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -251,8 +251,12 @@
</span><span class="cx"> cua = normalizeCUAddr(cua)
</span><span class="cx"> for recordType in self.recordTypes():
</span><span class="cx"> record = self._lookupInIndex(recordType, self.INDEX_TYPE_CUA, cua)
</span><del>- if record and record.enabledForCalendaring:
- return record
</del><ins>+ if record:
+ if record.enabledForCalendaring or (
+ config.Scheduling.Options.AllowGroupAsAttendee and
+ recordType == record.service.recordType_groups):
+ return record
+
</ins><span class="cx"> return None
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -436,9 +440,9 @@
</span><span class="cx"> os.chown(self.xmlFile.path, uid, gid)
</span><span class="cx">
</span><span class="cx">
</span><del>- def createRecord(self, recordType, guid=None, shortNames=(), authIDs=set(),
</del><ins>+ def createRecord(self, recordType, guid=None, shortNames=(), authIDs=set(), #@UnusedVariable
</ins><span class="cx"> fullName=None, firstName=None, lastName=None, emailAddresses=set(),
</span><del>- uid=None, password=None, **kwargs):
</del><ins>+ uid=None, password=None, **kwargs): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Create and persist a record using the provided information. In this
</span><span class="cx"> XML-based implementation, the xml accounts are read in and converted
</span><span class="lines">@@ -482,7 +486,7 @@
</span><span class="cx"> return self.recordWithGUID(guid)
</span><span class="cx">
</span><span class="cx">
</span><del>- def destroyRecord(self, recordType, guid=None):
</del><ins>+ def destroyRecord(self, recordType, guid=None): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Remove the record matching guid. In this XML-based implementation,
</span><span class="cx"> the xml accounts are read in and those not matching the given guid are
</span><span class="lines">@@ -506,9 +510,9 @@
</span><span class="cx"> self._forceReload()
</span><span class="cx">
</span><span class="cx">
</span><del>- def updateRecord(self, recordType, guid=None, shortNames=(), authIDs=set(),
</del><ins>+ def updateRecord(self, recordType, guid=None, shortNames=(), authIDs=set(), #@UnusedVariable
</ins><span class="cx"> fullName=None, firstName=None, lastName=None, emailAddresses=set(),
</span><del>- uid=None, password=None, **kwargs):
</del><ins>+ uid=None, password=None, **kwargs): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Update the record matching guid. In this XML-based implementation,
</span><span class="cx"> the xml accounts are read in and converted to elementtree elements.
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagengroupcachertwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/stdconfig.py (12038 => 12039)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/stdconfig.py        2013-12-05 16:42:49 UTC (rev 12038)
+++ CalendarServer/branches/users/sagen/groupcacher/twistedcaldav/stdconfig.py        2013-12-06 00:03:28 UTC (rev 12039)
</span><span class="lines">@@ -723,6 +723,7 @@
</span><span class="cx"> "AllowResourceAsOrganizer" : False, # Allow resources to be Organizers
</span><span class="cx"> "AllowLocationWithoutOrganizer" : True, # Allow locations to have events without an Organizer
</span><span class="cx"> "AllowResourceWithoutOrganizer" : True, # Allow resources to have events without an Organizer
</span><ins>+ "AllowGroupAsAttendee" : False, # Allow groups to be Attendees
</ins><span class="cx"> "TrackUnscheduledLocationData" : True, # Track who the last modifier of an unscheduled location event is
</span><span class="cx"> "TrackUnscheduledResourceData" : True, # Track who the last modifier of an unscheduled resource event is
</span><span class="cx"> "LimitFreeBusyAttendees" : 30, # Maximum number of attendees to request freebusy for
</span><span class="lines">@@ -1141,7 +1142,7 @@
</span><span class="cx"> ]
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateDataStore(configDict, reloading=False):
</del><ins>+def _updateDataStore(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Post-update configuration hook for making all configured paths relative to
</span><span class="cx"> their respective root directories rather than the current working directory.
</span><span class="lines">@@ -1190,7 +1191,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateHostName(configDict, reloading=False):
</del><ins>+def _updateHostName(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> if not configDict.ServerHostName:
</span><span class="cx"> hostname = getfqdn()
</span><span class="cx"> if not hostname:
</span><span class="lines">@@ -1199,7 +1200,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateMultiProcess(configDict, reloading=False):
</del><ins>+def _updateMultiProcess(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Dynamically compute ProcessCount if it's set to 0. Always compute
</span><span class="cx"> MaxConnections and SharedBuffers based on ProcessCount, ExtraConnections,
</span><span class="lines">@@ -1232,7 +1233,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _preUpdateDirectoryService(configDict, items, reloading=False):
</del><ins>+def _preUpdateDirectoryService(configDict, items, reloading=False): #@UnusedVariable
</ins><span class="cx"> # Special handling for directory services configs
</span><span class="cx"> dsType = items.get("DirectoryService", {}).get("type", None)
</span><span class="cx"> if dsType is None:
</span><span class="lines">@@ -1254,7 +1255,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _postUpdateDirectoryService(configDict, reloading=False):
</del><ins>+def _postUpdateDirectoryService(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> if configDict.DirectoryService.type in DEFAULT_SERVICE_PARAMS:
</span><span class="cx"> for param in tuple(configDict.DirectoryService.params):
</span><span class="cx"> if param not in DEFAULT_SERVICE_PARAMS[configDict.DirectoryService.type]:
</span><span class="lines">@@ -1262,7 +1263,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _preUpdateResourceService(configDict, items, reloading=False):
</del><ins>+def _preUpdateResourceService(configDict, items, reloading=False): #@UnusedVariable
</ins><span class="cx"> # Special handling for directory services configs
</span><span class="cx"> dsType = items.get("ResourceService", {}).get("type", None)
</span><span class="cx"> if dsType is None:
</span><span class="lines">@@ -1284,7 +1285,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _postUpdateResourceService(configDict, reloading=False):
</del><ins>+def _postUpdateResourceService(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> if configDict.ResourceService.type in DEFAULT_RESOURCE_PARAMS:
</span><span class="cx"> for param in tuple(configDict.ResourceService.params):
</span><span class="cx"> if param not in DEFAULT_RESOURCE_PARAMS[configDict.ResourceService.type]:
</span><span class="lines">@@ -1292,7 +1293,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _preUpdateDirectoryAddressBookBackingDirectoryService(configDict, items, reloading=False):
</del><ins>+def _preUpdateDirectoryAddressBookBackingDirectoryService(configDict, items, reloading=False): #@UnusedVariable
</ins><span class="cx"> #
</span><span class="cx"> # Special handling for directory address book configs
</span><span class="cx"> #
</span><span class="lines">@@ -1322,7 +1323,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _postUpdateAugmentService(configDict, reloading=False):
</del><ins>+def _postUpdateAugmentService(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> if configDict.AugmentService.type in DEFAULT_AUGMENT_PARAMS:
</span><span class="cx"> for param in tuple(configDict.AugmentService.params):
</span><span class="cx"> if param not in DEFAULT_AUGMENT_PARAMS[configDict.AugmentService.type]:
</span><span class="lines">@@ -1331,7 +1332,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _postUpdateProxyDBService(configDict, reloading=False):
</del><ins>+def _postUpdateProxyDBService(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> if configDict.ProxyDBService.type in DEFAULT_PROXYDB_PARAMS:
</span><span class="cx"> for param in tuple(configDict.ProxyDBService.params):
</span><span class="cx"> if param not in DEFAULT_PROXYDB_PARAMS[configDict.ProxyDBService.type]:
</span><span class="lines">@@ -1340,7 +1341,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateACLs(configDict, reloading=False):
</del><ins>+def _updateACLs(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> #
</span><span class="cx"> # Base resource ACLs
</span><span class="cx"> #
</span><span class="lines">@@ -1426,7 +1427,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateRejectClients(configDict, reloading=False):
</del><ins>+def _updateRejectClients(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> #
</span><span class="cx"> # Compile RejectClients expressions for speed
</span><span class="cx"> #
</span><span class="lines">@@ -1437,7 +1438,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateLogLevels(configDict, reloading=False):
</del><ins>+def _updateLogLevels(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> log.publisher.levels.clearLogLevels()
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="lines">@@ -1514,7 +1515,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateICalendar(configDict, reloading=False):
</del><ins>+def _updateICalendar(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> """
</span><span class="cx"> Updated support iCalendar components.
</span><span class="cx"> """
</span><span class="lines">@@ -1557,7 +1558,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateServers(configDict, reloading=False):
</del><ins>+def _updateServers(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx"> from txdav.caldav.datastore.scheduling.ischedule.localservers import Servers
</span><span class="cx"> if configDict.Servers.Enabled:
</span><span class="cx"> Servers.load()
</span><span class="lines">@@ -1569,7 +1570,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _updateCompliance(configDict, reloading=False):
</del><ins>+def _updateCompliance(configDict, reloading=False): #@UnusedVariable
</ins><span class="cx">
</span><span class="cx"> if configDict.EnableCalDAV:
</span><span class="cx"> if configDict.Scheduling.CalDAV.OldDraftCompatibility:
</span></span></pre>
</div>
</div>
</body>
</html>