<!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>[13322] CalendarServer/branches/users/sagen/newcua</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/13322">13322</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-04-18 09:32:45 -0700 (Fri, 18 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>More urn:uuid: changes</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagennewcuacontribperformancesqlusagesqlusagepy">CalendarServer/branches/users/sagen/newcua/contrib/performance/sqlusage/sqlusage.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatwistedcaldavdirectoryprincipalpy">CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/principal.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatwistedcaldavdirectorytestutilpy">CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/test/util.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatwistedcaldavsharingpy">CalendarServer/branches/users/sagen/newcua/twistedcaldav/sharing.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatwistedcaldavstorebridgepy">CalendarServer/branches/users/sagen/newcua/twistedcaldav/storebridge.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatwistedcaldavupgradepy">CalendarServer/branches/users/sagen/newcua/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServerbranchesuserssagennewcuatxdavcaldavdatastoreschedulingimipinboundpy">CalendarServer/branches/users/sagen/newcua/txdav/caldav/datastore/scheduling/imip/inbound.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagennewcuacontribperformancesqlusagesqlusagepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/contrib/performance/sqlusage/sqlusage.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/contrib/performance/sqlusage/sqlusage.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/contrib/performance/sqlusage/sqlusage.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx"> for i in range(n - self.currentCount):
</span><span class="cx"> index = self.currentCount + i + 2
</span><span class="cx"> users.append("user%02d" % (index,))
</span><del>- uids.append("urn:uuid:user%02d" % (index,))
</del><ins>+ uids.append("urn:x-uid:user%02d" % (index,))
</ins><span class="cx"> session.addInvitees(URL(path=calendarhref), uids, True)
</span><span class="cx">
</span><span class="cx"> # Now accept each one
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatwistedcaldavdirectoryprincipalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/principal.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/principal.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/principal.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -117,7 +117,10 @@
</span><span class="cx">
</span><span class="cx"> cua = normalizeCUAddr(origCUAddr)
</span><span class="cx">
</span><del>- if cua.startswith("urn:uuid:"):
</del><ins>+ if cua.startswith("urn:x-uid:"):
+ return "uid", cua[10:]
+
+ elif cua.startswith("urn:uuid:"):
</ins><span class="cx"> return "guid", uuid.UUID(cua[9:])
</span><span class="cx">
</span><span class="cx"> elif cua.startswith("mailto:"):
</span><span class="lines">@@ -849,9 +852,7 @@
</span><span class="cx"> namespace, name = qname
</span><span class="cx">
</span><span class="cx"> if qname == davxml.ResourceID.qname():
</span><del>- # FIXME: should this return a different CUA flavor if guid is not set on this record?
- if hasattr(self.record, "guid"):
- returnValue(davxml.ResourceID(davxml.HRef.fromString("urn:uuid:%s" % (self.record.guid,))))
</del><ins>+ returnValue(davxml.ResourceID(davxml.HRef.fromString("urn:x-uid:%s" % (self.record.uid,))))
</ins><span class="cx">
</span><span class="cx"> elif namespace == calendarserver_namespace:
</span><span class="cx">
</span><span class="lines">@@ -1268,11 +1269,7 @@
</span><span class="cx">
</span><span class="cx"> def canonicalCalendarUserAddress(self):
</span><span class="cx"> """
</span><del>- Return a CUA for this principal, preferring in this order:
- urn:uuid: form
- mailto: form
- /principal/__uids__/ form
- first in calendarUserAddresses( ) list
</del><ins>+ Return a CUA for this principal
</ins><span class="cx"> """
</span><span class="cx"> return self.record.canonicalCalendarUserAddress()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatwistedcaldavdirectorytestutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/test/util.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/test/util.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/twistedcaldav/directory/test/util.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -213,6 +213,7 @@
</span><span class="cx">
</span><span class="cx"> addresses = set(value("addresses"))
</span><span class="cx"> if record.hasCalendars:
</span><ins>+ addresses.add("urn:x-uid:%s" % (record.uid,))
</ins><span class="cx"> addresses.add("urn:uuid:%s" % (record.guid,))
</span><span class="cx"> addresses.add("/principals/__uids__/%s/" % (record.uid,))
</span><span class="cx"> addresses.add("/principals/%s/%s/" % (record.recordType, record.shortNames[0],))
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatwistedcaldavsharingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/twistedcaldav/sharing.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/twistedcaldav/sharing.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/twistedcaldav/sharing.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def invitePropertyElement(invitation, includeUID=True):
</span><span class="cx">
</span><del>- userid = "urn:uuid:" + invitation.shareeUID
</del><ins>+ userid = "urn:x-uid:" + invitation.shareeUID
</ins><span class="cx"> principal = yield self.principalForUID(invitation.shareeUID)
</span><span class="cx"> cn = principal.displayName() if principal else invitation.shareeUID
</span><span class="cx"> returnValue(customxml.InviteUser(
</span><span class="lines">@@ -91,11 +91,11 @@
</span><span class="cx"> invitations = yield self.validateInvites(request, invitations)
</span><span class="cx">
</span><span class="cx"> ownerPrincipal = yield self.principalForUID(self._newStoreObject.ownerHome().uid())
</span><del>- # FIXME: use urn:uuid in all cases
</del><ins>+ # FIXME: use urn:x-uid in all cases
</ins><span class="cx"> if self.isCalendarCollection():
</span><span class="cx"> owner = ownerPrincipal.principalURL()
</span><span class="cx"> else:
</span><del>- owner = "urn:uuid:" + ownerPrincipal.principalUID()
</del><ins>+ owner = "urn:x-uid:" + ownerPrincipal.principalUID()
</ins><span class="cx"> ownerCN = ownerPrincipal.displayName()
</span><span class="cx">
</span><span class="cx"> returnValue(customxml.Invite(
</span><span class="lines">@@ -437,7 +437,7 @@
</span><span class="cx"> invitations = yield self._newStoreObject.allInvitations()
</span><span class="cx"> for invitation in invitations:
</span><span class="cx"> if invitation.status != _BIND_STATUS_INVALID:
</span><del>- if not (yield self.validUserIDForShare("urn:uuid:" + invitation.shareeUID, request)):
</del><ins>+ if not (yield self.validUserIDForShare("urn:x-uid:" + invitation.shareeUID, request)):
</ins><span class="cx"> self.log.error("Invalid sharee detected: {uid}", uid=invitation.shareeUID)
</span><span class="cx">
</span><span class="cx"> returnValue(invitations)
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatwistedcaldavstorebridgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/twistedcaldav/storebridge.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/twistedcaldav/storebridge.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/twistedcaldav/storebridge.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -1539,7 +1539,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> attendees = (yield self._newStoreCalendarObject.component()).getAttendees()
</span><del>- attendees = [attendee.split("urn:uuid:")[-1] for attendee in attendees]
</del><ins>+ attendees = [attendee.split("urn:x-uid:")[-1] for attendee in attendees]
</ins><span class="cx"> document = yield davXMLFromStream(request.stream)
</span><span class="cx"> for ace in document.root_element.children:
</span><span class="cx"> for child in ace.children:
</span><span class="lines">@@ -3917,7 +3917,7 @@
</span><span class="cx"> if jsondata["shared-type"] == "calendar":
</span><span class="cx"> owner = ownerPrincipal.principalURL()
</span><span class="cx"> else:
</span><del>- owner = "urn:uuid:" + ownerPrincipal.principalUID()
</del><ins>+ owner = "urn:x-uid:" + ownerPrincipal.principalUID()
</ins><span class="cx">
</span><span class="cx"> shareePrincipal = yield self.principalForUID(jsondata["sharee"])
</span><span class="cx">
</span><span class="lines">@@ -3938,7 +3938,7 @@
</span><span class="cx"> customxml.DTStamp.fromString(jsondata["dtstamp"]),
</span><span class="cx"> customxml.InviteNotification(
</span><span class="cx"> customxml.UID.fromString(jsondata["uid"]),
</span><del>- element.HRef.fromString("urn:uuid:" + jsondata["sharee"]),
</del><ins>+ element.HRef.fromString("urn:x-uid:" + jsondata["sharee"]),
</ins><span class="cx"> invitationBindStatusToXMLMap[jsondata["status"]](),
</span><span class="cx"> customxml.InviteAccess(invitationBindModeToXMLMap[jsondata["access"]]()),
</span><span class="cx"> customxml.HostURL(
</span><span class="lines">@@ -3959,7 +3959,7 @@
</span><span class="cx">
</span><span class="cx"> shareePrincipal = yield self.principalForUID(jsondata["sharee"])
</span><span class="cx">
</span><del>- # FIXME: use urn:uuid always?
</del><ins>+ # FIXME: use urn:x-uid always?
</ins><span class="cx"> if jsondata["shared-type"] == "calendar":
</span><span class="cx"> # Prefer mailto:, otherwise use principal URL
</span><span class="cx"> for cua in shareePrincipal.calendarUserAddresses():
</span><span class="lines">@@ -3968,7 +3968,7 @@
</span><span class="cx"> else:
</span><span class="cx"> cua = shareePrincipal.principalURL()
</span><span class="cx"> else:
</span><del>- cua = "urn:uuid:" + shareePrincipal.principalUID()
</del><ins>+ cua = "urn:x-uid:" + shareePrincipal.principalUID()
</ins><span class="cx">
</span><span class="cx"> commonName = shareePrincipal.displayName()
</span><span class="cx"> # record = shareePrincipal.record
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/twistedcaldav/upgrade.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/twistedcaldav/upgrade.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/twistedcaldav/upgrade.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -1311,7 +1311,7 @@
</span><span class="cx"> txn = request._newStoreTransaction
</span><span class="cx">
</span><span class="cx"> ownerPrincipal = principal
</span><del>- cua = "urn:uuid:%s" % (uuid,)
</del><ins>+ cua = "urn:x-uid:%s" % (uuid,)
</ins><span class="cx"> owner = LocalCalendarUser(
</span><span class="cx"> cua, ownerPrincipal,
</span><span class="cx"> inbox, ownerPrincipal.scheduleInboxURL()
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagennewcuatxdavcaldavdatastoreschedulingimipinboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/newcua/txdav/caldav/datastore/scheduling/imip/inbound.py (13321 => 13322)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/newcua/txdav/caldav/datastore/scheduling/imip/inbound.py        2014-04-18 15:25:05 UTC (rev 13321)
+++ CalendarServer/branches/users/sagen/newcua/txdav/caldav/datastore/scheduling/imip/inbound.py        2014-04-18 16:32:45 UTC (rev 13322)
</span><span class="lines">@@ -327,9 +327,9 @@
</span><span class="cx"> fromAddr = attendee[7:]
</span><span class="cx"> if organizer.startswith("mailto:"):
</span><span class="cx"> toAddr = organizer[7:]
</span><del>- elif organizer.startswith("urn:uuid:"):
- guid = organizer[9:]
- record = yield self.directory.recordWithGUID(guid)
</del><ins>+ elif organizer.startswith("urn:x-uid:"):
+ uid = organizer[10:]
+ record = yield self.directory.recordWithUID(uid)
</ins><span class="cx"> try:
</span><span class="cx"> if record and record.emailAddresses:
</span><span class="cx"> toAddr = list(record.emailAddresses)[0]
</span></span></pre>
</div>
</div>
</body>
</html>