<!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>[12890] CalendarServer/branches/users/sagen/move2who-2</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/12890">12890</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-03-12 17:50:55 -0700 (Wed, 12 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Aggregated directory services now get their recordTypes assigned from config. Started work on locations/resources.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who2confauthresourcestestxml">CalendarServer/branches/users/sagen/move2who-2/conf/auth/resources-test.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2twistedcaldavdirectoryprincipalpy">CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/principal.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy">CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhoaugmentpy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhodirectorypy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who2confauthresourcestestxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/conf/auth/resources-test.xml (12889 => 12890)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/conf/auth/resources-test.xml        2014-03-12 21:57:40 UTC (rev 12889)
+++ CalendarServer/branches/users/sagen/move2who-2/conf/auth/resources-test.xml        2014-03-13 00:50:55 UTC (rev 12890)
</span><span class="lines">@@ -1,273 +1,273 @@
</span><del>-<accounts realm="Test Realm">
- <location>
- <uid>fantastic</uid>
- <guid>4D66A20A-1437-437D-8069-2F14E8322234</guid>
- <name>Fantastic Conference Room</name>
</del><ins>+<directory realm="Test Realm">
+ <record type="location">
+ <short-name>fantastic</short-name>
+ <uid>4D66A20A-1437-437D-8069-2F14E8322234</uid>
+ <full-name>Fantastic Conference Room</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <associatedAddress>63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3</associatedAddress>
</span><span class="cx"> </extras>
</span><del>- </location>
- <location>
</del><ins>+ </record>
+ <record type="location">
+ <short-name>jupiter</short-name>
</ins><span class="cx"> <uid>jupiter</uid>
</span><del>- <guid>jupiter</guid>
- <name>Jupiter Conference Room, Building 2, 1st Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Jupiter Conference Room, Building 2, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>uranus</short-name>
</ins><span class="cx"> <uid>uranus</uid>
</span><del>- <guid>uranus</guid>
- <name>Uranus Conference Room, Building 3, 1st Floor</name>
- </location>
- <location>
- <uid>morgensroom</uid>
- <guid>03DFF660-8BCC-4198-8588-DD77F776F518</guid>
- <name>Morgen's Room</name>
- </location>
- <location>
</del><ins>+ <full-name>Uranus Conference Room, Building 3, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>morgensroom</short-name>
+ <uid>03DFF660-8BCC-4198-8588-DD77F776F518</uid>
+ <full-name>Morgen's Room</full-name>
+ </record>
+ <record type="location">
+ <short-name>mercury</short-name>
</ins><span class="cx"> <uid>mercury</uid>
</span><del>- <guid>mercury</guid>
- <name>Mercury Conference Room, Building 1, 2nd Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Mercury Conference Room, Building 1, 2nd Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>location09</short-name>
</ins><span class="cx"> <uid>location09</uid>
</span><del>- <guid>location09</guid>
- <name>Room 09</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 09</full-name>
+ </record>
+ <record type="location">
+ <short-name>location08</short-name>
</ins><span class="cx"> <uid>location08</uid>
</span><del>- <guid>location08</guid>
- <name>Room 08</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 08</full-name>
+ </record>
+ <record type="location">
+ <short-name>location07</short-name>
</ins><span class="cx"> <uid>location07</uid>
</span><del>- <guid>location07</guid>
- <name>Room 07</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 07</full-name>
+ </record>
+ <record type="location">
+ <short-name>location06</short-name>
</ins><span class="cx"> <uid>location06</uid>
</span><del>- <guid>location06</guid>
- <name>Room 06</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 06</full-name>
+ </record>
+ <record type="location">
+ <short-name>location05</short-name>
</ins><span class="cx"> <uid>location05</uid>
</span><del>- <guid>location05</guid>
- <name>Room 05</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 05</full-name>
+ </record>
+ <record type="location">
+ <short-name>location04</short-name>
</ins><span class="cx"> <uid>location04</uid>
</span><del>- <guid>location04</guid>
- <name>Room 04</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 04</full-name>
+ </record>
+ <record type="location">
+ <short-name>location03</short-name>
</ins><span class="cx"> <uid>location03</uid>
</span><del>- <guid>location03</guid>
- <name>Room 03</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 03</full-name>
+ </record>
+ <record type="location">
+ <short-name>location02</short-name>
</ins><span class="cx"> <uid>location02</uid>
</span><del>- <guid>location02</guid>
- <name>Room 02</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 02</full-name>
+ </record>
+ <record type="location">
+ <short-name>location01</short-name>
</ins><span class="cx"> <uid>location01</uid>
</span><del>- <guid>location01</guid>
- <name>Room 01</name>
- </location>
- <location>
</del><ins>+ <full-name>Room 01</full-name>
+ </record>
+ <record type="location">
+ <short-name>delegatedroom</short-name>
</ins><span class="cx"> <uid>delegatedroom</uid>
</span><del>- <guid>delegatedroom</guid>
- <name>Delegated Conference Room</name>
- </location>
- <location>
- <uid>mars</uid>
- <guid>redplanet</guid>
- <name>Mars Conference Room, Building 1, 1st Floor</name>
- </location>
- <location>
- <uid>sharissroom</uid>
- <guid>80689D41-DAF8-4189-909C-DB017B271892</guid>
- <name>Shari's Room</name>
</del><ins>+ <full-name>Delegated Conference Room</full-name>
+ </record>
+ <record type="location">
+ <short-name>mars</short-name>
+ <uid>redplanet</uid>
+ <full-name>Mars Conference Room, Building 1, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>sharissroom</short-name>
+ <uid>80689D41-DAF8-4189-909C-DB017B271892</uid>
+ <full-name>Shari's Room</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <associatedAddress>6F9EE33B-78F6-481B-9289-3D0812FF0D64</associatedAddress>
</span><span class="cx"> </extras>
</span><del>- </location>
- <location>
</del><ins>+ </record>
+ <record type="location">
+ <short-name>pluto</short-name>
</ins><span class="cx"> <uid>pluto</uid>
</span><del>- <guid>pluto</guid>
- <name>Pluto Conference Room, Building 2, 1st Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Pluto Conference Room, Building 2, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>saturn</short-name>
</ins><span class="cx"> <uid>saturn</uid>
</span><del>- <guid>saturn</guid>
- <name>Saturn Conference Room, Building 2, 1st Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Saturn Conference Room, Building 2, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>location10</short-name>
</ins><span class="cx"> <uid>location10</uid>
</span><del>- <guid>location10</guid>
- <name>Room 10</name>
- </location>
- <location>
- <uid>pretend</uid>
- <guid>06E3BDCB-9C19-485A-B14E-F146A80ADDC6</guid>
- <name>Pretend Conference Room</name>
</del><ins>+ <full-name>Room 10</full-name>
+ </record>
+ <record type="location">
+ <short-name>pretend</short-name>
+ <uid>06E3BDCB-9C19-485A-B14E-F146A80ADDC6</uid>
+ <full-name>Pretend Conference Room</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <associatedAddress>76E7ECA6-08BC-4AE7-930D-F2E7453993A5</associatedAddress>
</span><span class="cx"> </extras>
</span><del>- </location>
- <location>
</del><ins>+ </record>
+ <record type="location">
+ <short-name>neptune</short-name>
</ins><span class="cx"> <uid>neptune</uid>
</span><del>- <guid>neptune</guid>
- <name>Neptune Conference Room, Building 2, 1st Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Neptune Conference Room, Building 2, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>Earth</short-name>
</ins><span class="cx"> <uid>Earth</uid>
</span><del>- <guid>Earth</guid>
- <name>Earth Conference Room, Building 1, 1st Floor</name>
- </location>
- <location>
</del><ins>+ <full-name>Earth Conference Room, Building 1, 1st Floor</full-name>
+ </record>
+ <record type="location">
+ <short-name>venus</short-name>
</ins><span class="cx"> <uid>venus</uid>
</span><del>- <guid>venus</guid>
- <name>Venus Conference Room, Building 1, 2nd Floor</name>
- </location>
- <resource>
- <uid>sharisotherresource</uid>
- <guid>CCE95217-A57B-481A-AC3D-FEC9AB6CE3A9</guid>
- <name>Shari's Other Resource</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Venus Conference Room, Building 1, 2nd Floor</full-name>
+ </record>
+ <record type="resource">
+ <short-name>sharisotherresource</short-name>
+ <uid>CCE95217-A57B-481A-AC3D-FEC9AB6CE3A9</uid>
+ <full-name>Shari's Other Resource</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource15</short-name>
</ins><span class="cx"> <uid>resource15</uid>
</span><del>- <guid>resource15</guid>
- <name>Resource 15</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 15</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource14</short-name>
</ins><span class="cx"> <uid>resource14</uid>
</span><del>- <guid>resource14</guid>
- <name>Resource 14</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 14</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource17</short-name>
</ins><span class="cx"> <uid>resource17</uid>
</span><del>- <guid>resource17</guid>
- <name>Resource 17</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 17</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource16</short-name>
</ins><span class="cx"> <uid>resource16</uid>
</span><del>- <guid>resource16</guid>
- <name>Resource 16</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 16</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource11</short-name>
</ins><span class="cx"> <uid>resource11</uid>
</span><del>- <guid>resource11</guid>
- <name>Resource 11</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 11</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource10</short-name>
</ins><span class="cx"> <uid>resource10</uid>
</span><del>- <guid>resource10</guid>
- <name>Resource 10</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 10</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource13</short-name>
</ins><span class="cx"> <uid>resource13</uid>
</span><del>- <guid>resource13</guid>
- <name>Resource 13</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 13</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource12</short-name>
</ins><span class="cx"> <uid>resource12</uid>
</span><del>- <guid>resource12</guid>
- <name>Resource 12</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 12</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource19</short-name>
</ins><span class="cx"> <uid>resource19</uid>
</span><del>- <guid>resource19</guid>
- <name>Resource 19</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 19</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource18</short-name>
</ins><span class="cx"> <uid>resource18</uid>
</span><del>- <guid>resource18</guid>
- <name>Resource 18</name>
- </resource>
- <resource>
- <uid>sharisresource</uid>
- <guid>C38BEE7A-36EE-478C-9DCB-CBF4612AFE65</guid>
- <name>Shari's Resource</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 18</full-name>
+ </record>
+ <record type="resource">
+ <short-name>sharisresource</short-name>
+ <uid>C38BEE7A-36EE-478C-9DCB-CBF4612AFE65</uid>
+ <full-name>Shari's Resource</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource20</short-name>
</ins><span class="cx"> <uid>resource20</uid>
</span><del>- <guid>resource20</guid>
- <name>Resource 20</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 20</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource06</short-name>
</ins><span class="cx"> <uid>resource06</uid>
</span><del>- <guid>resource06</guid>
- <name>Resource 06</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 06</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource07</short-name>
</ins><span class="cx"> <uid>resource07</uid>
</span><del>- <guid>resource07</guid>
- <name>Resource 07</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 07</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource04</short-name>
</ins><span class="cx"> <uid>resource04</uid>
</span><del>- <guid>resource04</guid>
- <name>Resource 04</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 04</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource05</short-name>
</ins><span class="cx"> <uid>resource05</uid>
</span><del>- <guid>resource05</guid>
- <name>Resource 05</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 05</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource02</short-name>
</ins><span class="cx"> <uid>resource02</uid>
</span><del>- <guid>resource02</guid>
- <name>Resource 02</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 02</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource03</short-name>
</ins><span class="cx"> <uid>resource03</uid>
</span><del>- <guid>resource03</guid>
- <name>Resource 03</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 03</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource01</short-name>
</ins><span class="cx"> <uid>resource01</uid>
</span><del>- <guid>resource01</guid>
- <name>Resource 01</name>
- </resource>
- <resource>
- <uid>sharisotherresource1</uid>
- <guid>0CE0BF31-5F9E-4801-A489-8C70CF287F5F</guid>
- <name>Shari's Other Resource1</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 01</full-name>
+ </record>
+ <record type="resource">
+ <short-name>sharisotherresource1</short-name>
+ <uid>0CE0BF31-5F9E-4801-A489-8C70CF287F5F</uid>
+ <full-name>Shari's Other Resource1</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource08</short-name>
</ins><span class="cx"> <uid>resource08</uid>
</span><del>- <guid>resource08</guid>
- <name>Resource 08</name>
- </resource>
- <resource>
</del><ins>+ <full-name>Resource 08</full-name>
+ </record>
+ <record type="resource">
+ <short-name>resource09</short-name>
</ins><span class="cx"> <uid>resource09</uid>
</span><del>- <guid>resource09</guid>
- <name>Resource 09</name>
- </resource>
- <address>
- <uid>testaddress1</uid>
- <guid>6F9EE33B-78F6-481B-9289-3D0812FF0D64</guid>
- <name>Test Address One</name>
</del><ins>+ <full-name>Resource 09</full-name>
+ </record>
+ <record type="address">
+ <short-name>testaddress1</short-name>
+ <uid>6F9EE33B-78F6-481B-9289-3D0812FF0D64</uid>
+ <full-name>Test Address One</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <streetAddress>20300 Stevens Creek Blvd, Cupertino, CA 95014</streetAddress>
</span><span class="cx"> <geo>37.322281,-122.028345</geo>
</span><span class="cx"> </extras>
</span><del>- </address>
- <address>
- <uid>il2</uid>
- <guid>63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3</guid>
- <name>IL2</name>
</del><ins>+ </record>
+ <record type="address">
+ <short-name>il2</short-name>
+ <uid>63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3</uid>
+ <full-name>IL2</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <streetAddress>2 Infinite Loop, Cupertino, CA 95014</streetAddress>
</span><span class="cx"> <geo>37.332633,-122.030502</geo>
</span><span class="cx"> </extras>
</span><del>- </address>
- <address>
- <uid>il1</uid>
- <guid>76E7ECA6-08BC-4AE7-930D-F2E7453993A5</guid>
- <name>IL1</name>
</del><ins>+ </record>
+ <record type="address">
+ <short-name>il1</short-name>
+ <uid>76E7ECA6-08BC-4AE7-930D-F2E7453993A5</uid>
+ <full-name>IL1</full-name>
</ins><span class="cx"> <extras>
</span><span class="cx"> <streetAddress>1 Infinite Loop, Cupertino, CA 95014</streetAddress>
</span><span class="cx"> <geo>37.331741,-122.030333</geo>
</span><span class="cx"> </extras>
</span><del>- </address>
-</accounts>
</del><ins>+ </record>
+</directory>
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2twistedcaldavdirectoryprincipalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/principal.py (12889 => 12890)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/principal.py        2014-03-12 21:57:40 UTC (rev 12889)
+++ CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/principal.py        2014-03-13 00:50:55 UTC (rev 12890)
</span><span class="lines">@@ -486,17 +486,19 @@
</span><span class="cx"> return self.principalForShortName(self.recordType, name)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
</ins><span class="cx"> def listChildren(self):
</span><ins>+ children = []
</ins><span class="cx"> if config.EnablePrincipalListings:
</span><ins>+ try:
+ for record in (yield self.directory.listRecords(self.recordType)):
+ for shortName in record.shortNames:
+ children.append(shortName)
+ except AttributeError:
+ log.warn("Cannot list children of record type {rt}",
+ rt=self.recordType.name)
+ returnValue(children)
</ins><span class="cx">
</span><del>-
- def _recordShortnameExpand():
- for record in self.directory.listRecords(self.recordType):
- if record.enabled:
- for shortName in record.shortNames:
- yield shortName
-
- return _recordShortnameExpand()
</del><span class="cx"> else:
</span><span class="cx"> # Not a listable collection
</span><span class="cx"> raise HTTPError(responsecode.FORBIDDEN)
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py (12889 => 12890)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-12 21:57:40 UTC (rev 12889)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-13 00:50:55 UTC (rev 12890)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> from twext.who.expression import MatchType, MatchFlags, Operand
</span><span class="cx"> from twext.who.idirectory import RecordType, DirectoryConfigurationError
</span><span class="cx"> from twext.who.ldap import DirectoryService as LDAPDirectoryService
</span><ins>+from twext.who.util import ConstantsContainer
</ins><span class="cx"> from twisted.application import service
</span><span class="cx"> from twisted.application.strports import service as strPortsService
</span><span class="cx"> from twisted.cred.credentials import UsernamePassword
</span><span class="lines">@@ -47,6 +48,7 @@
</span><span class="cx"> )
</span><span class="cx"> from txdav.who.augment import AugmentedDirectoryService
</span><span class="cx"> from txdav.who.delegates import DirectoryService as DelegateDirectoryService
</span><ins>+from txdav.who.idirectory import RecordType as CalRecordType
</ins><span class="cx"> from txdav.who.xml import DirectoryService as XMLDirectoryService
</span><span class="cx"> from zope.interface import implementer
</span><span class="cx">
</span><span class="lines">@@ -461,45 +463,63 @@
</span><span class="cx"> if store is None:
</span><span class="cx"> store = storeFromConfig(config, txnFactory, None)
</span><span class="cx">
</span><del>- directoryType = config.DirectoryService.type.lower()
</del><ins>+ aggregatedServices = []
</ins><span class="cx">
</span><del>- # MOVE2WHO FIXME:
- # Set the appropriate record types on each service
</del><ins>+ for serviceKey in ("DirectoryService", "ResourceService"):
+ serviceValue = config.get(serviceKey, None)
+ directoryType = serviceValue.type.lower()
+ params = serviceValue.params
</ins><span class="cx">
</span><del>- if "xml" in directoryType:
- xmlFile = config.DirectoryService.params.xmlFile
- xmlFile = fullServerPath(config.DataRoot, xmlFile)
- # path = kwds.pop("path", "")
- if not xmlFile or not os.path.exists(xmlFile):
- log.error("Path not found for XML directory: {p}", p=xmlFile)
- fp = FilePath(xmlFile)
- primaryDirectory = XMLDirectoryService(fp)
- log.debug(
- "Using XML for {types}",
- types=(", ".join([rt.name for rt in primaryDirectory.recordTypes()]))
- )
</del><ins>+ if "xml" in directoryType:
+ xmlFile = params.xmlFile
+ xmlFile = fullServerPath(config.DataRoot, xmlFile)
+ # path = kwds.pop("path", "")
+ if not xmlFile or not os.path.exists(xmlFile):
+ log.error("Path not found for XML directory: {p}", p=xmlFile)
+ fp = FilePath(xmlFile)
+ directory = XMLDirectoryService(fp)
</ins><span class="cx">
</span><del>- elif "opendirectory" in directoryType:
- from twext.who.opendirectory import DirectoryService as ODDirectoryService
- primaryDirectory = ODDirectoryService()
</del><ins>+ elif "opendirectory" in directoryType:
+ from twext.who.opendirectory import DirectoryService as ODDirectoryService
+ directory = ODDirectoryService()
</ins><span class="cx">
</span><del>- elif "ldap" in directoryType:
- params = config.DirectoryService.params
- if params.credentials.dn and params.credentials.password:
- creds = UsernamePassword(params.credentials.dn,
- params.credentials.password)
</del><ins>+ elif "ldap" in directoryType:
+ if params.credentials.dn and params.credentials.password:
+ creds = UsernamePassword(params.credentials.dn,
+ params.credentials.password)
+ else:
+ creds = None
+ directory = LDAPDirectoryService(
+ params.uri,
+ params.rdnSchema.base,
+ creds=creds
+ )
+
</ins><span class="cx"> else:
</span><del>- creds = None
- primaryDirectory = LDAPDirectoryService(
- params.uri,
- params.rdnSchema.base,
- creds=creds
- )
</del><ins>+ log.error("Invalid DirectoryType: {dt}", dt=directoryType)
+ raise DirectoryConfigurationError
</ins><span class="cx">
</span><del>- else:
- log.error("Invalid DirectoryType: {dt}", dt=directoryType)
- raise DirectoryConfigurationError
</del><ins>+ # Set the appropriate record types on each service
+ types = []
+ for recordTypeName in params.recordTypes:
+ recordType = {
+ "users": RecordType.user,
+ "groups": RecordType.group,
+ "locations": CalRecordType.location,
+ "resources": CalRecordType.resource,
+ "addresses": CalRecordType.address,
+ }.get(recordTypeName, None)
+ if recordType is None:
+ log.error("Invalid Record Type: {rt}", rt=recordTypeName)
+ raise DirectoryConfigurationError
+ if recordType in types:
+ log.error("Duplicate Record Type: {rt}", rt=recordTypeName)
+ raise DirectoryConfigurationError
+ types.append(recordType)
</ins><span class="cx">
</span><ins>+ directory.recordType = ConstantsContainer(types)
+ aggregatedServices.append(directory)
+
</ins><span class="cx"> #
</span><span class="cx"> # Setup the Augment Service
</span><span class="cx"> #
</span><span class="lines">@@ -517,14 +537,23 @@
</span><span class="cx"> else:
</span><span class="cx"> augmentService = None
</span><span class="cx">
</span><ins>+ userDirectory = None
+ for directory in aggregatedServices:
+ if RecordType.user in directory.recordTypes():
+ userDirectory = directory
+ break
+ else:
+ log.error("No directory service set up for users")
+ raise DirectoryConfigurationError
+
</ins><span class="cx"> delegateDirectory = DelegateDirectoryService(
</span><del>- primaryDirectory.realmName,
</del><ins>+ userDirectory.realmName,
</ins><span class="cx"> store
</span><span class="cx"> )
</span><ins>+ aggregatedServices.append(delegateDirectory)
</ins><span class="cx">
</span><span class="cx"> aggregateDirectory = AggregateDirectoryService(
</span><del>- primaryDirectory.realmName,
- (primaryDirectory, delegateDirectory)
</del><ins>+ userDirectory.realmName, aggregatedServices
</ins><span class="cx"> )
</span><span class="cx"> try:
</span><span class="cx"> augmented = AugmentedDirectoryService(
</span><span class="lines">@@ -543,6 +572,7 @@
</span><span class="cx"> return augmented
</span><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> @implementer(IPlugin, service.IServiceMaker)
</span><span class="cx"> class DirectoryProxyServiceMaker(object):
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhoaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py (12889 => 12890)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py        2014-03-12 21:57:40 UTC (rev 12889)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py        2014-03-13 00:50:55 UTC (rev 12890)
</span><span class="lines">@@ -26,12 +26,10 @@
</span><span class="cx"> from twext.who.util import ConstantsContainer
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from txdav.common.idirectoryservice import IStoreDirectoryService
</span><del>-from txdav.who.delegates import RecordType as DelegateRecordType
</del><span class="cx"> from txdav.who.directory import (
</span><span class="cx"> CalendarDirectoryRecordMixin, CalendarDirectoryServiceMixin
</span><span class="cx"> )
</span><span class="cx"> from txdav.who.idirectory import AutoScheduleMode, FieldName
</span><del>-from txdav.who.idirectory import RecordType as CalRecordType
</del><span class="cx"> from zope.interface import implementer
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -77,19 +75,15 @@
</span><span class="cx"> FieldName,
</span><span class="cx"> ))
</span><span class="cx">
</span><del>- recordType = ConstantsContainer((
- RecordType.user,
- RecordType.group,
- CalRecordType.location,
- CalRecordType.resource,
- CalRecordType.address,
- DelegateRecordType.readDelegateGroup,
- DelegateRecordType.writeDelegateGroup,
- DelegateRecordType.readDelegatorGroup,
- DelegateRecordType.writeDelegatorGroup,
- ))
</del><span class="cx">
</span><ins>+ @property
+ def recordType(self):
+ """
+ Defer to the directory service we're augmenting
+ """
+ return self._directory.recordType
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> def __init__(self, directory, store, augmentDB):
</span><span class="cx"> BaseDirectoryService.__init__(self, directory.realmName)
</span><span class="cx"> self._directory = directory
</span><span class="lines">@@ -192,6 +186,16 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><ins>+ def listRecords(self, recordType):
+ records = yield self._directory.listRecords(recordType)
+ augmented = []
+ for record in records:
+ record = yield self.augment(record)
+ augmented.append(record)
+ returnValue(augmented)
+
+
+ @inlineCallbacks
</ins><span class="cx"> def updateRecords(self, records, create=False):
</span><span class="cx"> return self._directory.updateRecords(records, create=create)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py (12889 => 12890)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py        2014-03-12 21:57:40 UTC (rev 12889)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py        2014-03-13 00:50:55 UTC (rev 12890)
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx"> self.service.realmName,
</span><span class="cx"> self.recordType.name,
</span><span class="cx"> self.shortNames,
</span><del>- self.guid,
</del><ins>+ self.uid,
</ins><span class="cx"> self.hasCalendars,
</span><span class="cx"> ))
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>