[JDEV] jabber/im application idea
dlb
civintel at home.com
Sat Jan 5 13:57:40 CST 2002
There's an available public storage mechanism which could probably be
adapted for this purpose. Arbitrary XML can be stored within the roster of a
user under a custom namespace , this is publically accessible via an IQ
'get' to the namespace and data element. The implementation is pretty close
to the example you'd posed.
eg:
Mr. User posts an index of pages that he's annotated along with the location
of the annotations. These are held under a single namespace
'mr_user:public:annotations'. Alternatively you could assign a namespace per
reference domain or even per page.
Posting the index ..
<iq type="set" id="2002">
<query xmlns="mr_user:public:annotations">
<docs-jabber-org_general_html_protocol-html>
<!-- references http://docs.jabber.org/general/html/protocol.html -->
<location> http://mr_user/annotations/protocomments.xml </location>
</docs-jabber-org_general_html_protocol-html>
<www-google-com>
<!-- references http://www.google.com -->
<location> http://mr_user/annotations/fav_google_searches.xml
</location>
</www-google-com>
</query>
</iq>
Getting the annotations for
http://docs.jabber.org/general/html/protocol.html ..
<iq type="get" to="mr_user at jabber.org" id="1001">
<query xmlns="mr_user:public:annotations">
<docs-jabber-org_general_html_protocol-html />
</query>
</iq>
The result ..
<iq type='result' to='bigbird at birdland.net' id='1001'
from="mr_user at jabber.org" >
<query xmlns='mr_user:public:annotations'>
<docs-jabber-org_general_html_protocol-html>
<location>http://mr_user/annotations/protocomments.xml</location>
</docs-jabber-org_general_html_protocol-html>
<www-google-com>
<location>http://mr_user/annotations/fav_google_searches.xml</location>
</www-google-com>
</query>
</iq>
The protocol docs suggest that individual data elements can be referenced ,
per the example , but this doesn't seem to affect the result of the query.
I may not have issued or set the query correctly. The other issue to
consider is how you'll resolve the location of the annotations if they're
held on peers w/ dynamically assigned addresses.
More information about the JDev
mailing list