XEP-0055: Jabber Search
Abstract: | This specification provides canonical documentation of the jabber:iq:search namespace currently in use within the Jabber community. |
Author: | Peter Saint-Andre |
Copyright: | © 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Active |
Type: | Historical |
Version: | 1.3 |
Last Updated: | 2009-09-15 |
NOTICE: This Historical specification provides canonical documentation of a protocol that is in use within the Jabber/XMPP community. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it might be converted to standards-track in the future or might be obsoleted by a more modern protocol.
Table of Contents
1. Introduction
2. Use Cases
2.1. Searching
3. Extensibility
4. Internationalization Considerations
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
7.2. Field Standardization
8. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
1. Introduction
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.
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 Data Forms [1] protocol, as described below.
2. Use Cases
2.1 Searching
搜索一个字段
In order to search an information respository, a user first needs to discover what search fields are supported by the service:
<iqtype='get' from='romeo@montague.net/home' to='characters.shakespeare.lit' id='search1' xml:lang='en'> <queryxmlns='jabber:iq:search'/> </iq>
The service MUST then return the possible search fields to the user, and MAY include instructions:
<iqtype='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search1' xml:lang='en'> <queryxmlns='jabber:iq:search'> <instructions> Fill in one or more fields to search for any matching Jabber users. </instructions> <first/> <last/> <nick/> <email/> </query> </iq>
The user MAY then submit a search request, specifying values for any desired fields:
<iqtype='set' from='romeo@montague.net/home' to='characters.shakespeare.lit' id='search2' xml:lang='en'> <queryxmlns='jabber:iq:search'> <last>Capulet</last> </query> </iq>
The service SHOULD then return a list of search results that match the values
provided:
服务器必须返回匹配结果值的搜索结果列表
<iqtype='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search2' xml:lang='en'> <queryxmlns='jabber:iq:search'> <itemjid='juliet@capulet.com'> <first>Juliet</first> <last>Capulet</last> <nick>JuliC</nick> <email>juliet@shakespeare.lit</email> </item> <itemjid='tybalt@shakespeare.lit'> <first>Tybalt</first> <last>Capulet</last> <nick>ty</nick> <email>tybalt@shakespeare.lit</email> </item> </query> </iq>
If there are no matching directory entries, the service MUST return an empty <query/> element:
如果没有匹配的实体,服务器必须返回一个空的<query/>节点
<iqtype='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search2' xml:lang='en'> <queryxmlns='jabber:iq:search'/> </iq>
3. Extensibility
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, Data Forms SHOULD be used; a host MUST NOT add new fields to the 'jabber:iq:search' namespace. Support for extensibility via Data Forms is RECOMMENDED, but is not required for compliance with this document.
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 Field Standardization for Data Forms [2]. Implementations supporting this extensibility mechanism SHOULD support field standardization as well.
<iqtype='get' from='juliet@capulet.com/balcony' to='characters.shakespeare.lit' id='search3' xml:lang='en'> <queryxmlns='jabber:iq:search'/> </iq>
<iqtype='result' from='characters.shakespeare.lit' to='juliet@capulet.com/balcony' id='search3' xml:lang='en'> <queryxmlns='jabber:iq:search'> <instructions> Use the enclosed form to search. If your Jabber client does not support Data Forms, visit http://shakespeare.lit/ </instructions> <xxmlns='jabber:x:data'type='form'> <title>User Directory Search</title> <instructions> Please provide the following information to search for Shakespearean characters. </instructions> <fieldtype='hidden' var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <fieldtype='text-single' label='Given Name' var='first'/> <fieldtype='text-single' label='Family Name' var='last'/> <fieldtype='list-single' label='Gender' var='x-gender'> <optionlabel='Male'><value>male</value></option> <optionlabel='Female'><value>female</value></option> </field> </x> </query> </iq>
<iqtype='set' from='juliet@capulet.com/balcony' to='characters.shakespeare.lit' id='search4' xml:lang='en'> <queryxmlns='jabber:iq:search'> <xxmlns='jabber:x:data'type='submit'> <fieldtype='hidden'var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <fieldvar='x-gender'> <value>male</value> </field> </x> </query> </iq>
<iqtype='result' from='characters.shakespeare.lit' to='juliet@capulet.com/balcony' id='search4' xml:lang='en'> <queryxmlns='jabber:iq:search'> <xxmlns='jabber:x:data'type='result'> <fieldtype='hidden'var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <reported> <fieldvar='first'label='Given Name'type='text-single'/> <fieldvar='last'label='Family Name'type='text-single'/> <fieldvar='jid'label='Jabber ID'type='jid-single'/> <fieldvar='x-gender'label='Gender'type='list-single'/> </reported> <item> <fieldvar='first'><value>Benvolio</value></field> <fieldvar='last'><value>Montague</value></field> <fieldvar='jid'><value>benvolio@montague.net</value></field> <fieldvar='x-gender'><value>male</value></field> </item> <item> <fieldvar='first'><value>Romeo</value></field> <fieldvar='last'><value>Montague</value></field> <fieldvar='jid'><value>romeo@montague.net</value></field> <fieldvar='x-gender'><value>male</value></field> </item> </x> </query> </iq>
4. Internationalization Considerations
The intent of the <first/> and <last/> 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 <first/> for the given name and <last/> for the family name, NOT the other way around.
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.
<iqtype='submit' from='confucius@scholars.lit/home' to='registrar.scholars.lit' id='kj3b157n' xml:lang='en'> <queryxmlns='jabber:iq:register'> <username>confucius</username> <first>Qui</first> <last>Kong</last> </query> </iq>
5. Security Considerations
There are no security features or concerns related to this proposal.
6. IANA Considerations
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [3].
7. XMPP Registrar Considerations
The XMPP Registrar [4] shall include the following information in its registries.
7.1 Protocol Namespaces
The XMPP Registrar includes the 'jabber:iq:search' namespace in its registry of protocol namespaces.
7.2 Field Standardization
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.
<form_type> <name>jabber:iq:search</name> <doc>XEP-0055</doc> <desc>Forms enabling directory searches.</desc> <field var='first' type='text-single' label='Given Name'/> <field var='last' type='text-single' label='Family Name'/> <field var='nick' type='text-single' label='Nickname'/> <field var='email' type='text-single' label='Email Address'/> </form_type>
8. XML Schema
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='jabber:iq:search' xmlns='jabber:iq:search' elementFormDefault='qualified'> <xs:importnamespace='jabber:x:data' schemaLocation='http://www.xmpp.org/schemas/x-data.xsd'/> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0055: http://www.xmpp.org/extensions/xep-0055.html </xs:documentation> </xs:annotation> <xs:elementname='query'> <xs:complexType> <xs:choice> <xs:allxmlns:xdata='jabber:x:data'> <xs:elementname='instructions'type='xs:string'/> <xs:elementname='first'type='xs:string'/> <xs:elementname='last'type='xs:string'/> <xs:elementname='nick'type='xs:string'/> <xs:elementname='email'type='xs:string'/> <xs:elementref='xdata:x'minOccurs='0'/> </xs:all> <xs:elementref='item'minOccurs='0'maxOccurs='unbounded'/> </xs:choice> </xs:complexType> </xs:element> <xs:elementname='item'> <xs:complexType> <xs:all> <xs:elementname='first'type='xs:string'/> <xs:elementname='last'type='xs:string'/> <xs:elementname='nick'type='xs:string'/> <xs:elementname='email'type='xs:string'/> </xs:all> <xs:attributename='jid'type='xs:string'use='required'/> </xs:complexType> </xs:element> </xs:schema>
相关推荐
xmpp-over-websocket 的目标是提供一个实时信息基于 xmpp 和 websocket pull 或者 poll 的解决方案。 Getting Started Clone git 库的子模块,运行通讯脚本,然后每个子模块会生成一个发布包。 步骤:1) 部署发布包...
JMeterPlugins-XMPP-1.4.0
XMPP-3921 doc XMPP-3921 doc XMPP-3921 doc XMPP-3921 doc
Android XMPP 即时通讯 包括服务器客户端
java本地可用,连接、登陆、接收消息
标签:activemq-xmpp-5.6.0-sources.jar,activemq,xmpp,5.6.0,sources,jar包下载,依赖包
Android-XMPP-openfire-实现IM
xmpp-hybrid-app-examples-源码.rar
标签:activemq-xmpp-5.4.3.jar,activemq,xmpp,5.4.3,jar包下载,依赖包
标签:activemq-xmpp-4.1.2.jar,activemq,xmpp,4.1.2,jar包下载,依赖包
XMPP-RFC3921(中文),xmpp中文文档
XMPP是一个开放式的XML...在 RFC 2779 [IMP-REQS] 中指定的提供即时消息和出席信息功能的扩展,定义在 XMPP-IM 协议 [the Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence] 中。
标签:activemq-xmpp-5.6.0.jar,activemq,xmpp,5.6.0,jar包下载,依赖包
xmpp-ftw angular conversejs 克隆这个应用程序用户angluar-xmpp-services。 UI 是从 conversejs 中窃取的。 这是alpha软件
标签:activemq-xmpp-5.4.2-sources.jar,activemq,xmpp,5.4.2,sources,jar包下载,依赖包
iOS XMPP - 简书1
标签:activemq-xmpp-5.3.0-sources.jar,activemq,xmpp,5.3.0,sources,jar包下载,依赖包
标签:activemq-xmpp-5.4.0-javadoc.jar,activemq,xmpp,5.4.0,javadoc,jar包下载,依赖包
标签:activemq-xmpp-4.1.2-javadoc.jar,activemq,xmpp,4.1.2,javadoc,jar包下载,依赖包
标签:activemq-xmpp-5.4.3-sources.jar,activemq,xmpp,5.4.3,sources,jar包下载,依赖包