[Standards-JIG] UPDATED: JEP-0059 (Result Set Management)
Peter Saint-Andre
stpeter at jabber.org
Thu Aug 10 18:37:08 CDT 2006
Peter Saint-Andre wrote:
> Ian Paterson wrote:
<snip/>
>> An (optional?) addition to the protocol would enable another method that
>> does not suffer from any of the disadvantages above (except *). Perhaps
>> the responder could (optionally?) provide its opaque unique ordered ID
>> of the last item whenever it returns a result set page. (If provided)
>> this would allow the requestor to optionally specify the start of the
>> next page using the ID instead of the <start/> element (the first
>> returned element would be the one immediately *after* the specified ID).
>>
>> For example, JEP-0055 responder implementors might choose to return the
>> jid as the opaque ID:
>> ...
>> <set xmlns='http://jabber.org/protocol/rsm'>
>> <max>10</max>
>> <start>0</start>
>> <last>woolly at sheep.com</last>
>> </set>
>>
>> JEP-0055 requestor implementors could then use the opaque ID:
>> <set xmlns='http://jabber.org/protocol/rsm'>
>> <max>10</max>
>> <after>woolly at sheep.com</after>
>> </set>
>
> Well, there's no real reason for <start/> then, is there? In the first
> request don't specify <after/>, in all other requests specify the unique
> ID (UID) of the last item.
I started to make these changes in JEP-0059 and I realized that it's not
necessarily straightforward to determine what the UID is for any given
payload. Making it payload-specific seems problematic -- how do the
requesting entity and responding entity know that the UID is the 'jid'
attribute of the <item/> element for jabber:iq:search, the 'jid' (or
maybe 'name') attribute for disco#items, etc.? It seems to me that we
need to have something like this:
Example 5. Requesting the First Page of a Result Set
<iq type='get' from='stpeter at jabber.org/roundabout'
to='users.jabber.org' id='page1'>
<query xmlns='jabber:iq:search'>
<first>Peter</first>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
</set>
</query>
</iq>
Example 6. Returning the First Page of a Result Set
<iq type='result' from='users.jabber.org'
to='stpeter at jabber.org/roundabout' id='page1'>
<query xmlns='jabber:iq:search'
xmlns:rsm='http://jabber.org/protocol/rsm'>
<item jid='stpeter at jabber.org' rsm:uid='someid'>
<first>Peter</first>
<last>Saint-Andre</last>
<nick>stpeter</nick>
</item>
.
[8 more items]
.
<item jid='peterpan at neverland.lit' rms:uid='another-id'>
<first>Peter</first>
<last>Pan</last>
<nick>petie</nick>
</item>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
</set>
<count xmlns='http://jabber.org/protocol/rsm'>800</count>
</query>
</iq>
Example 7. Requesting the Second Page of a Result Set
<iq type='get' from='stpeter at jabber.org/roundabout'
to='users.jabber.org' id='page2'>
<query xmlns='jabber:iq:search'>
<first>Peter</first>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
<after>another-id</after>
</set>
</query>
</iq>
Am I missing something?
Peter
--
Peter Saint-Andre
Jabber Software Foundation
http://www.jabber.org/people/stpeter.shtml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7358 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.jabber.org/pipermail/standards/attachments/20060810/9fed052b/smime.bin
More information about the Standards-JIG
mailing list