forked from xsf/xeps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0145.xml
176 lines (145 loc) · 6.35 KB
/
xep-0145.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Annotations</title>
<abstract>This document defines a protocol for making annotations about roster items and other entities.</abstract>
&LEGALNOTICE;
<number>0145</number>
<status>Active</status>
<type>Historical</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0049</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>rosternotes</shortname>
<schemaloc>
<url>http://www.xmpp.org/schemas/rosternotes.xsd</url>
</schemaloc>
<author>
<firstname>Stefan</firstname>
<surname>Strigler</surname>
<email>[email protected]</email>
<jid>[email protected]</jid>
</author>
<revision>
<version>1.0</version>
<date>2006-03-23</date>
<initials>psa</initials>
<remark><p>Per a vote of the Jabber Council, advanced to Active.</p></remark>
</revision>
<revision>
<version>0.2</version>
<date>2005-07-15</date>
<initials>psa</initials>
<remark><p>Editorial review: changed type to Historical; changed namespace to storage:rosternotes; corrected schema; specified use of DateTime profile from XEP-0082; corrected some small textual errors.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2004-11-05</date>
<initials>st</initials>
<remark><p>Initial version.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Many modern IM clients offer functionality that enables users to make notes about items in their roster. This comes in handy if users don't have meaningful information in their vCard or if you need to remember additional things related to a roster item.</p>
<p>This specification defines a protocol for storing annotations about a given set of entities. Its primary goal is to enable users to store some personal piece of information with their roster items. &xep0049; provides with a convenient method for storing user data on the server using the 'jabber:iq:private' namespace; all we need to do is define a namespace and schema for storing this sort of information. For this the 'storage' element introduced in &xep0048; is reused, and a new namespace of 'storage:rosternotes' is added.</p>
</section1>
<section1 topic='The storage:rosternotes Namespace' anchor='ns_storage_notes'>
<p>Annotations are stored using server-side private XML storage (the 'jabber:iq:private' namespace). A storage element marked by the storage:rosternotes namespace contains a collection of one or more <note/> elements, each representing a note about a given entity. For any given JID there MUST NOT be more than one note.</p>
<p>The 'jid' attribute of the <note/> element SHOULD be used without a resource. Along with the annotation a client MAY choose to store creation time ('cdate') and modification time ('mdate') as attributes to the <note/> element containing the note; these attributes MUST conform to the DateTime profile specified in &xep0082; and the timezone SHOULD be UTC.</p>
<example caption='Storing Annotations'>
<![CDATA[
<iq type='set' id='a1'>
<query xmlns='jabber:iq:private'>
<storage xmlns='storage:rosternotes'>
<note jid='[email protected]'
cdate='2004-09-24T15:23:21Z'
mdate='2004-09-24T15:23:21Z'>Seems to be a good writer</note>
<note jid='[email protected]'
cdate='2004-09-27T17:23:14Z'
mdate='2004-09-28T12:43:12Z'>Oh my sweetest love ...</note>
</storage>
</query>
</iq>
]]></example>
<p>Note: All notes are stored as a "bundle" within the same <storage/> element.</p>
<p>Retrieving notes uses the protocol described in <cite>XEP-0049</cite>.</p>
<example caption='Retrieving Annotations'>
<![CDATA[
<iq type='get' id='a2'>
<query xmlns='jabber:iq:private'>
<storage xmlns='storage:rosternotes'/>
</query>
</iq>
]]></example>
<example caption='Server response'>
<![CDATA[
<iq type='result' id='a2'>
<query xmlns='jabber:iq:private'>
<storage xmlns='storage:rosternotes'>
<note jid='[email protected]'
cdate='2004-09-24T15:23:21Z'
mdate='2004-09-24T15:23:21Z'>Seems to be a good writer</note>
<note jid='[email protected]'
cdate='2004-09-27T17:23:14Z'
mdate='2004-09-28T12:43:12Z'>Oh my sweetest love ...</note>
</storage>
</query>
</iq>
]]></example>
<p>For error conditions please refer to <cite>XEP-0049</cite>.</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>Security considerations related to private XML storage are described in <cite>XEP-0049</cite>.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>No interaction with &IANA; is required as a result of this document.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>No namespaces or parameters need to be registered with the ®ISTRAR; as a result of this document.</p>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='storage:rosternotes'
xmlns='storage:rosternotes'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0145: http://www.xmpp.org/extensions/xep-0145.html
</xs:documentation>
</xs:annotation>
<xs:element name='storage'>
<xs:complexType>
<xs:sequence>
<xs:element ref='note' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='note'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute name='jid' type='xs:string' use='required'/>
<xs:attribute name='cdate' type='xs:dateTime' use='optional'/>
<xs:attribute name='mdate' type='xs:dateTime' use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section1>
</xep>