Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Jabber Search</title>
  10. <abstract>This specification provides canonical documentation of the jabber:iq:search namespace currently in use within the Jabber community.</abstract>
  11. &LEGALNOTICE;
  12. <number>0055</number>
  13. <status>Active</status>
  14. <type>Historical</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0004</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>iq-search</shortname>
  23. <schemaloc>
  24. <url>http://www.xmpp.org/schemas/iq-search.xsd</url>
  25. </schemaloc>
  26. &stpeter;
  27. <revision>
  28. <version>1.3</version>
  29. <date>2009-09-15</date>
  30. <initials>psa</initials>
  31. <remark><p>Clarified that &lt;first/&gt; and &lt;last/&gt; elements in fact always represent given name and family name, respectively.</p></remark>
  32. </revision>
  33. <revision>
  34. <version>1.2</version>
  35. <date>2004-03-22</date>
  36. <initials>psa</initials>
  37. <remark><p>Clarified scope (searching of any information repository, not just user directories); added search and result examples to the extensibility section.</p></remark>
  38. </revision>
  39. <revision>
  40. <version>1.1</version>
  41. <date>2004-01-06</date>
  42. <initials>psa</initials>
  43. <remark><p>Added XML schema; added text regarding extensibility via Data Forms; added FORM_TYPE submission.</p></remark>
  44. </revision>
  45. <revision>
  46. <version>1.0</version>
  47. <date>2003-01-09</date>
  48. <initials>psa</initials>
  49. <remark><p>Updated status to Active per vote of the Jabber Council.</p></remark>
  50. </revision>
  51. <revision>
  52. <version>0.1</version>
  53. <date>2002-11-01</date>
  54. <initials>psa</initials>
  55. <remark><p>Initial version.</p></remark>
  56. </revision>
  57. </header>
  58. <section1 topic='Introduction' anchor='intro'>
  59. <p>This specification documents a protocol currently used to search information repositories on the Jabber network. To date, the jabber:iq:search protocol has been used mainly to search for people who have registered with user directories (e.g., the "Jabber User Directory" hosted at users.jabber.org). However, the jabber:iq:search protocol is not limited to user directories, and could be used to search other Jabber information repositories (such as chatroom directories) or even to provide a Jabber interface to conventional search engines.</p>
  60. <p>The basic functionality is to query an information repository regarding the possible search fields, to send a search query, and to receive search results. Note well that there is currently no mechanism for paging through results or limiting the number of "hits", and that the allowable search fields are limited to those defined in the XML schema; however, extensibility MAY be provided via the &xep0004; protocol, as described below.</p>
  61. </section1>
  62. <section1 topic='Use Cases' anchor='usecases'>
  63. <section2 topic="Searching" anchor='usecases-search'>
  64. <p>In order to search an information respository, a user first needs to discover what search fields are supported by the service:</p>
  65. <example caption="Requesting Search Fields"><![CDATA[
  66. <iq type='get'
  67. from='romeo@montague.net/home'
  68. to='characters.shakespeare.lit'
  69. id='search1'
  70. xml:lang='en'>
  71. <query xmlns='jabber:iq:search'/>
  72. </iq>
  73. ]]></example>
  74. <p>The service MUST then return the possible search fields to the user, and MAY include instructions:</p>
  75. <example caption="Receiving Search Fields"><![CDATA[
  76. <iq type='result'
  77. from='characters.shakespeare.lit'
  78. to='romeo@montague.net/home'
  79. id='search1'
  80. xml:lang='en'>
  81. <query xmlns='jabber:iq:search'>
  82. <instructions>
  83. Fill in one or more fields to search
  84. for any matching Jabber users.
  85. </instructions>
  86. <first/>
  87. <last/>
  88. <nick/>
  89. <email/>
  90. </query>
  91. </iq>
  92. ]]></example>
  93. <p>The user MAY then submit a search request, specifying values for any desired fields:</p>
  94. <example caption="Submitting a Search Request"><![CDATA[
  95. <iq type='set'
  96. from='romeo@montague.net/home'
  97. to='characters.shakespeare.lit'
  98. id='search2'
  99. xml:lang='en'>
  100. <query xmlns='jabber:iq:search'>
  101. <last>Capulet</last>
  102. </query>
  103. </iq>
  104. ]]></example>
  105. <p>The service SHOULD then return a list of search results that match the values provided:</p>
  106. <example caption="Receiving Search Results"><![CDATA[
  107. <iq type='result'
  108. from='characters.shakespeare.lit'
  109. to='romeo@montague.net/home'
  110. id='search2'
  111. xml:lang='en'>
  112. <query xmlns='jabber:iq:search'>
  113. <item jid='juliet@capulet.com'>
  114. <first>Juliet</first>
  115. <last>Capulet</last>
  116. <nick>JuliC</nick>
  117. <email>juliet@shakespeare.lit</email>
  118. </item>
  119. <item jid='tybalt@shakespeare.lit'>
  120. <first>Tybalt</first>
  121. <last>Capulet</last>
  122. <nick>ty</nick>
  123. <email>tybalt@shakespeare.lit</email>
  124. </item>
  125. </query>
  126. </iq>
  127. ]]></example>
  128. <p>If there are no matching directory entries, the service MUST return an empty &lt;query/&gt; element:</p>
  129. <example caption="Service Informs User that No Records Match"><![CDATA[
  130. <iq type='result'
  131. from='characters.shakespeare.lit'
  132. to='romeo@montague.net/home'
  133. id='search2'
  134. xml:lang='en'>
  135. <query xmlns='jabber:iq:search'/>
  136. </iq>
  137. ]]></example>
  138. </section2>
  139. </section1>
  140. <section1 topic='Extensibility' anchor='extensibility'>
  141. <p>The fields defined in the 'jabber:iq:search' namespace are strictly limited to those specified in the schema. If a host needs to gather additional information, <strong>Data Forms</strong> SHOULD be used; a host MUST NOT add new fields to the 'jabber:iq:search' namespace. Support for extensibility via <strong>Data Forms</strong> is RECOMMENDED, but is not required for compliance with this document.</p>
  142. <p>The extensibility mechanism for searching makes use of a hidden FORM_TYPE field for the purpose of standardizing field names within the form, as defined in &xep0068;. Implementations supporting this extensibility mechanism SHOULD support field standardization as well.</p>
  143. <example caption='Entity Requests Search Fields from Service'><![CDATA[
  144. <iq type='get'
  145. from='juliet@capulet.com/balcony'
  146. to='characters.shakespeare.lit'
  147. id='search3'
  148. xml:lang='en'>
  149. <query xmlns='jabber:iq:search'/>
  150. </iq>
  151. ]]></example>
  152. <example caption='Host Returns Search Form to Entity'><![CDATA[
  153. <iq type='result'
  154. from='characters.shakespeare.lit'
  155. to='juliet@capulet.com/balcony'
  156. id='search3'
  157. xml:lang='en'>
  158. <query xmlns='jabber:iq:search'>
  159. <instructions>
  160. Use the enclosed form to search. If your Jabber client does not
  161. support Data Forms, visit http://shakespeare.lit/
  162. </instructions>
  163. <x xmlns='jabber:x:data' type='form'>
  164. <title>User Directory Search</title>
  165. <instructions>
  166. Please provide the following information
  167. to search for Shakespearean characters.
  168. </instructions>
  169. <field type='hidden'
  170. var='FORM_TYPE'>
  171. <value>jabber:iq:search</value>
  172. </field>
  173. <field type='text-single'
  174. label='Given Name'
  175. var='first'/>
  176. <field type='text-single'
  177. label='Family Name'
  178. var='last'/>
  179. <field type='list-single'
  180. label='Gender'
  181. var='x-gender'>
  182. <option label='Male'><value>male</value></option>
  183. <option label='Female'><value>female</value></option>
  184. </field>
  185. </x>
  186. </query>
  187. </iq>
  188. ]]></example>
  189. <example caption='Entity Submits Search Form'><![CDATA[
  190. <iq type='set'
  191. from='juliet@capulet.com/balcony'
  192. to='characters.shakespeare.lit'
  193. id='search4'
  194. xml:lang='en'>
  195. <query xmlns='jabber:iq:search'>
  196. <x xmlns='jabber:x:data' type='submit'>
  197. <field type='hidden' var='FORM_TYPE'>
  198. <value>jabber:iq:search</value>
  199. </field>
  200. <field var='x-gender'>
  201. <value>male</value>
  202. </field>
  203. </x>
  204. </query>
  205. </iq>
  206. ]]></example>
  207. <example caption='Service Returns Search Results'><![CDATA[
  208. <iq type='result'
  209. from='characters.shakespeare.lit'
  210. to='juliet@capulet.com/balcony'
  211. id='search4'
  212. xml:lang='en'>
  213. <query xmlns='jabber:iq:search'>
  214. <x xmlns='jabber:x:data' type='result'>
  215. <field type='hidden' var='FORM_TYPE'>
  216. <value>jabber:iq:search</value>
  217. </field>
  218. <reported>
  219. <field var='first' label='Given Name' type='text-single'/>
  220. <field var='last' label='Family Name' type='text-single'/>
  221. <field var='jid' label='Jabber ID' type='jid-single'/>
  222. <field var='x-gender' label='Gender' type='list-single'/>
  223. </reported>
  224. <item>
  225. <field var='first'><value>Benvolio</value></field>
  226. <field var='last'><value>Montague</value></field>
  227. <field var='jid'><value>benvolio@montague.net</value></field>
  228. <field var='x-gender'><value>male</value></field>
  229. </item>
  230. <item>
  231. <field var='first'><value>Romeo</value></field>
  232. <field var='last'><value>Montague</value></field>
  233. <field var='jid'><value>romeo@montague.net</value></field>
  234. <field var='x-gender'><value>male</value></field>
  235. </item>
  236. </x>
  237. </query>
  238. </iq>
  239. ]]></example>
  240. </section1>
  241. <section1 topic='Internationalization Considerations' anchor='i18n'>
  242. <p>The intent of the &lt;first/&gt; and &lt;last/&gt; elements (and associated data form fields) is that they map to given name and family name, respectively. Therefore, cultures that place the family name first and the given name second (e.g., as is done in China) would use &lt;first/&gt; for the given name and &lt;last/&gt; for the family name, NOT the other way around.</p>
  243. <p>For example, the name of the Chinese philosopher Confucius would be rendered as shown below because his given name was Qui and his family name was Kong.</p>
  244. <example caption="Internationalization of names"><![CDATA[
  245. <iq type='submit'
  246. from='confucius@scholars.lit/home'
  247. to='registrar.scholars.lit'
  248. id='kj3b157n'
  249. xml:lang='en'>
  250. <query xmlns='jabber:iq:register'>
  251. <username>confucius</username>
  252. <first>Qui</first>
  253. <last>Kong</last>
  254. </query>
  255. </iq>
  256. ]]></example>
  257. </section1>
  258. <section1 topic='Security Considerations' anchor='security'>
  259. <p>There are no security features or concerns related to this proposal.</p>
  260. </section1>
  261. <section1 topic='IANA Considerations' anchor='iana'>
  262. <p>This document requires no interaction with &IANA;.</p>
  263. </section1>
  264. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  265. <p>The &REGISTRAR; shall include the following information in its registries.</p>
  266. <section2 topic='Protocol Namespaces' anchor='registrar-namespaces'>
  267. <p>The XMPP Registrar includes the 'jabber:iq:search' namespace in its registry of protocol namespaces.</p>
  268. </section2>
  269. <section2 topic='Field Standardization' anchor='registrar-formtypes'>
  270. <p>The following fields are reserved for use within jabber:x:data forms scoped by a FORM_TYPE of 'jabber:iq:search'; additional fields MAY be added via the XMPP Registrar's normal registration process but are outside the scope of this document.</p>
  271. <code caption='Registry Submission'><![CDATA[
  272. <form_type>
  273. <name>jabber:iq:search</name>
  274. <doc>XEP-0055</doc>
  275. <desc>Forms enabling directory searches.</desc>
  276. <field
  277. var='first'
  278. type='text-single'
  279. label='Given Name'/>
  280. <field
  281. var='last'
  282. type='text-single'
  283. label='Family Name'/>
  284. <field
  285. var='nick'
  286. type='text-single'
  287. label='Nickname'/>
  288. <field
  289. var='email'
  290. type='text-single'
  291. label='Email Address'/>
  292. </form_type>
  293. ]]></code>
  294. </section2>
  295. </section1>
  296. <section1 topic='XML Schema' anchor='schema'>
  297. <code><![CDATA[
  298. <?xml version='1.0' encoding='UTF-8'?>
  299. <xs:schema
  300. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  301. targetNamespace='jabber:iq:search'
  302. xmlns='jabber:iq:search'
  303. elementFormDefault='qualified'>
  304. <xs:import namespace='jabber:x:data'
  305. schemaLocation='http://www.xmpp.org/schemas/x-data.xsd'/>
  306. <xs:annotation>
  307. <xs:documentation>
  308. The protocol documented by this schema is defined in
  309. XEP-0055: http://www.xmpp.org/extensions/xep-0055.html
  310. </xs:documentation>
  311. </xs:annotation>
  312. <xs:element name='query'>
  313. <xs:complexType>
  314. <xs:choice>
  315. <xs:all xmlns:xdata='jabber:x:data'>
  316. <xs:element name='instructions' type='xs:string'/>
  317. <xs:element name='first' type='xs:string'/>
  318. <xs:element name='last' type='xs:string'/>
  319. <xs:element name='nick' type='xs:string'/>
  320. <xs:element name='email' type='xs:string'/>
  321. <xs:element ref='xdata:x' minOccurs='0'/>
  322. </xs:all>
  323. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  324. </xs:choice>
  325. </xs:complexType>
  326. </xs:element>
  327. <xs:element name='item'>
  328. <xs:complexType>
  329. <xs:all>
  330. <xs:element name='first' type='xs:string'/>
  331. <xs:element name='last' type='xs:string'/>
  332. <xs:element name='nick' type='xs:string'/>
  333. <xs:element name='email' type='xs:string'/>
  334. </xs:all>
  335. <xs:attribute name='jid' type='xs:string' use='required'/>
  336. </xs:complexType>
  337. </xs:element>
  338. </xs:schema>
  339. ]]></code>
  340. </section1>
  341. </xep>