<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE abiword PUBLIC "-//ABISOURCE//DTD AWML 1.0 Strict//EN" "http://www.abisource.com/awml.dtd">
<abiword template="false" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" xid-max="376" xmlns:dc="http://purl.org/dc/elements/1.1/" fileformat="1.1" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:awml="http://www.abisource.com/awml.dtd" xmlns="http://www.abisource.com/awml.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" props="dom-dir:ltr; document-footnote-restart-section:0; document-endnote-type:numeric; document-endnote-place-enddoc:1; document-endnote-initial:1; lang:en-GB; document-endnote-restart-section:0; document-footnote-restart-page:0; document-footnote-type:numeric; document-footnote-initial:1; document-endnote-place-endsection:0">
<!-- ======================================================================== -->
<!-- This file is an AbiWord document.                                        -->
<!-- AbiWord is a free, Open Source word processor.                           -->
<!-- More information about AbiWord is available at http://www.abisource.com/ -->
<!-- You should not edit this file by hand.                                   -->
<!-- ======================================================================== -->

<metadata>
<m key="dc.format">application/x-abiword</m>
<m key="abiword.generator">AbiWord</m>
</metadata>
<history version="206" edit-time="36605" last-saved="1116770695" uid="a95767ea-c764-11d9-95bd-f14686585b13">
<version id="63" started="1116397154" uid="b7bd4748-c776-11d9-95bd-f14686585b13" auto="0" top-xid="84"/>
<version id="85" started="1116408084" uid="29d4e74c-c785-11d9-8c3f-cccac9bcc4d6" auto="0" top-xid="154"/>
<version id="93" started="1116420346" uid="04a52e18-c79f-11d9-8002-a9573736a81c" auto="0" top-xid="181"/>
<version id="94" started="1116422184" uid="08d6104c-c79f-11d9-8002-a9573736a81c" auto="1" top-xid="183"/>
<version id="95" started="1116422210" uid="180e5286-c79f-11d9-8002-a9573736a81c" auto="1" top-xid="183"/>
<version id="96" started="1116422327" uid="5dbf2f44-c79f-11d9-8002-a9573736a81c" auto="0" top-xid="183"/>
<version id="97" started="1116660867" uid="c313f028-c9ca-11d9-8eb8-a7a1b7404e64" auto="0" top-xid="185"/>
<version id="123" started="1116672351" uid="56f0555c-c9f8-11d9-90af-a77fd9711c6f" auto="0" top-xid="193"/>
<version id="165" started="1116682984" uid="9664f608-ca06-11d9-9fc0-ab103dd5f30c" auto="0" top-xid="248"/>
<version id="167" started="1116689407" uid="fc85be1c-ca11-11d9-8a7b-d8c3f8c69bde" auto="0" top-xid="273"/>
<version id="177" started="1116748153" uid="9624c72a-ca99-11d9-84e7-d59e50a2a5c1" auto="0" top-xid="275"/>
<version id="191" started="1116749993" uid="5d7e4308-caa1-11d9-84e7-d59e50a2a5c1" auto="0" top-xid="286"/>
<version id="206" started="1116767041" uid="794eab08-caca-11d9-99cb-f57e0ca92284" auto="0" top-xid="331"/>
</history>
<styles>
<s followedby="Normal" name="Heading 1" basedon="Normal" type="P" props="keep-with-next:1; margin-top:0.3056in; font-weight:bold; margin-bottom:0.0417in; font-family:Arial; font-size:17pt"/>
<s type="P" name="Normal" followedby="Current Settings" props="font-family:Times New Roman; margin-top:0pt; font-style:normal; margin-left:0pt; margin-bottom:0pt; dom-dir:ltr; text-align:justify; text-indent:0in; text-position:normal; line-height:1.0; text-decoration:none; bgcolor:transparent; margin-right:0pt; font-variant:normal; color:000000; font-weight:normal; font-size:12pt; widows:2; font-stretch:normal"/>
<s followedby="Normal" name="Heading 2" basedon="Normal" type="P" props="keep-with-next:1; margin-top:0.3056in; font-weight:bold; margin-bottom:0.0417in; font-family:Arial; font-size:14pt"/>
<s followedby="Normal" name="Heading 3" basedon="Normal" type="P" props="keep-with-next:1; margin-top:0.3056in; font-weight:bold; margin-bottom:0.0417in; font-family:Arial; font-size:12pt"/>
<s followedby="Normal" name="Contents 1" basedon="Normal" type="P" props="list-delim:%L.; list-decimal:.; list-style:Numbered List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Normal" name="Contents 2" basedon="Normal" type="P" props="list-delim:%L.; list-decimal:.; list-style:Numbered List; start-value:1; field-color:transparent; margin-left:1.0000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Normal" name="Contents 3" basedon="Normal" type="P" props="list-delim:%L.; list-decimal:.; list-style:Numbered List; start-value:1; field-color:transparent; margin-left:1.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Normal" name="Contents 4" basedon="Normal" type="P" props="list-delim:%L.; list-decimal:.; list-style:Numbered List; start-value:1; field-color:transparent; margin-left:2.0000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Normal" name="Numbered Heading 1" basedon="Heading 1" type="P" props="list-delim:%L.; list-style:Numbered List; start-value:1; field-color:transparent; field-font:Arial; margin-left:0.0in; text-indent:0.0in; tabstops:0.299306in/L0"/>
<s followedby="Normal" name="Numbered Heading 2" basedon="Heading 2" type="P" props="list-delim:%L.; list-style:Numbered List; start-value:1; field-color:transparent; field-font:Arial; margin-left:0.0in; text-indent:0.0in; tabstops:0.299306in/L0"/>
<s type="P" name="Square List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Square List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s type="P" name="Lower Roman List" basedon="Normal" followedby="Current Settings" props="list-delim:%L; list-decimal:.; list-style:Lower Roman List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s type="P" name="Diamond List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Diamond List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s type="P" name="Numbered List" followedby="Current Settings" props="list-delim:%L.; list-decimal:.; list-style:Numbered List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Current Settings" name="Endnote Text" basedon="Normal" type="C"/>
<s type="P" name="Triangle List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Triangle List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s followedby="Normal" name="Numbered Heading 3" basedon="Heading 3" type="P" props="list-delim:%L.; list-style:Numbered List; start-value:1; field-color:transparent; field-font:Arial; margin-left:0.0in; text-indent:0.0in; tabstops:0.299306in/L0"/>
<s type="P" name="Dashed List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Dashed List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s type="P" name="Upper Roman List" basedon="Numbered List" followedby="Current Settings" props="list-delim:%L; list-decimal:.; list-style:Upper Roman List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s followedby="Normal" name="Heading 4" basedon="Normal" type="P" props="keep-with-next:1; margin-top:0.3056in; font-weight:bold; margin-bottom:0.0417in; font-family:Arial; font-size:12pt"/>
<s type="P" name="Heart List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Heart List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s followedby="Normal" name="Contents Header" basedon="Normal" type="P" props="keep-with-next:1; font-size:16pt; margin-bottom:0.0813in; font-weight:bold; text-align:center; font-family:Arial; margin-top:0.1667in"/>
<s type="P" name="Upper Case List" basedon="Numbered List" followedby="Current Settings" props="list-delim:%L); list-decimal:.; list-style:Upper Case List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s type="P" name="Bullet List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Bullet List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Symbol"/>
<s type="P" name="Hand List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Hand List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s type="P" name="Tick List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Tick List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s type="P" name="Lower Case List" basedon="Numbered List" followedby="Current Settings" props="list-delim:%L); list-decimal:.; list-style:Lower Case List; start-value:1; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:NULL"/>
<s type="P" name="Block Text" basedon="Normal" followedby="Current Settings" props="margin-bottom:0.0813in; margin-right:1.0000in; margin-left:1.0000in"/>
<s followedby="Normal" name="Section Heading" basedon="Numbered Heading 1" type="P" props="list-delim:Section %L.; list-style:Numbered List; start-value:1; field-color:transparent; field-font:Arial; margin-left:0.0in; text-indent:0.0in; tabstops:1.100000in/L0"/>
<s type="P" name="Implies List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Implies List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Symbol"/>
<s type="P" name="Box List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Box List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s type="P" name="Star List" followedby="Current Settings" props="list-delim:%L; list-decimal:NULL; list-style:Star List; start-value:0; field-color:transparent; margin-left:0.5000in; text-indent:-0.2938in; field-font:Dingbats"/>
<s followedby="Normal" name="Chapter Heading" basedon="Numbered Heading 1" type="P" props="list-delim:Chapter %L.; list-style:Numbered List; start-value:1; field-color:transparent; field-font:Arial; margin-left:0.0in; text-indent:0.0in; tabstops:1.100000in/L0"/>
</styles>
<lists>
<l id="1003" parentid="0" type="5" start-value="0" list-delim="%L" list-decimal="NULL"/>
<l id="1006" parentid="0" type="5" start-value="0" list-delim="%L" list-decimal="NULL"/>
</lists>
<pagesize pagetype="A4" orientation="portrait" width="8.267717" height="11.692913" units="in" page-scale="1.000000"/>
<section xid="83">
<p style="Heading 1" xid="84" props="text-align:center"><c props="lang:en-GB">AbiTalk Protocol Proposal</c></p>
<p style="Normal" xid="286"></p>
<p style="Normal" xid="281"></p>
<toc xid="283">
</toc><p style="Normal" xid="282"></p>
<p style="Heading 2" xid="228" props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal"><c props="font-family:Arial; text-decoration:none; color:000000; font-size:14pt; text-position:normal; font-weight:bold; font-style:normal; lang:en-GB">History</c></p>
<p style="Normal" xid="235" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.5:	Clarify network topology and sign on process; add &lt;connect/&gt;, &lt;listdocuments/&gt; and &lt;document/&gt; commands; removed invite command.</c></p>
<p style="Normal" xid="322" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"></p>
<p style="Normal" xid="321" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.4 (22/05/05):	Scope checking added to token negotiation; added &lt;lockout/&gt; command.</c></p>
<p style="Normal" xid="274" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"></p>
<p style="Normal" xid="275" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.3 (21/05/05):	Removed &lt;document/&gt; as the document should be transmitted using change records as envisaged by the GOCollab proposal. Reworked the handshake in order to minimise the document lockout.</c></p>
<p style="Normal" xid="236" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"></p>
<p style="Normal" xid="237" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.2:	Added 'encoding' and 'compression' attributes to &lt;document&gt;;</c></p>
<p style="Normal" xid="238" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"></p>
<p style="Normal" xid="239" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.1 (18/05/05): 	Tokens of limited scope; more detailed token negotiation &amp; error handling; new commands (invite, chksum); changed &lt;error&gt; to &lt;status&gt;; UT_AbiTalk::Result enum.</c></p>
<p style="Normal" xid="240" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:0.0000in; lang:en-GB; text-align:justify; text-indent:0.0000in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"></p>
<p style="Normal" xid="241" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:1.5743in; lang:en-GB; text-align:justify; text-indent:-1.5743in; text-position:normal; margin-top:0.0000in; font-weight:normal; line-height:1.000000; margin-bottom:0.0000in; font-size:12pt; margin-right:0.0000in; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">Draft 0.0 (17/05/05): 	Original proposal.</c></p>
<p style="Heading 2" xid="242" props="font-family:Arial; dom-dir:ltr; font-style:normal; margin-left:0.0000in; lang:en-GB; text-align:justify; text-indent:0.0000in; text-position:normal; margin-top:0.3056in; font-weight:bold; line-height:1.000000; margin-bottom:0.0417in; font-size:14pt; margin-right:0.0000in; text-decoration:none"><c props="lang:en-GB">Introduction</c></p>
<p style="Normal" xid="229"><c props="lang:en-GB">AbiTalk is an attempt to define a protocol that would allow for exchange of information necessary to implement collaborative features, such as those proposed in GOCollab. The principal challenge in a collaborative conversation is the maintaining of the coordinate systems in the two documents in synchronic state. The GOCollab proposal assumes that all conversation partners maintain a coordinance mapping for this purpose. This idea, however, depends on being able to establish an initial synchronic state, and this task is the principal concern of the AbiTalk protocol.</c></p>
<p style="Normal" xid="230"></p>
<p style="Normal" xid="265"><c props="lang:en-GB">There are number of issues that this protocol does not strive to address:</c></p>
<p style="Normal" xid="266"></p>
<p level="1" listid="1003" parentid="0" style="Normal" xid="232" props="start-value:0; text-indent:-0.2938in; list-style:Bullet List; field-font:Symbol; margin-left:0.5000in"><field type="list_label" xid="267" props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal"></field><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">	</c><c props="lang:en-GB">This protocol is not interested in what kind of information is required to accomplish the collaboration; it simply assumes that any application using it defines the specific commands required to achieve it's aims and that it registers handlers for these commands with the generic AbiTalk handler. What this protocol does is to define the handshake process and provides means through which it is to be extended to exchange arbitrary information between the communicating processes.</c></p>
<p style="Normal" xid="233"></p>
<p level="1" listid="1006" parentid="0" style="Normal" xid="271" props="start-value:0; text-indent:-0.2938in; list-style:Bullet List; field-font:Symbol; margin-left:0.5000in"><field type="list_label" xid="269" props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal"></field><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">	</c><c props="lang:en-GB">This protocol is not interested in the underlying transport mechanism. A simplest implementation could just use TCP/IP, but a more robust implementation might prefer some other protocol that would minimise problems with firewalls, etc.</c></p>
<p style="Normal" xid="375"></p>
<p level="1" listid="1006" parentid="0" style="Normal" xid="373" props="start-value:0; text-indent:-0.2938in; list-style:Bullet List; field-font:Symbol; margin-left:0.5000in"><field type="list_label" xid="374" props="width:0in; font-family:Times New Roman; display:inline; font-style:normal; font-weight:normal; bgcolor:transparent; lang:en-GB; text-position:normal; homogeneous:1; color:000000; font-variant:normal; text-decoration:none; font-size:12pt; height:0in; list-style:Bullet List; font-stretch:normal"></field><c props="width:0in; font-family:Times New Roman; display:inline; font-style:normal; font-weight:normal; bgcolor:transparent; lang:en-GB; text-position:normal; homogeneous:1; color:000000; font-variant:normal; text-decoration:none; font-size:12pt; height:0in; list-style:Bullet List; font-stretch:normal">	This protocol does not define a sing-on process; that is the responsibility of the underlying carrier protocol.</c></p>
<p style="Normal" xid="264"></p>
<p style="Normal" xid="263" props="text-indent:0in; margin-left:0pt"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">The initial proposal is for the protocol to be xml-based (using xml 1.0 specification); this is not critical to the protocol, but has two significant advantages. First of all, parsing becomes a simple matter due to the built-in xml parser in AbiWord (and presumably in other GOffice applications). Second, and perhaps more significant, AbiWord piece table is xml-like, so that representing AbiWord events in xml should be straightforward.</c></p>
<p style="Heading 2" xid="169" props="lang:en-GB"><c props="lang:en-GB">Topology</c></p>
<p style="Normal" xid="324" props="lang:en-GB"><c props="lang:en-GB">The protocol work with a nominal host topology. Where there is no formal server, a mechanism needs to be put in place for promoting one of the clients to a nominal host if the existing host is no longer present; this mechanism is not specified by AbiTalk.</c></p>
<p style="Heading 2" xid="323" props="lang:en-GB"><c props="lang:en-GB">Message Format</c></p>
<p xid="2" props="font-family:Times New Roman; font-size:12pt; dom-dir:ltr; lang:en-GB; font-weight:normal; text-position:normal; text-align:left; font-style:normal; text-decoration:none">A message passed between two processes has the following format</p>
<p xid="85" props="text-align:left; dom-dir:ltr"></p>
<p xid="3" props="text-align:left; dom-dir:ltr">&lt;<c props="font-weight:bold">abitalk</c> version="1.0" [uid="xxxxx"] [token="xxxxx"]&gt;</p>
<p xid="4" props="text-align:left; dom-dir:ltr; margin-left:1.00cm">&lt;<c props="font-weight:bold">%cmd%</c>&gt;[content]&lt;/<c props="font-weight:bold">%cmd%</c>&gt;[&lt;<c props="font-weight:bold">%cmd%</c>&gt;[content]&lt;/<c props="font-weight:bold">%cmd%</c>&gt;]</p>
<p xid="5" props="text-align:left; dom-dir:ltr">&lt;/<c props="font-weight:bold">abitalk</c>&gt;</p>
<p xid="6" props="text-align:left; dom-dir:ltr"></p>
<p xid="7" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">version:<c props="lang:en-GB">	</c>identifies <c props="lang:en-GB">version of AbiWord sending the message.</c></p>
<p xid="8" props="text-align:left; dom-dir:ltr"></p>
<p xid="9" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">uid:<c props="lang:en-GB">	</c>the uuid of the document which is the subject of conversation;<c props="lang:en-GB"> </c>if not provided, the commands to follow <c props="lang:en-GB">can only</c> carry <c props="lang:en-GB">out </c>operations<c props="lang:en-GB"> </c> on the application, not documents.</p>
<p xid="12" props="text-align:left; dom-dir:ltr"></p>
<p xid="13" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">token:<c props="lang:en-GB">	</c>authorisation token. The token is a standard uuid with time<c props="lang:en-GB"> </c>stamp <c props="lang:en-GB">adjusted</c> to indicate when the authorisation token<c props="lang:en-GB"> </c>expires. Tokens are connected to a specific document uid.<c props="lang:en-GB"> </c>If no token is provided the only legitimate commands to follow<c props="lang:en-GB"> </c>are &lt;token&gt; and &lt;getdoc&gt; (see below).</p>
<p xid="18" props="text-align:left; dom-dir:ltr"></p>
<p xid="19" props="text-align:left; dom-dir:ltr">Single message can contain one or more commands:</p>
<p xid="20" props="text-align:left; dom-dir:ltr"></p>
<p xid="21" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">%cmd%: specific command name, which can be followed by set of<c props="lang:en-GB"> </c>attributes</p>
<p xid="23" props="text-align:left; dom-dir:ltr"></p>
<p xid="24" props="text-align:left; dom-dir:ltr; margin-left:1.00cm">[content]: content specific to given command (optional)</p>
<p xid="25" props="text-align:left; dom-dir:ltr"></p>
<p xid="280" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">The entire &lt;abitalk&gt;&lt;/abitalk&gt; fragment represents an atomic operation on the document from the user's point of view (i.e., an operation which can be undone by a single Undo command). The user-atomic operation can consist of an arbitrary number of operations carried on the document.</c></p>
<p style="Heading 2" xid="27"><c props="lang:en-GB">Control </c>commands<c props="lang:en-GB"> (predefined)</c></p>
<p xid="28" props="text-align:left; dom-dir:ltr">The following commands are predefined by the protocol:</p>
<p xid="30" props="text-align:left; dom-dir:ltr"></p>
<p xid="31" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">&lt;<c props="font-weight:bold">getdoc</c> <c props="lang:en-GB">[</c>name="xxxx"<c props="lang:en-GB"> |  uid="xxxx"</c>/&gt;<c props="lang:en-GB">: r</c>equest for the entire document identified by <c props="lang:en-GB">either a </c>name<c props="lang:en-GB">, or the doc uid [the latter option is only available in response to ABT_ChecksumMismatch status, see below].</c></p>
<p xid="92" props="text-align:left; dom-dir:ltr; margin-left:1.00cm"></p>
<p xid="93" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">&lt;</c><c props="font-family:Times New Roman; text-decoration:none; lang:en-GB; text-position:normal; font-weight:bold; font-style:normal; font-size:12pt">connect</c><c lang="en-GB" props="lang:en-GB"> client-id="xxxx"/&gt;: opens connection to a known server.</c></p>
<p xid="370" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="371" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">client-id:	an id that identifies the user; this has to be known to both the server and client (and needs to be set-up by the system administrator); the AbiTalk protocol does not specify the format which this id should take.</c></p>
<p xid="360" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="361" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">&lt;</c><c lang="en-GB" props="font-weight:bold; lang:en-GB">listdocuments</c><c lang="en-GB" props="lang:en-GB">&gt;[</c><c lang="en-GB" props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">&lt;</c><c lang="en-GB" props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:bold; font-style:normal; lang:en-GB">document</c><c lang="en-GB" props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB"> uid="xxx"/&gt;]</c><c lang="en-GB" props="lang:en-GB">&lt;/</c><c lang="en-GB" props="font-weight:bold; lang:en-GB">listdocuments</c><c lang="en-GB" props="lang:en-GB">&gt;: If the body of this command is empty, it is interpreted as request for a list of available documents on the server. The response to the request is provided by sending filling &lt;listdocuments/&gt; body with &lt;document/&gt; messages.</c></p>
<p xid="362" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="363" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">&lt;</c><c lang="en-GB" props="font-weight:bold; lang:en-GB">document</c><c lang="en-GB" props="lang:en-GB"> uid="xxx"/&gt;: identifies document known to the server.</c></p>
<p xid="364" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="365" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">uid:	uuid of the document.</c></p>
<p xid="366" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="359" props="text-align:left; text-indent:-2.12cm; dom-dir:ltr; margin-left:3.00cm"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">&lt;</c><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:bold; font-style:normal; text-decoration:none">chksum</c><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none"> uid="xxx"&gt;[sum]&lt;/</c><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:bold; font-style:normal; text-decoration:none">chksum</c><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">&gt;: either request for checksum for specific document, or reply to checksum request; in the latter case the checksum is supplied as content of the element.</c></p>
<p xid="162" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.7868in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"></p>
<p xid="163" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3931in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">uid:	uuid of the document for which the checksum is sought/provided.</c></p>
<p xid="164" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.7868in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"></p>
<p xid="165" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.7868in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"><c props="lang:en-GB">&lt;</c><c props="font-weight:bold; lang:en-GB">reqtoken</c><c lang="en-GB" props="lang:en-GB"> type="0|1" [uid="xxxx"]/&gt;: Request for authorisation token.</c></p>
<p xid="186" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3750in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"></p>
<p xid="189" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3750in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"><c lang="en-GB" props="lang:en-GB">type:	either 0 or one (see token handling below).</c></p>
<p xid="187" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3750in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"></p>
<p xid="190" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3750in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"><c lang="en-GB" props="lang:en-GB">uid:	required for type-1 tokens; specifies uid of previous type-0 token.</c></p>
<p xid="191" props="margin-top:0.0000in; margin-left:1.1806in; text-indent:-0.3750in; dom-dir:ltr; margin-bottom:0.0000in; line-height:1.000000; text-align:left; margin-right:0.0000in"></p>
<p xid="39" props="font-family:Times New Roman; dom-dir:ltr; font-style:normal; margin-left:3.00cm; lang:en-GB; text-align:left; text-indent:-2.00cm; text-position:normal; font-weight:normal; text-decoration:none; font-size:12pt">&lt;<c props="font-weight:bold">token</c> uid="xxxx"<c props="lang:en-GB"> life="life in ms" chksum="xxx" type ="0|1" </c><c props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">[start="pos1" end="pos2"]</c>/&gt;<c props="lang:en-GB">:  </c><c props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">Response to request for authorisation token (see token handling).</c></p>
<p xid="86" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="87" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"><c props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">uid:	token.</c>uid<c props="lang:en-GB"> </c>in standard uuid format. The token is specific to<c props="lang:en-GB"> </c>the document uid, and has a limited lifespan; the expiry time is<c props="lang:en-GB"> </c>indicated by the uid time stamp.</p>
<p xid="156" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="107" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"><c props="lang:en-GB">life:	indicates the intended life of the token in ms.</c></p>
<p xid="135" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="138" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"><c props="lang:en-GB">chksum: crc32 check sum for the document that will be compared to the remote document; this has to refer to the document </c><c props="font-style:italic; lang:en-GB">before</c><c props="font-style:normal; lang:en-GB"> the changes that are to be broadcast were made (</c><c props="lang:en-GB; font-weight:bold; font-style:normal">NB:</c><c lang="en-GB" props="lang:en-GB; font-weight:bold; font-style:normal"> will need to store checksums in AbiWord version table to allow for offline editing.</c><c lang="en-GB" props="lang:en-GB; font-weight:normal; font-style:normal">)</c></p>
<p xid="194" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="195" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB; font-weight:normal; font-style:normal">type:	0 or 1 (see token handling below).</c></p>
<p xid="250" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="251" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">start/end: indicate that token is requested only for a limited range in the document. </c></p>
<p xid="43" props="font-family:Times New Roman; font-size:12pt; dom-dir:ltr; lang:en-GB; font-weight:normal; text-position:normal; text-align:left; font-style:normal; text-decoration:none"></p>
<p xid="161" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">&lt;<c props="font-weight:bold">release</c> uid="xxxx"/&gt;<c props="lang:en-GB">: </c><c props="font-family:Times New Roman; font-size:12pt; color:000000; text-decoration:none; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">sent to release authorisation token; as soon soon as this command is sent, the token becomes invalid. This command is required for the entire transaction to be valid (see below notes on token handling).</c></p>
<p xid="88" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="51" props="text-align:left; text-indent:-1.00cm; dom-dir:ltr; margin-left:3.00cm">uid:<c props="lang:en-GB">	</c>authorisation token.</p>
<p xid="52" props="text-align:left; dom-dir:ltr"></p>
<p xid="58" props="text-align:justify; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm"><c props="lang:en-GB">&lt;</c><c props="font-weight:bold; lang:en-GB">lockout</c><c lang="en-GB" props="lang:en-GB"> owner-id="xxxx" uid="xxx" start="pos1" end="pos2" life="Xms" on="0|1"/&gt;: indicates that an authorisation token has been issued to another conversation partner for the specified region of the document. The recepient might want to use visual means to indicate to the user that a particular region is locked for editing.</c></p>
<p xid="305" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="306" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">owner-id: uuid identifying the owner of the authorisation token.</c></p>
<p xid="354" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="353" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">uid:	uuid identifying the document to which lockout applies.</c></p>
<p xid="307" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="308" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">start/end: the region of the document to which lockout applies.</c></p>
<p xid="309" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="310" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">life:	the life span of the lockout in ms.</c></p>
<p xid="311" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="312" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"><c lang="en-GB" props="lang:en-GB">on:	boolean value indicating whether the region is locked or unlocked for editing.</c></p>
<p xid="313" props="text-align:left; text-indent:-0.3750in; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="304" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm">&lt;<c props="font-weight:bold; lang:en-GB">status</c> id="errno"<c props="lang:en-GB"> [param="xxx"]</c>&gt;[<c props="lang:en-GB">v</c>erbose msg]&lt;/<c props="font-weight:bold; lang:en-GB">status</c>&gt;<c props="lang:en-GB">: send in response to executing previous message to indicate success or failure.</c></p>
<p xid="89" props="text-align:left; text-indent:-2.00cm; dom-dir:ltr; margin-left:3.00cm"></p>
<p xid="59" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">id: UT_AbiTalk::Result</p>
<p xid="120" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">		</c>enum Result {<c props="lang:en-GB">	</c>ABT_Success = 0,</p>
<p xid="121" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_Error = 1,</p>
<p xid="122" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_TokenExpired = 2,<c props="lang:en-GB">    // param="uid"</c></p>
<p xid="123" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_NoCmdHandler = 3,<c props="lang:en-GB"> // param="cmd"</c></p>
<p xid="124" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_CommandFailed = 4,</p>
<p xid="125" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_InvitationRejected = 5,</p>
<p xid="126" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_TokenPending = 6,</p>
<p xid="127" props="text-align:left; dom-dir:ltr; margin-left:2.12cm">				ABT_Unwind = 7<c props="lang:en-GB">,</c></p>
<p xid="134" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">				ABT_ConnectionRefused = 8, // param="delay in s"</c></p>
<p xid="144" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">				ABT_ChecksumMismatch = 9, // param="checksum"</c></p>
<p xid="167" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">				ABT_UnknownDocument = 10,</c></p>
<p xid="192" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">				ABT_TokenRequestCancelled = 11</c></p>
<p xid="193" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"><c props="lang:en-GB">				};</c></p>
<p xid="129" props="text-align:left; dom-dir:ltr; margin-left:2.12cm"></p>
<p xid="90" props="font-family:Times New Roman; margin-left:2.12cm; font-size:12pt; dom-dir:ltr; lang:en-GB; text-align:left; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none"><c props="font-family:Times New Roman; font-size:12pt; lang:en-GB; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">param: an optional parameter specific to the status number</c><c props="lang:en-GB">v</c>erbose msg: optional </p>
<p xid="252" props="font-family:Times New Roman; margin-left:2.12cm; font-size:12pt; dom-dir:ltr; lang:en-GB; text-align:left; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none"></p>
<p xid="253" props="font-family:Times New Roman; margin-left:2.12cm; font-size:12pt; dom-dir:ltr; lang:en-GB; text-align:left; text-position:normal; font-weight:normal; font-style:normal; text-decoration:none">verbose, human readable, error message.</p>
<p style="Heading 2" xid="63"><c props="lang:en-GB">Performative commands (user-defined)</c></p>
<p xid="254" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">The protocol only defines the control commands. The commands that are used to perform actual operations on the document are defined by the application and </c>are handled by command handlers registered via UT_AbiTalk::registerHandler()<c props="lang:en-GB"> with the AbiTalk handler.</c> <c props="lang:en-GB">T</c>heir number and meaning has no direct impact on the protocol itself (i.e., the protocol can be easily expanded as new features are added).<c props="lang:en-GB"> If a command is received for which no handler is available, status ABT_NoCmdHandler is returned to the sending process (see section on error handling below).</c></p>
<p style="Heading 2" xid="65"><c props="lang:en-GB">Sign-on process</c></p>
<p style="Normal" xid="340"><c props="lang:en-GB">The sign-on process is dependent on the nature of the conversation.</c></p>
<p style="Heading 3" xid="367"><c props="lang:en-GB">Sign-on in server-centred conversation</c></p>
<p style="Normal" xid="368"><c props="lang:en-GB">If the conversation is based on interaction with an automated sever, any authentication is the responsibility of the carrying protocol. Once the client is authenticated and it sends the &lt;</c><c lang="en-GB" props="lang:en-GB">connect/&gt; command to the AbiTalk hander. In response to the command, the server check that the client-id is valid, and if it is opens outgoing connection to the connecting client.</c></p>
<p style="Heading 3" xid="369"><c lang="en-GB" props="lang:en-GB">Sign-on in distributed context</c></p>
<p style="Normal" xid="342"><c props="lang:en-GB">In a distributed context, the sign on mechanism has to be provided by the carrier protocol; it is not specified by AbiTalk. Since the AbiTalk protocol is nominal-host-based, the carrying protocol has to provide means through which a client can be promoted to host if the original host leaves the conversation; again this mechanism is not part of AbiTalk.</c></p>
<p style="Heading 2" xid="339">Token handling</p>
<p xid="66" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">As indicated in the introduction, the principal challenge of collaborative conversation is to establish a correct initial state of the coordinate systems. This issue is complicated by network lag, particularly if more than two partners are involved in the conversation. The present proposal attempts to work around this through a two stage handshake. The first stage of the handshake is used to allow any pending messages to get through and the document stabilise, the second stage carries out the correlation of the documents.</c></p>
<p xid="247" props="text-align:left; dom-dir:ltr"></p>
<p xid="248" props="text-align:left; dom-dir:ltr"><c props="lang:en-GB">In the following </c>A and B are<c props="lang:en-GB"> </c>Abi processes<c props="lang:en-GB">, and A wishes to have a conversation with B. C is a third (silent) partner in the conversation.</c></p>
<p style="Heading 3" xid="94"><c props="lang:en-GB">The procedure by the initiator (A)</c></p>
<p xid="95" props="text-align:justify; dom-dir:ltr">If A wishes to send commands to B, A <c props="lang:en-GB">needs</c> an authorisitation token<c props="lang:en-GB">. There are two types of tokens; a token that gives A the authority to send commands to B is called type-1 token. There is also type-0 token which is in the initial negotiation.</c></p>
<p xid="201" props="text-align:left; dom-dir:ltr"></p>
<p xid="202" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">To obtain a type-1 token, A first requests type-0 token (&lt;reqtoken type="0"/&gt;) and waits for response. While waiting, A has to process all messages from B up to either receiving a type-0 token or status ABT_TokenRequestCancelled. Also while waiting, all local events have to be temporarily suspended and queued up. (This is necessary because until A obtains the type-1 token, A is unable to notify B of these changes.)</c></p>
<p xid="198" props="text-align:left; dom-dir:ltr"></p>
<p xid="199" props="text-align:left; dom-dir:ltr"><c props="lang:en-GB">If A receives ABT_TokenRequestCancelled, A has to restart the entire process.</c></p>
<p xid="196" props="text-align:left; dom-dir:ltr"></p>
<p xid="203" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">Upon the receipt of type-0 token, A computes a checksum for the current state of the document and associates the token with mapping for translation of local document coordinances to those reflecting the state of the document at the receipt of the type-0 token. It then sends request for type-1 token (&lt;reqtoken type="1" uid="xxxx"/&gt;), and waits for the token. At this point the queued up local changes can be applied but they a separate queue has to be maintained so that these changes can be send to B later; it should be noted, however, that if revisions are not enabled in the documents, some of the events in the local queue might no longer be valid (as when the processing of remote messages resulted in the removal of a part of the document on which a local event carried out operations) -- these events have to be removed from both queues (NB: it is technically simpler to maintain a single queue and contain the local lockout until type-1 token is obtained.)</c></p>
<p xid="197" props="text-align:left; dom-dir:ltr"></p>
<p xid="150" props="text-align:left; dom-dir:ltr"><c props="lang:en-GB">If the A receives ABT_TokenRequestCancelled, it has to restart the entire process.</c></p>
<p xid="204" props="text-align:left; dom-dir:ltr"></p>
<p xid="205" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">If A receives type-1 token, it finds the mapping associated with the corresponding type-0 token, and replaces the token with the type-1 token. It can now start sending commands to B using the type-1 token, translating all coordiances using the mapping.</c></p>
<p xid="212" props="text-align:left; dom-dir:ltr"></p>
<p xid="213" props="text-align:justify; dom-dir:ltr"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">If A receives ABT_ChecksumMismatch in response to token-1 request, in the first instance it ascertains if it has a mapping that would allow it to translate local coordinaces to those with the identical check sum; it it has, it can re-request authorisation token for that particular checksum. If A does not have the means to for coordinance translation, it has to reload the document from B, and restart the authorisation process; it can then either discard the local changes or attempt to merge the differences between the local and remote documents and then send these changes back to B.</c></p>
<p xid="218" props="text-align:left; dom-dir:ltr"></p>
<p xid="215" props="text-align:justify; dom-dir:ltr"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">When finished with the whole command sequence, A has to release the token by sending &lt;release uuid="xxx"&gt; command. At this point B accepts all changes as permanent, and broadcasts the changes to other interested parties.</c></p>
<p xid="219" props="text-align:left; dom-dir:ltr"></p>
<p xid="220" props="text-align:justify; dom-dir:ltr"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">If A receives ABT_TokenExpired before it sent the release command, it will have to restart the entire process and resend all commands that we dispatches with the expired token.</c></p>
<p xid="278" props="text-align:justify; dom-dir:ltr"></p>
<p xid="279" props="text-align:justify; dom-dir:ltr"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">A can cancel the entire transaction using the given type-1 token by sending B ABT_Unwind message.</c></p>
<p xid="222" props="text-align:left; dom-dir:ltr"></p>
<p xid="223" props="text-align:justify; dom-dir:ltr"><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">When A first receives its type-1 token, it notes its intended life span. If A does not receive a status message for a particular message dispatched to B, A should wait for time equal to the intended life span of the token </c><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:italic; lang:en-GB">after </c><c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">the token expires; if no status message is received during this time, A should proceed as if receiving a generic ABT_Error status.</c></p>
<p style="Heading 3" xid="217" props="lang:en-GB"><c props="lang:en-GB">The procedure for the recipient (B)</c></p>
<p xid="151" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">Upon the receipt of the request for type-0 token from A, B waits for period of 2 * longest life span from outstanding tokens to allow any pending messages to be processed by all parties. After that B computes a checksum for the present state of the document, and creates a type-0 token. It also creates a mapping for translation of document coordinances from those corresponding to the state of the document at the point the token was created and associates that mapping with the type-0 token. It then  sends the type-0 token to A.</c></p>
<p xid="152" props="text-align:left; dom-dir:ltr"></p>
<p xid="153" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">Upon receipt of type-1 token request &lt;reqtoken type="1" chksum="xxx" [start="x" end="y"] uid="xxx"/&gt; B first checks that the request is associated with a valid type-0 token, if not B dispatches ABT_TokenRequestCancelled status, and destroys the associated type-0 token.</c></p>
<p xid="226" props="text-align:left; dom-dir:ltr"></p>
<p xid="227" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">If the token-0 uid is valid, B checks the supplied chksum against the checksum associated with the type-0 token in its own records; if the checksums do not match, B sends ABT_ChecksumMismatch, setting the param attribute to the checksum of B's version of the document. It maintains the type-0 token waiting for A's response. If it receives any other command from A than a new request for type-1 token, it destroys the type-0 token.</c></p>
<p xid="142" props="text-align:left; dom-dir:ltr"></p>
<p xid="143" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">If checksums and type-0 tokens match, B proceeds to check if there are any outstanding tokens for the same document (identified by uid) with an overlapping scope (i.e., whether document ranges indicated by start and end attributes overlap); if they do, B issues ABT_TokenRequestCancelled status and destroys the associated type-0 token.</c></p>
<p xid="276" props="text-align:justify; dom-dir:ltr"></p>
<p xid="277" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">If the token scope is unique, </c>B <c props="lang:en-GB">creates</c> <c props="lang:en-GB">type-1</c> token<c props="lang:en-GB"> and replaces with it the type-0 associated with its mapping. It then dispatches the type-1 token to A.</c></p>
<p xid="208" props="text-align:left; dom-dir:ltr"></p>
<p xid="211" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">If B receives any other requests for authorisation tokens from other parties while there is an outstanding type-0 token, B will queue these requests, and reply with status ABT_TokenPending. This queue will be processed as soon as either the type-0 token expires, or the associated type-1 token is issued. At the same time, B sends corresponding lockout-on message to all other partners.</c></p>
<p xid="145" props="text-align:left; dom-dir:ltr"></p>
<p xid="314" props="text-align:left; dom-dir:ltr"><c props="lang:en-GB">When B receives &lt;release/&gt; command from A, it finalises all changes made with the specific type-1 token, destroys the token and dispatches lockout-off message to all other partners.</c></p>
<p xid="146" props="text-align:justify; dom-dir:ltr">B keeps an eye on the life of <c props="lang:en-GB">all </c>the issued token<c props="lang:en-GB">s</c>; if <c props="lang:en-GB">a</c> token expires before the &lt;release&gt; cmd is received for <c props="lang:en-GB">any</c> token, B reverses all operation<c props="lang:en-GB">s</c> carried on the document using that token and dispatches <c props="lang:en-GB">status ABT_</c>Token<c props="lang:en-GB">E</c>xpired to <c props="lang:en-GB">the token owner, and corresponding lockout-off message to all other conversation partners.</c></p>
<p xid="105" props="text-align:left; dom-dir:ltr"></p>
<p xid="106" props="text-align:left; dom-dir:ltr"><c lang="en-GB" props="font-style:normal; lang:en-GB">B can cancel a previously issued token at any time by dispatching ABT_TokenExpired status to A; in that case it has to dispatch lockout-off message to all other partners.</c></p>
<p xid="132" props="text-align:left; dom-dir:ltr"></p>
<p style="Normal" xid="133"><c lang="en-GB" props="lang:en-GB">If B finds itself in situation where it repeatedly has to send ABT_TokenExpired to A, B should consider, in the first instance, to prolong the life of the token (within reasonable limits); if this does not remedy the situation, B can send ABT_ConnectionRefused, setting the param to length in seconds for which connection will continue to be refused (or 0 if indefinite).</c></p>
<p style="Heading 3" xid="315"><c lang="en-GB" props="lang:en-GB">Procedure for the silent partner (C)</c></p>
<p style="Normal" xid="316"><c lang="en-GB" props="lang:en-GB">The silent partner C is sent lockout on and off commands by the conversation partner who issues a type-1 token (B). C should </c><c lang="en-GB" props="font-style:italic; lang:en-GB">not</c><c lang="en-GB" props="lang:en-GB"> send format status response to receiving lockout commands.</c></p>
<p style="Normal" xid="317"></p>
<p style="Normal" xid="318"><c lang="en-GB" props="lang:en-GB">C should not request an authorisation token with a scope that overlaps any of the locked regions, and might chose to indicate visually to the user that particular region of the document is currently locked. C also need to keep an eye on the lockout lifespans, and should cancel any that expire in the absence of lockout-off command.</c></p>
<p style="Heading 3" xid="302"><c lang="en-GB" props="lang:en-GB">Token life span</c></p>
<p style="Normal" xid="303"><c lang="en-GB" props="lang:en-GB">The lifespan of a token has to be chosen as a compromise between user responsiveness and the lockout of other users. A</c><c lang="en-GB" props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-GB">t the not excessive typing speed of 5 characters per second an event is generated every 200ms. The token negotiation requires the minimum of four messages being exchanged, which can conceivably take over 1s to negotiate over a long distance connection.</c></p>
<p style="Heading 2" xid="98"><c props="lang:en-GB">Error Handling</c></p>
<p style="Normal" xid="100"><c props="lang:en-GB">A and B are communicating Abi processed.</c></p>
<p style="Normal" xid="101"></p>
<p style="Normal" xid="102"><c props="lang:en-GB">For each message (i.e., the entire &lt;abitalk&gt;&lt;/abitalk&gt; fragment, not just an individual command) that A receives, it has to dispatch a status command indicating whether the operation succeeded. The only exception to this is a message that contains a single &lt;lockout/&gt; command, which A should process, but not respond to.</c></p>
<p style="Normal" xid="319"></p>
<p style="Normal" xid="320"><c props="lang:en-GB">If the operation fails at any stage (i.e., return value is other than ABT_Success or ABT_NoCmdHandler), A has to reverse all operations carried out by B using the specific authorisation token. ABT_NoCmdHandler is a special case, discussed below.</c></p>
<p style="Normal" xid="103"></p>
<p style="Normal" xid="104"><c props="lang:en-GB">For each message that B dispatches, it has to wait for a corresponding status message. If the status received is not ABT_Success or ABT_NoCmdHandler, B's authorisation token is no longer valid and any operations that B might have carried out previously with that token have been undone by A in the target document. B needs to take action appropriate to the status message and, if deemed appropriate, restart the process.</c></p>
<p style="Heading 3" xid="112"><c props="lang:en-GB">ABT_NoCmdHandler</c></p>
<p style="Normal" xid="255"><c props="lang:en-GB">If A cannot execute a performative cmd because no suitable handler is found, it dispatches status message ABT_NoCmdHandler to B, with param set to the command name, and waits for a response.</c></p>
<p style="Normal" xid="115"></p>
<p style="Normal" xid="116"><c props="lang:en-GB">When B receives ABT_NoCmdHandler, it has two options, depending on the command involved. It can decide to abort the whole command sequence, in which case it dispatches ABT_Unwind status message back to A, after which the authorisation token is no longer valid; upon receipt of this message A undoes all operations carried out by B using the specified token.</c></p>
<p xid="72" props="text-align:left; dom-dir:ltr"></p>
<p xid="117" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">Alternatively, B can respond to ABT_NoCmdHandler by sending ABT_Success status. In that case A will simply ignore the particular command, and proceed with processing the next one.</c></p>
<p xid="118" props="text-align:left; dom-dir:ltr"></p>
<p xid="119" props="text-align:justify; dom-dir:ltr"><c props="lang:en-GB">The response to ABT_NoCmdHandler is context sensitive and can vary in different contexts. Therefore, B's responses to ABT_NoCmdHandler must </c><c props="font-style:italic; lang:en-GB">not</c><c lang="en-GB" props="font-style:italic; lang:en-GB"> </c><c lang="en-GB" props="font-style:normal; lang:en-GB">be cached.</c></p>
<p style="Heading 2" xid="73" props="keep-with-next:yes">Example command</p>
<p xid="74" props="text-align:left; dom-dir:ltr; orphans:0; widows:0">A sample command (after the intial han<c props="lang:en-GB">d s</c>hake and token retrieval) could look like:</p>
<p xid="76" props="text-align:left; dom-dir:ltr"></p>
<p xid="77" props="text-align:left; dom-dir:ltr">&lt;abitalk version="1.0" uuui="xxxxxx" token="yyyyyy"&gt;</p>
<p xid="78" props="text-align:left; dom-dir:ltr"><c props="lang:en-GB">	</c>&lt;insertspan start=<c props="lang:en-GB">"</c>5<c props="lang:en-GB">"</c> end=<c props="lang:en-GB">"</c>7<c props="lang:en-GB">"</c> props="font-size:12pt"&gt;my span&lt;/insertspan&gt;</p>
<p xid="79" props="text-align:left; dom-dir:ltr">&lt;/abitalk&gt;</p>
<p xid="80" props="text-align:left; dom-dir:ltr"></p>
<p xid="81" props="text-align:left; dom-dir:ltr">On receipt of the message, the <c props="lang:en-GB">abitalk protocol handler checks the incoming commands against known handlers. In this case 'insertspan' is not part of the protocol itself, so the handler interrogates it's list of registered handlers; if it finds one for 'insertspan' it passes the command attributes and content to the handler. If it does not find a suitable handler, it sends status message ABT_NoCmdHandler.</c></p>
<p style="Heading 2" xid="108"><c props="lang:en-GB">Implications for AbiWord</c></p>
<p style="Normal" xid="256"><c props="lang:en-GB">Certain requirements will need to be satisfied in order of collaborative conversation to be possible, so of which emerge from the proposed protocol, and have some implications for the existing AbiWord code base. The following should be noted:</c></p>
<p style="Heading 3" xid="291"><c props="lang:en-GB">All events persistent</c></p>
<p style="Normal" xid="259"><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">All operations carried out by user will need to be representable by 'change records' (this is a consequence of the GOCollab philosophy); at present there are number of operations that do not fall into this category (this includes changes to style definitions, meta data and other document properties). This will also need to include changes to any application wide preference that affect how the document is perceived by the user.</c></p>
<p style="Heading 3" xid="292"><c props="height:0in; display:inline; lang:en-GB; list-style:Bullet List; width:0in; homogeneous:1">Local event queue</c></p>
<p style="Normal" xid="293"><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">There has to be a means of temporarily queueing document events on the local level during the token negotiation. This will require significant changes to the PieceTable.</c></p>
<p style="Normal" xid="294"></p>
<p style="Normal" xid="295"><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">Currently change records are created by the PieceTable and are atomic from the PieceTable point of view (being grouped into user-atomic groups for the purposes of undo). The queueing of document events would require two sets of change records: a first layer representing user-atomic changes would need to be created in the PD_Document functions and then filtered to the PieceTable functions through a single point of PD_Document; the filtering function would handle the queueing and would dispatch the first tier change records to the appropriate PieceTable functions (which then create the second level change records that are stored for undo purposes).</c></p>
<p style="Normal" xid="296"></p>
<p style="Normal" xid="297"><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">Is it open to consideration which tier of change records should be dispatched through the AbiTalk protocol. Dispatching the first tier change records would mean that fewer messages would be required, with increased processing carried out by all conversation partners. Considering the need to minimise effects of network lag, this might be the preferable option</c></p>
<p style="Normal" xid="298"></p>
<p style="Normal" xid="299"><c props="width:0in; font-family:Times New Roman; display:inline; color:000000; font-weight:normal; text-position:normal; lang:en-GB; font-style:normal; font-variant:normal; list-style:Bullet List; bgcolor:transparent; homogeneous:1; text-decoration:none; height:0in; font-size:12pt; font-stretch:normal">An alternative solution to the event queue would be to discard any local operations during the token negotiation lockout. This is unlikely to be adequate though in the light of the earlier discussion of token life span.</c></p>
<p style="Heading 3" xid="300"><c props="height:0in; display:inline; lang:en-GB; list-style:Bullet List; width:0in; homogeneous:1">Document merging</c></p>
<p style="Normal" xid="301"><c props="width:0in; font-family:Times New Roman; display:inline; font-variant:normal; font-weight:normal; lang:en-GB; font-style:normal; color:000000; homogeneous:1; bgcolor:transparent; font-size:12pt; text-decoration:none; list-style:Bullet List; height:0in; text-position:normal; font-stretch:normal">If offline editing is to be an option, the Merge Documents features must be implemented and work reliably.</c></p>
</section>
</abiword>

