-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep-0058.xml
182 lines (173 loc) · 6.64 KB
/
xep-0058.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
176
177
178
179
180
181
182
<?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>Multi-User Text Editing</title>
<abstract>This document defines how several people may simultaneously edit text.</abstract>
&LEGALNOTICE;
<number>0058</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<dependencies/>
<supersedes/>
<supersededby/>
<shortname>N/A</shortname>
<author>
<firstname>Alexey</firstname>
<surname>Shchepin</surname>
<email>alexey@sevcom.net</email>
<jid>aleksey@jabber.ru</jid>
</author>
<revision>
<version>0.1</version>
<date>2002-11-12</date>
<initials>as</initials>
<remark>Initial version.</remark>
</revision>
</header>
<section1 topic="Introduction">
<p>
This document defines an XMPP protocol extension for editing one text
document by several people.
This can be useful when several people write different parts of one single
document, or one person edits the text and other people can see the
changes.
The advantage of using this protocol in compared to using a version
control systems is that all changes are distributed between editors in
real-time.
</p>
</section1>
<section1 topic="Protocol description">
<p>
To start editing a file, the user must subscribe to it on special "server"
The server stores text files. A User first can ask for list of these documents.
</p>
<example caption="User asks the server list of editable texts"><![CDATA[<iq type='get' to='server' id='mute1'>
<list xmlns='http://jabber.org/protocol/mute#server'/>
</iq>]]></example>
<p>
After that the server returns a list of the documents. For each list
item an ID and description is given.
</p>
<example caption="Ancestor returns list of editable texts"><![CDATA[<iq type='result' to='editor1' id='mute1'>
<list xmlns='http://jabber.org/protocol/mute#server'>
<item id='id1' desc='Useful text'/>
<item id='id2' desc='Useless text'/>
</list>
</iq>]]></example>
<p>
Then the user can send a subscribe request to the server by sending the documents ID.
Attribute <tt>type</tt> can be <tt>rdwr</tt> for full access or
<tt>rdonly</tt> for read-only access.
</p>
<example caption="User sends subscribe request"><![CDATA[<iq type='set' to='server' id='mute2'>
<subscribe xmlns='http://jabber.org/protocol/mute#server'>
<item id='id1' type='rdwr'/>
</subscribe>
</iq>]]></example>
<example caption="Positive response from server on subscribe
request"><![CDATA[<iq type='result' to='editor1' id='mute2'/>]]></example>
<example caption="Negative response from server on subscribe
request"><![CDATA[<iq type='error' to='editor1' id='mute2'>
<subscribe xmlns='http://jabber.org/protocol/mute#server'>
<item id='id1' type='rdwr'/>
</subscribe>
<error code="405">Not Allowed</error>
</iq>]]></example>
<p>
After successful subscription, the server sends the full contents of the document to
the new editor.
</p>
<example caption="Server sends text to editor"><![CDATA[<iq type='set' to='editor1' id='mute3'>
<text xmlns='http://jabber.org/protocol/mute#editor' id='id1'>
...
8. Admin Use Cases
8.1. Banning a User
8.2. Modifying the Ban List
8.3. Granting Membership
8.4. Revoking Mambership
8.5. Modifying the Member List
8.6. Granting Moderator Privileges
8.7. Revoking Moderator Privileges
8.8. Modifying the Moderator List
...
</text>
</iq>]]></example>
<example caption="Positive response from editor"><![CDATA[<iq type='result' to='server' id='mute3'/>]]></example>
<p>
If an editor wants to commit the changes he made, then he sends a patch file to this text
in GNU diff(1) unified format without first two lines (they specify file
names and modification dates, that is not needed).
</p>
<example caption="Editor sends patch to server"><![CDATA[<iq type='set' to='server' id='mute4'>
<patch xmlns='http://jabber.org/protocol/mute#server' id='id1'>
@@ -2,7 +2,7 @@
8.1. Banning a User
8.2. Modifying the Ban List
8.3. Granting Membership
- 8.4. Revoking Mambership
+ 8.4. Revoking Membership
8.5. Modifying the Member List
8.6. Granting Moderator Privileges
8.7. Revoking Moderator Privileges
</patch>
</iq>]]></example>
<example caption="Server accepts patch"><![CDATA[<iq type='result' to='editor1' id='mute4'/>]]></example>
<example caption="Server not accepts patch"><![CDATA[<iq type='error' to='editor1' id='mute4'>
<patch xmlns='http://jabber.org/protocol/mute#server' id='id1'>
@@ -2,7 +2,7 @@
8.1. Banning a User
8.2. Modifying the Ban List
8.3. Granting Membership
- 8.4. Revoking Mambership
+ 8.4. Revoking Membership
8.5. Modifying the Member List
8.6. Granting Moderator Privileges
8.7. Revoking Moderator Privileges
</patch>
<error code="405">Not Allowed</error>
</iq>]]></example>
<p>
If server accepts the patch, then it resends it to all subscribed text editors and readers.
</p>
<example caption="Server resend accepted patch to all editors and readers
of this text"><![CDATA[<iq type='set' to='editor1' id='mute5'>
<patch xmlns='http://jabber.org/protocol/mute#editor' id='id1'>
@@ -2,7 +2,7 @@
8.1. Banning a User
8.2. Modifying the Ban List
8.3. Granting Membership
- 8.4. Revoking Mambership
+ 8.4. Revoking Membership
8.5. Modifying the Member List
8.6. Granting Moderator Privileges
8.7. Revoking Moderator Privileges
</patch>
</iq>]]></example>
<example caption="Positive response from editors and readers"><![CDATA[<iq type='result' to='server' id='mute5'/>]]></example>
<p>
If server receives an error IQ reply from one of the editors/readers on any of
above requests, then it must remove him from subscribers list and may
send a message to him about this.
</p>
</section1>
<section1 topic="Formal Definitions">
<example caption="DTD for http://jabber.org/protocol/mute#server"><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
<!ELEMENT list ((item)*)>
<!ELEMENT subscribe (item)>
<!ELEMENT item EMPTY>
<!ATTLIST item
id CDATA #REQUIRED
desc CDATA #IMPLIED
type ( rdwr | rdonly ) #IMPLIED >
<!ELEMENT patch (#PCDATA)>]]></example>
<example caption="DTD for http://jabber.org/protocol/mute#editor"><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
<!ELEMENT patch (#PCDATA)>
<!ELEMENT text (#PCDATA)>]]></example>
</section1>
</xep>