<!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>[9505] CalendarServer/branches/users/gaya/inviteclean</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.macosforge.org/projects/calendarserver/changeset/9505">9505</a></dd>
<dt>Author</dt> <dd>gaya@apple.com</dd>
<dt>Date</dt> <dd>2012-07-27 17:11:04 -0700 (Fri, 27 Jul 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>remove CommonHomeChild.sharedChildWithName(), CommonHomeChild.listSharedChildren(), etc.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesusersgayainvitecleancalendarservertoolspurgepy">CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/purge.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleancalendarservertoolstesttest_purgepy">CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/test/test_purge.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantwistedcaldavresourcepy">CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/resource.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantwistedcaldavsharingpy">CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/sharing.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantxdavcaldavdatastoretestcommonpy">CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/common.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantxdavcaldavdatastoretesttest_sqlpy">CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/test_sql.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantxdavcaldavicalendarstorepy">CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/icalendarstore.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantxdavcommondatastoresqlpy">CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesusersgayainvitecleantxdavcommondatastoresql_legacypy">CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql_legacy.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesusersgayainvitecleancalendarservertoolspurgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/purge.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/purge.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/purge.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -666,19 +666,7 @@
</span><span class="cx">     # If in &quot;completely&quot; mode, unshare collections, remove notifications
</span><span class="cx">     if calHomeProvisioned and completely:
</span><span class="cx"> 
</span><del>-        # Process shared-to-me calendars
-        names = list((yield storeCalHome.listSharedChildren()))
-        for name in names:
-            if verbose:
-                if dryrun:
-                    print &quot;Would unshare: %s&quot; % (name,)
-                else:
-                    print &quot;Unsharing: %s&quot; % (name,)
-            if not dryrun:
-                child = (yield storeCalHome.sharedChildWithName(name))
-                (yield child.unshare())
-
-        # Process shared calendars
</del><ins>+        # Process shared and shared-to-me calendars
</ins><span class="cx">         children = list((yield storeCalHome.children()))
</span><span class="cx">         for child in children:
</span><span class="cx">             if verbose:
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleancalendarservertoolstesttest_purgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/test/test_purge.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/test/test_purge.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/calendarserver/tools/test/test_purge.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -847,10 +847,10 @@
</span><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx">         home = (yield txn.calendarHomeWithUID(self.uid))
</span><del>-        calendar2 = (yield home.sharedChildWithName(self.sharedName))
</del><ins>+        calendar2 = (yield home.childWithName(self.sharedName))
</ins><span class="cx">         self.assertNotEquals(calendar2, None)
</span><span class="cx">         home2 = (yield txn.calendarHomeWithUID(self.uid2))
</span><del>-        calendar1 = (yield home2.sharedChildWithName(self.sharedName2))
</del><ins>+        calendar1 = (yield home2.childWithName(self.sharedName2))
</ins><span class="cx">         self.assertNotEquals(calendar1, None)
</span><span class="cx">         (yield txn.commit())
</span><span class="cx"> 
</span><span class="lines">@@ -890,7 +890,7 @@
</span><span class="cx">         self.assertEquals(home, None)
</span><span class="cx">         # Verify calendar1 was unshared to uid2
</span><span class="cx">         home2 = (yield txn.calendarHomeWithUID(self.uid2))
</span><del>-        self.assertEquals((yield home2.sharedChildWithName(self.sharedName)), None)
</del><ins>+        self.assertEquals((yield home2.childWithName(self.sharedName)), None)
</ins><span class="cx">         (yield txn.commit())
</span><span class="cx"> 
</span><span class="cx">         count, ignored = (yield purgeUID(self.storeUnderTest(), self.uid, self.directory,
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantwistedcaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/resource.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/resource.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/resource.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -2274,7 +2274,6 @@
</span><span class="cx">         children = set(self._provisionedChildren.keys())
</span><span class="cx">         children.update(self._provisionedLinks.keys())
</span><span class="cx">         children.update((yield self._newStoreHome.listChildren()))
</span><del>-        children.update((yield self._newStoreHome.listSharedChildren()))
</del><span class="cx">         returnValue(children)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -2591,6 +2590,9 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def makeRegularChild(self, name):
</span><span class="cx">         newCalendar = yield self._newStoreHome.calendarWithName(name)
</span><ins>+        if newCalendar and not newCalendar.owned():
+            newCalendar = None
+
</ins><span class="cx">         from twistedcaldav.storebridge import CalendarCollectionResource
</span><span class="cx">         similar = CalendarCollectionResource(
</span><span class="cx">             newCalendar, self, name=name,
</span><span class="lines">@@ -2841,6 +2843,8 @@
</span><span class="cx">                 mainCls = GlobalAddressBookCollectionResource
</span><span class="cx"> 
</span><span class="cx">         newAddressBook = yield self._newStoreHome.addressbookWithName(name)
</span><ins>+        if newAddressBook and not newAddressBook.owned():
+            newAddressBook = None
</ins><span class="cx">         similar = mainCls(
</span><span class="cx">             newAddressBook, self, name,
</span><span class="cx">             principalCollections=self.principalCollections()
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantwistedcaldavsharingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/sharing.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/sharing.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/twistedcaldav/sharing.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -907,7 +907,7 @@
</span><span class="cx">         return self._homeChild
</span><span class="cx"> 
</span><span class="cx">     def uid(self):
</span><del>-        return self._homeChild.inviteUID()
</del><ins>+        return self._homeChild.shareUID()
</ins><span class="cx">     
</span><span class="cx">     def shareeUID(self):
</span><span class="cx">         return self._homeChild._home.uid()
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantxdavcaldavdatastoretestcommonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/common.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/common.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/common.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -996,7 +996,7 @@
</span><span class="cx">         yield self.commit()
</span><span class="cx">         normalCal = yield self.calendarUnderTest()
</span><span class="cx">         otherHome = yield self.homeUnderTest(name=OTHER_HOME_UID)
</span><del>-        otherCal = yield otherHome.sharedChildWithName(newCalName)
</del><ins>+        otherCal = yield otherHome.childWithName(newCalName)
</ins><span class="cx">         self.assertNotIdentical(otherCal, None)
</span><span class="cx">         self.assertEqual(
</span><span class="cx">             (yield
</span><span class="lines">@@ -1024,7 +1024,7 @@
</span><span class="cx">         cal = yield self.calendarUnderTest()
</span><span class="cx">         other = yield self.homeUnderTest(name=OTHER_HOME_UID)
</span><span class="cx">         newName = yield cal.shareWith(other, _BIND_MODE_READ)
</span><del>-        otherCal = yield other.sharedChildWithName(self.sharedName)
</del><ins>+        otherCal = yield other.childWithName(self.sharedName)
</ins><span class="cx"> 
</span><span class="cx">         # Name should not change just because we updated the mode.
</span><span class="cx">         self.assertEqual(newName, self.sharedName)
</span><span class="lines">@@ -1047,7 +1047,7 @@
</span><span class="cx">         cal = yield self.calendarUnderTest()
</span><span class="cx">         other = yield self.homeUnderTest(name=OTHER_HOME_UID)
</span><span class="cx">         newName = yield cal.unshareWith(other)
</span><del>-        otherCal = yield other.sharedChildWithName(newName)
</del><ins>+        otherCal = yield other.childWithName(newName)
</ins><span class="cx">         self.assertIdentical(otherCal, None)
</span><span class="cx">         invitedCals = yield cal.asShared()
</span><span class="cx">         self.assertEqual(len(invitedCals), 0)
</span><span class="lines">@@ -1065,10 +1065,10 @@
</span><span class="cx">             yield self.commit()
</span><span class="cx">         cal = yield self.calendarUnderTest()
</span><span class="cx">         other = yield self.homeUnderTest(name=OTHER_HOME_UID)
</span><del>-        otherCal = yield other.sharedChildWithName(self.sharedName)
</del><ins>+        otherCal = yield other.childWithName(self.sharedName)
</ins><span class="cx">         self.assertNotEqual(otherCal, None)
</span><span class="cx">         yield cal.unshare()
</span><del>-        otherCal = yield other.sharedChildWithName(self.sharedName)
</del><ins>+        otherCal = yield other.childWithName(self.sharedName)
</ins><span class="cx">         self.assertEqual(otherCal, None)
</span><span class="cx">         invitedCals = yield cal.asShared()
</span><span class="cx">         self.assertEqual(len(invitedCals), 0)
</span><span class="lines">@@ -1086,10 +1086,10 @@
</span><span class="cx">             yield self.commit()
</span><span class="cx">         cal = yield self.calendarUnderTest()
</span><span class="cx">         other = yield self.homeUnderTest(name=OTHER_HOME_UID)
</span><del>-        otherCal = yield other.sharedChildWithName(self.sharedName)
</del><ins>+        otherCal = yield other.childWithName(self.sharedName)
</ins><span class="cx">         self.assertNotEqual(otherCal, None)
</span><span class="cx">         yield otherCal.unshare()
</span><del>-        otherCal = yield other.sharedChildWithName(self.sharedName)
</del><ins>+        otherCal = yield other.childWithName(self.sharedName)
</ins><span class="cx">         self.assertEqual(otherCal, None)
</span><span class="cx">         invitedCals = yield cal.asShared()
</span><span class="cx">         self.assertEqual(len(invitedCals), 0)
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantxdavcaldavdatastoretesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/test_sql.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/test_sql.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/datastore/test/test_sql.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -976,9 +976,9 @@
</span><span class="cx">             bind.SEEN_BY_SHAREE: True,
</span><span class="cx">         })
</span><span class="cx">         yield _bindCreate.on(self.transactionUnderTest())
</span><del>-        sharedCalendar = yield shareeHome.sharedChildWithName(&quot;shared_1&quot;)
</del><ins>+        sharedCalendar = yield shareeHome.childWithName(&quot;shared_1&quot;)
</ins><span class="cx">         self.assertTrue(sharedCalendar is not None)
</span><del>-        sharedCalendar = yield shareeHome.sharedChildWithName(&quot;shared_1_vtodo&quot;)
</del><ins>+        sharedCalendar = yield shareeHome.childWithName(&quot;shared_1_vtodo&quot;)
</ins><span class="cx">         self.assertTrue(sharedCalendar is None)
</span><span class="cx"> 
</span><span class="cx">         # Now do the transfer and see if a new binding exists
</span><span class="lines">@@ -986,11 +986,11 @@
</span><span class="cx">             &quot;home_splits&quot;)).createCalendarWithName(&quot;calendar_new&quot;)
</span><span class="cx">         yield calendar._transferSharingDetails(newcalendar, &quot;VTODO&quot;)
</span><span class="cx"> 
</span><del>-        sharedCalendar = yield shareeHome.sharedChildWithName(&quot;shared_1&quot;)
</del><ins>+        sharedCalendar = yield shareeHome.childWithName(&quot;shared_1&quot;)
</ins><span class="cx">         self.assertTrue(sharedCalendar is not None)
</span><span class="cx">         self.assertEqual(sharedCalendar._resourceID, calendar._resourceID)
</span><span class="cx"> 
</span><del>-        sharedCalendar = yield shareeHome.sharedChildWithName(&quot;shared_1-vtodo&quot;)
</del><ins>+        sharedCalendar = yield shareeHome.childWithName(&quot;shared_1-vtodo&quot;)
</ins><span class="cx">         self.assertTrue(sharedCalendar is not None)
</span><span class="cx">         self.assertEqual(sharedCalendar._resourceID, newcalendar._resourceID)
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantxdavcaldavicalendarstorepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/icalendarstore.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/icalendarstore.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/caldav/icalendarstore.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">         C{txn.calendarHomeWithUID(&quot;alice&quot;) ...
</span><span class="cx">         .calendarWithName(&quot;calendar&quot;).viewerCalendarHome()} will return Alice's
</span><span class="cx">         home, whereas C{txn.calendarHomeWithUID(&quot;bob&quot;) ...
</span><del>-        .sharedChildWithName(&quot;alice's calendar&quot;).viewerCalendarHome()} will
</del><ins>+        .childWithName(&quot;alice's calendar&quot;).viewerCalendarHome()} will
</ins><span class="cx">         return Bob's calendar home.
</span><span class="cx"> 
</span><span class="cx">         @return: (synchronously) the calendar home of the user into which this
</span><span class="lines">@@ -417,12 +417,6 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         # TODO: implement this for the file store.
</span><span class="cx"> 
</span><del>-        # TODO: implement home-child- retrieval APIs to retrieve shared items
-        # from the store; the example in the docstring ought to be
-        # calendarWithName not sharedChildWithName.
-
-
-
</del><span class="cx"> class ICalendarObject(IDataStoreObject):
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Calendar object
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantxdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -900,7 +900,6 @@
</span><span class="cx">         self._shares = None
</span><span class="cx">         self._childrenLoaded = False
</span><span class="cx">         self._children = {}
</span><del>-        self._sharedChildren = {}
</del><span class="cx">         self._notifiers = notifiers
</span><span class="cx">         self._quotaUsedBytes = None
</span><span class="cx">         self._created = None
</span><span class="lines">@@ -1101,16 +1100,12 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Load and cache all children - Depth:1 optimization
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        results1 = (yield self._childClass.loadAllObjects(self, owned=True))
-        for result in results1:
</del><ins>+        results = (yield self._childClass.loadAllObjects(self))
+        for result in results:
</ins><span class="cx">             self._children[result.name()] = result
</span><del>-        results2 = (yield self._childClass.loadAllObjects(self, owned=False))
-        for result in results2:
-            self._sharedChildren[result.name()] = result
</del><span class="cx">         self._childrenLoaded = True
</span><del>-        returnValue(results1 + results2)
</del><ins>+        returnValue(results)
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">     def listChildren(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Retrieve the names of the children in this home.
</span><span class="lines">@@ -1121,21 +1116,9 @@
</span><span class="cx">         if self._childrenLoaded:
</span><span class="cx">             return succeed(self._children.keys())
</span><span class="cx">         else:
</span><del>-            return self._childClass.listObjects(self, owned=True)
</del><ins>+            return self._childClass.listObjects(self)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def listSharedChildren(self):
-        &quot;&quot;&quot;
-        Retrieve the names of the children in this home.
-
-        @return: an iterable of C{str}s.
-        &quot;&quot;&quot; 
-        if self._childrenLoaded:
-            return succeed(self._sharedChildren.keys())
-        else:
-            return self._childClass.listObjects(self, owned=False)
-
-
</del><span class="cx">     def listInvitedChildren(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Retrieve the names of the invited children in this home.
</span><span class="lines">@@ -1154,7 +1137,7 @@
</span><span class="cx">         @param name: a string.
</span><span class="cx">         @return: an L{ICalendar} or C{None} if no such child exists.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        return self._childClass.objectWithName(self, name, owned=True)
</del><ins>+        return self._childClass.objectWithName(self, name)
</ins><span class="cx"> 
</span><span class="cx">     @memoizedKey(&quot;resourceID&quot;, &quot;_children&quot;)
</span><span class="cx">     def childWithID(self, resourceID):
</span><span class="lines">@@ -1167,24 +1150,6 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         return self._childClass.objectWithID(self, resourceID)
</span><span class="cx"> 
</span><del>-    @memoizedKey(&quot;name&quot;, &quot;_sharedChildren&quot;)
-    def sharedChildWithName(self, name):
-        &quot;&quot;&quot;
-        Retrieve the shared child with the given C{name} contained in this
-        home. Return a child object with this home and the name.
-
-        IMPORTANT: take care when using this. Shared calendars should normally
-        be accessed through the owner home collection, not the sharee home collection.
-        The only reason for access through sharee home is to do some housekeeping
-        for maintaining the revisions database to show shared calendars appearing and
-        disappearing in the sharee home.
-
-        @param name: a string.
-        @return: an L{ICalendar} or C{None} if no such child
-            exists.
-        &quot;&quot;&quot;
-        return self._childClass.objectWithName(self, name, owned=False)
-
</del><span class="cx">     def invitedChildWithName(self, name):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Retrieve the invited child with the given C{name} contained in this
</span><span class="lines">@@ -1315,37 +1280,38 @@
</span><span class="cx">         # Now deal with shared collections
</span><span class="cx">         bind = self._bindSchema
</span><span class="cx">         rev = self._revisionsSchema
</span><del>-        shares = yield self.listSharedChildren()
-        for sharename in shares:
-            sharetoken = 0 if sharename in changed_collections else token
-            shareID = (yield Select(
-                [bind.RESOURCE_ID], From=bind,
-                Where=(bind.RESOURCE_NAME == sharename).And(
-                    bind.HOME_RESOURCE_ID == self._resourceID).And(
-                        bind.BIND_MODE != _BIND_MODE_OWN)
-            ).on(self._txn))[0][0]
-            results = [
-                (
-                    sharename,
-                    name if name else &quot;&quot;,
-                    wasdeleted
-                )
-                for name, wasdeleted in
-                (yield Select([rev.RESOURCE_NAME, rev.DELETED],
-                                 From=rev,
-                                Where=(rev.REVISION &gt; sharetoken).And(
-                                rev.RESOURCE_ID == shareID)).on(self._txn))
-                if name
-            ]
</del><ins>+        shares = yield self.children()
+        for share in shares:
+            if not share.owned():
+                sharetoken = 0 if share.name() in changed_collections else token
+                shareID = (yield Select(
+                    [bind.RESOURCE_ID], From=bind,
+                    Where=(bind.RESOURCE_NAME == share.name()).And(
+                        bind.HOME_RESOURCE_ID == self._resourceID).And(
+                            bind.BIND_MODE != _BIND_MODE_OWN)
+                ).on(self._txn))[0][0]
+                results = [
+                    (
+                        share.name(),
+                        name if name else &quot;&quot;,
+                        wasdeleted
+                    )
+                    for name, wasdeleted in
+                    (yield Select([rev.RESOURCE_NAME, rev.DELETED],
+                                     From=rev,
+                                    Where=(rev.REVISION &gt; sharetoken).And(
+                                    rev.RESOURCE_ID == shareID)).on(self._txn))
+                    if name
+                ]
+    
+                for path, name, wasdeleted in results:
+                    if wasdeleted:
+                        if sharetoken:
+                            deleted.append(&quot;%s/%s&quot; % (path, name,))
+    
+                for path, name, wasdeleted in results:
+                    changed.append(&quot;%s/%s&quot; % (path, name,))
</ins><span class="cx"> 
</span><del>-            for path, name, wasdeleted in results:
-                if wasdeleted:
-                    if sharetoken:
-                        deleted.append(&quot;%s/%s&quot; % (path, name,))
-
-            for path, name, wasdeleted in results:
-                changed.append(&quot;%s/%s&quot; % (path, name,))
-
</del><span class="cx">         changed.sort()
</span><span class="cx">         deleted.sort()
</span><span class="cx">         returnValue((changed, deleted))
</span><span class="lines">@@ -1949,12 +1915,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @classproperty
</span><del>-    def _ownedChildListQuery(cls): #@NoSelf
</del><ins>+    def _childListQuery(cls): #@NoSelf
</ins><span class="cx">         bind = cls._bindSchema
</span><span class="cx">         return Select([bind.RESOURCE_NAME], From=bind,
</span><span class="cx">                       Where=(bind.HOME_RESOURCE_ID ==
</span><span class="cx">                              Parameter(&quot;resourceID&quot;)).And(
</span><del>-                                 bind.BIND_MODE == _BIND_MODE_OWN))
</del><ins>+                                (bind.BIND_MODE == _BIND_MODE_OWN).Or(
+                                bind.BIND_STATUS == _BIND_STATUS_ACCEPTED)))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @classmethod
</span><span class="lines">@@ -1987,35 +1954,22 @@
</span><span class="cx">             &quot;_modified&quot;,
</span><span class="cx">         )
</span><span class="cx">         
</span><del>-    @classproperty
-    def _sharedChildListQuery(cls): #@NoSelf
-        bind = cls._bindSchema
-        return Select([bind.RESOURCE_NAME], From=bind,
-                      Where=(bind.HOME_RESOURCE_ID ==
-                             Parameter(&quot;resourceID&quot;)).And(
-                                 bind.BIND_MODE != _BIND_MODE_OWN).And(
-                                 bind.BIND_STATUS == _BIND_STATUS_ACCEPTED))
-
</del><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><del>-    def listObjects(cls, home, owned):
</del><ins>+    def listObjects(cls, home):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Retrieve the names of the children that exist in the given home.
</span><span class="cx"> 
</span><span class="cx">         @return: an iterable of C{str}s.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         # FIXME: tests don't cover this as directly as they should.
</span><del>-        if owned:
-            rows = yield cls._ownedChildListQuery.on(
</del><ins>+        rows = yield cls._childListQuery.on(
</ins><span class="cx">                 home._txn, resourceID=home._resourceID)
</span><del>-        else:
-            rows = yield cls._sharedChildListQuery.on(
-                home._txn, resourceID=home._resourceID)
</del><span class="cx">         names = [row[0] for row in rows]
</span><span class="cx">         returnValue(names)
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">     @classproperty
</span><del>-    @classproperty
</del><span class="cx">     def _invitedChildListQuery(cls): #@NoSelf
</span><span class="cx">         bind = cls._bindSchema
</span><span class="cx">         return cls._invitedBindFor((bind.HOME_RESOURCE_ID == Parameter(&quot;homeID&quot;))
</span><span class="lines">@@ -2037,18 +1991,18 @@
</span><span class="cx">         returnValue(names)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    @classmethod
-    def _allHomeChildrenQuery(cls, owned):
</del><ins>+    @classproperty
+    def _allHomeChildrenQuery(cls): #@NoSelf
</ins><span class="cx">         bind = cls._bindSchema
</span><span class="cx">         child = cls._homeChildSchema
</span><span class="cx">         childMetaData = cls._homeChildMetaDataSchema
</span><del>-        if owned:
-            ownedPiece = bind.BIND_MODE == _BIND_MODE_OWN
-        else:
-            ownedPiece = (bind.BIND_MODE != _BIND_MODE_OWN).And(
-                bind.BIND_STATUS == _BIND_STATUS_ACCEPTED)
</del><span class="cx"> 
</span><del>-        columns = [child.RESOURCE_ID, bind.RESOURCE_NAME, bind.BIND_MODE]
</del><ins>+        columns = [bind.BIND_MODE, 
+                   bind.HOME_RESOURCE_ID,
+                   bind.RESOURCE_ID,
+                   bind.RESOURCE_NAME,
+                   bind.BIND_STATUS,
+                   bind.MESSAGE]
</ins><span class="cx">         columns.extend(cls.metadataColumns())
</span><span class="cx">         return Select(columns,
</span><span class="cx">                      From=child.join(
</span><span class="lines">@@ -2056,21 +2010,13 @@
</span><span class="cx">                          'left outer').join(
</span><span class="cx">                          childMetaData, childMetaData.RESOURCE_ID == bind.RESOURCE_ID,
</span><span class="cx">                          'left outer'),
</span><del>-                     Where=(bind.HOME_RESOURCE_ID == Parameter(&quot;resourceID&quot;)
-                           ).And(ownedPiece))
</del><ins>+                     Where=(bind.HOME_RESOURCE_ID == Parameter(&quot;homeID&quot;)
+                           ).And(
+                                 (bind.BIND_MODE == _BIND_MODE_OWN).Or(
+                                  bind.BIND_STATUS == _BIND_STATUS_ACCEPTED)))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @classproperty
</span><del>-    def _ownedHomeChildrenQuery(cls): #@NoSelf
-        return cls._allHomeChildrenQuery(True)
-
-
-    @classproperty
-    def _sharedHomeChildrenQuery(cls): #@NoSelf
-        return cls._allHomeChildrenQuery(False)
-
-
-    @classproperty
</del><span class="cx">     def _inviteInsertQuery(cls): #@NoSelf
</span><span class="cx">         inv = schema.INVITE
</span><span class="cx">         return Insert(
</span><span class="lines">@@ -2248,7 +2194,7 @@
</span><span class="cx">             Return=bind.RESOURCE_NAME,
</span><span class="cx">         ).on(self._txn, resourceID=self._resourceID,
</span><span class="cx">              homeID=shareeHome._resourceID))[0][0]
</span><del>-        shareeHome._sharedChildren.pop(resourceName, None)
</del><ins>+        shareeHome._children.pop(resourceName, None)
</ins><span class="cx">         
</span><span class="cx">         # Must send notification to ensure cache invalidation occurs
</span><span class="cx">         yield self.notifyChanged()
</span><span class="lines">@@ -2280,9 +2226,9 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         return self._bindMessage
</span><span class="cx"> 
</span><del>-    def inviteUID(self):
</del><ins>+    def shareUID(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><del>-        @see: L{ICalendar.inviteUID}
</del><ins>+        @see: L{ICalendar.shareUID}
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         return self._inviteUID
</span><span class="cx"> 
</span><span class="lines">@@ -2376,14 +2322,14 @@
</span><span class="cx"> 
</span><span class="cx">         cls = self.__class__ # for ease of grepping...
</span><span class="cx">         result = []
</span><del>-        for bindMode, homeResourceID, resourceID, sharedResourceName, bindStatus, bindMessage, inviteUID in mergedRowDict.values(): #@UnusedVariable
</del><ins>+        for bindMode, homeResourceID, resourceID, resourceName, bindStatus, bindMessage, inviteUID in mergedRowDict.values(): #@UnusedVariable
</ins><span class="cx">             assert bindStatus == _BIND_STATUS_ACCEPTED
</span><span class="cx">             # TODO: this could all be issued in parallel; no need to serialize
</span><span class="cx">             # the loop.
</span><span class="cx">             new = cls(
</span><span class="cx">                 home=(yield self._txn.homeWithResourceID(self._home._homeType,
</span><span class="cx">                                                     homeResourceID)),
</span><del>-                name=sharedResourceName, resourceID=self._resourceID,
</del><ins>+                name=resourceName, resourceID=self._resourceID,
</ins><span class="cx">                 mode=bindMode, status=bindStatus, 
</span><span class="cx">                 message=bindMessage, inviteUID=inviteUID,
</span><span class="cx">             )
</span><span class="lines">@@ -2416,13 +2362,13 @@
</span><span class="cx">         cls = self.__class__ # for ease of grepping...
</span><span class="cx"> 
</span><span class="cx">         result = []
</span><del>-        for bindMode, homeResourceID, resourceID, sharedResourceName, bindStatus, bindMessage, inviteUID in rows: #@UnusedVariable
</del><ins>+        for bindMode, homeResourceID, resourceID, resourceName, bindStatus, bindMessage, inviteUID in rows: #@UnusedVariable
</ins><span class="cx">             # TODO: this could all be issued in parallel; no need to serialize
</span><span class="cx">             # the loop.
</span><span class="cx">             new = cls(
</span><span class="cx">                 home=(yield self._txn.homeWithResourceID(self._home._homeType,
</span><span class="cx">                                                     homeResourceID)),
</span><del>-                name=sharedResourceName, resourceID=self._resourceID,
</del><ins>+                name=resourceName, resourceID=self._resourceID,
</ins><span class="cx">                 mode=bindMode, status=bindStatus, 
</span><span class="cx">                 message=bindMessage, inviteUID=inviteUID,
</span><span class="cx">             )
</span><span class="lines">@@ -2434,7 +2380,7 @@
</span><span class="cx"> 
</span><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><del>-    def loadAllObjects(cls, home, owned):
</del><ins>+    def loadAllObjects(cls, home):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Load all L{CommonHomeChild} instances which are children of a given
</span><span class="cx">         L{CommonHome} and return a L{Deferred} firing a list of them.  This must
</span><span class="lines">@@ -2445,13 +2391,24 @@
</span><span class="cx">         results = []
</span><span class="cx"> 
</span><span class="cx">         # Load from the main table first
</span><del>-        if owned:
-            query = cls._ownedHomeChildrenQuery
-        else:
-            query = cls._sharedHomeChildrenQuery
-        dataRows = (yield query.on(home._txn, resourceID=home._resourceID))
</del><ins>+        dataRows = (yield cls._allHomeChildrenQuery.on(home._txn, homeID=home._resourceID))
</ins><span class="cx"> 
</span><span class="cx">         if dataRows:
</span><ins>+            
+            # get inviteUID for indirect shared children
+            invitedRows = yield cls._invitedChildListQuery.on(home._txn, homeID=home._resourceID)
+            for i in range(len(dataRows)):
+                dataRowResourceID = dataRows[i][2]
+                for invitedRow in invitedRows:
+                    invitedRowResourceID = invitedRow[2]
+                    if invitedRowResourceID==dataRowResourceID:
+                        inviteUID = invitedRow[7]
+                        break
+                else:
+                    inviteUID = None
+                
+                dataRows[i] = dataRows[i][:6] + [inviteUID,] + dataRows[i][6:]                        
+            
</ins><span class="cx">             # Get property stores for all these child resources (if any found)
</span><span class="cx">             propertyStores = (yield PropertyStore.forMultipleResources(
</span><span class="cx">                 home.uid(), home._txn,
</span><span class="lines">@@ -2461,15 +2418,10 @@
</span><span class="cx"> 
</span><span class="cx">             bind = cls._bindSchema
</span><span class="cx">             rev = cls._revisionsSchema
</span><del>-            if owned:
-                ownedCond = bind.BIND_MODE == _BIND_MODE_OWN
-            else:
-                ownedCond = bind.BIND_MODE != _BIND_MODE_OWN
</del><span class="cx">             revisions = (yield Select(
</span><span class="cx">                 [rev.RESOURCE_ID, Max(rev.REVISION)],
</span><span class="cx">                 From=rev.join(bind, rev.RESOURCE_ID == bind.RESOURCE_ID, 'left'),
</span><span class="cx">                 Where=(bind.HOME_RESOURCE_ID == home._resourceID).
</span><del>-                    And(ownedCond).
</del><span class="cx">                     And((rev.RESOURCE_NAME != None).Or(rev.DELETED == False)),
</span><span class="cx">                 GroupBy=rev.RESOURCE_ID
</span><span class="cx">             ).on(home._txn))
</span><span class="lines">@@ -2477,9 +2429,14 @@
</span><span class="cx"> 
</span><span class="cx">         # Create the actual objects merging in properties
</span><span class="cx">         for items in dataRows:
</span><del>-            resourceID, resourceName, bindMode = items[:3]
-            metadata = items[3:]
-            child = cls(home, resourceName, resourceID, bindMode)
</del><ins>+            bindMode, homeResourceID, resourceID, resourceName, bindStatus, bindMessage, inviteUID = items[:7] #@UnusedVariable
+            metadata=items[7:]
+            child = cls(
+                home=home,
+                name=resourceName, resourceID=resourceID,
+                mode=bindMode, status=bindStatus, 
+                message=bindMessage, inviteUID=inviteUID,
+            )
</ins><span class="cx">             for attr, value in zip(cls.metadataAttributes(), metadata):
</span><span class="cx">                 setattr(child, attr, value)
</span><span class="cx">             child._syncTokenRevision = revisions[resourceID]
</span><span class="lines">@@ -2518,10 +2475,10 @@
</span><span class="cx">         if not rows:
</span><span class="cx">             returnValue(None)
</span><span class="cx"> 
</span><del>-        bindMode, homeResourceID, resourceID, sharedResourceName, bindStatus, bindMessage, inviteUID = rows[0] #@UnusedVariable
</del><ins>+        bindMode, homeResourceID, resourceID, resourceName, bindStatus, bindMessage, inviteUID = rows[0] #@UnusedVariable
</ins><span class="cx">         child = cls(
</span><span class="cx">             home=home,
</span><del>-            name=sharedResourceName, resourceID=resourceID,
</del><ins>+            name=resourceName, resourceID=resourceID,
</ins><span class="cx">             mode=bindMode, status=bindStatus, 
</span><span class="cx">             message=bindMessage, inviteUID=inviteUID,
</span><span class="cx">         )
</span><span class="lines">@@ -2529,28 +2486,8 @@
</span><span class="cx">         returnValue(child)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    @classmethod
-    @inlineCallbacks
-    def objectWithName(cls, home, name, owned):
-        &quot;&quot;&quot;
-        Retrieve the child with the given C{name} contained in the given
-        C{home}.
-
-        @param home: a L{CommonHome}.
-
-        @param name: a string; the name of the L{CommonHomeChild} to retrieve.
-
-        @param owned: a boolean - whether or not to get a shared child
-        @return: an L{CommonHomeChild} or C{None} if no such child
-            exists.
-        &quot;&quot;&quot;
-        child = yield cls._objectWithName(home, name)
-        result = child if child and child.owned()==owned else None
-        returnValue(result)
-
-
</del><span class="cx">     @classproperty
</span><del>-    def _anyHomeChildLookup(cls): #@NoSelf
</del><ins>+    def _homeChildLookup(cls): #@NoSelf
</ins><span class="cx">         bind = cls._bindSchema
</span><span class="cx">         return Select(
</span><span class="cx">             [bind.BIND_MODE, 
</span><span class="lines">@@ -2575,7 +2512,7 @@
</span><span class="cx"> 
</span><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><del>-    def _objectWithName(cls, home, name):
</del><ins>+    def objectWithName(cls, home, name):
</ins><span class="cx">         # replaces objectWithName()
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Retrieve the child with the given C{name} contained in the given
</span><span class="lines">@@ -2607,7 +2544,7 @@
</span><span class="cx">             rows = yield cls._sharedWithInviteAndNameFor.on(home._txn, name=name, homeID=home._resourceID)
</span><span class="cx">             if not rows:
</span><span class="cx">                 # or all owned or accepted binds w/o inviteUID
</span><del>-                rows = yield cls._anyHomeChildLookup.on(home._txn, name=name, homeID=home._resourceID)
</del><ins>+                rows = yield cls._homeChildLookup.on(home._txn, name=name, homeID=home._resourceID)
</ins><span class="cx">                 if rows:
</span><span class="cx">                     rows[0] += [None,] # add inviteUID col
</span><span class="cx">                     
</span><span class="lines">@@ -2707,7 +2644,7 @@
</span><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def create(cls, home, name):
</span><del>-        child = (yield cls.objectWithName(home, name, owned=True))
</del><ins>+        child = (yield cls.objectWithName(home, name))
</ins><span class="cx">         if child is not None:
</span><span class="cx">             raise HomeChildNameAlreadyExistsError(name)
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayainvitecleantxdavcommondatastoresql_legacypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql_legacy.py (9504 => 9505)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql_legacy.py        2012-07-27 19:38:10 UTC (rev 9504)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql_legacy.py        2012-07-28 00:11:04 UTC (rev 9505)
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx">             else:
</span><span class="cx">                 yield savepoint.release(self._txn)
</span><span class="cx"> 
</span><del>-        shareeCollection = yield self._home.sharedChildWithName(record.localname)
</del><ins>+        shareeCollection = yield self._home.childWithName(record.localname)
</ins><span class="cx">         yield shareeCollection._initSyncToken()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def removeRecordForLocalName(self, localname):
</span><span class="cx">         record = yield self.recordForLocalName(localname)
</span><del>-        shareeCollection = yield self._home.sharedChildWithName(record.localname)
</del><ins>+        shareeCollection = yield self._home.childWithName(record.localname)
</ins><span class="cx">         yield shareeCollection._deletedSyncToken(sharedRemoval=True)
</span><span class="cx"> 
</span><span class="cx">         result = yield self._unbindShareQuery.on(self._txn, name=localname,
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx">     def removeRecordForShareUID(self, shareUID):
</span><span class="cx"> 
</span><span class="cx">         record = yield self.recordForShareUID(shareUID)
</span><del>-        shareeCollection = yield self._home.sharedChildWithName(record.localname)
</del><ins>+        shareeCollection = yield self._home.childWithName(record.localname)
</ins><span class="cx">         yield shareeCollection._deletedSyncToken(sharedRemoval=True)
</span><span class="cx"> 
</span><span class="cx">         if not shareUID.startswith(&quot;Direct&quot;):
</span></span></pre>
</div>
</div>

</body>
</html>