No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0204.xml 72KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Collaborative Data Objects</title>
  10. <abstract>This document specifies an XMPP protocol extension that supports the exchange of structured data objects.</abstract>
  11. &LEGALNOTICE;
  12. <number>0204</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>TO BE ISSUED</shortname>
  23. <author>
  24. <firstname>Dave</firstname>
  25. <surname>Bryson</surname>
  26. <email>dbryson@mitre.org</email>
  27. </author>
  28. <author>
  29. <firstname>Dan</firstname>
  30. <surname>Winkowski</surname>
  31. <email>winkowsk@mitre.org</email>
  32. </author>
  33. <author>
  34. <firstname>Michael</firstname>
  35. <surname>Krutsch</surname>
  36. <email>michael@mitre.org</email>
  37. </author>
  38. <author>
  39. <firstname>Chad</firstname>
  40. <surname>Smith</surname>
  41. <email>chadsm@mitre.org</email>
  42. </author>
  43. <author>
  44. <firstname>Jasen</firstname>
  45. <surname>Jacobsen</surname>
  46. <email>jasenj1@mitre.org</email>
  47. </author>
  48. <author>
  49. <firstname>Marshall</firstname>
  50. <surname>Huss</surname>
  51. <email>mhuss@mitre.org</email>
  52. </author>
  53. <revision>
  54. <version>0.1</version>
  55. <date>2007-01-17</date>
  56. <initials>psa</initials>
  57. <remark>
  58. <p>Initial published version; modified namespaces to adhere to XSF policy.</p>
  59. </remark>
  60. </revision>
  61. <revision>
  62. <version>0.0.3</version>
  63. <date>2006-12-29</date>
  64. <initials>mwh</initials>
  65. <remark>
  66. <p>Converting to validate against new XEP schema</p>
  67. </remark>
  68. </revision>
  69. <revision>
  70. <version>0.0.2</version>
  71. <date>2006-09-15</date>
  72. <initials>deb</initials>
  73. <remark>
  74. <p>Edits, some reformating, Spell check</p>
  75. </remark>
  76. </revision>
  77. <revision>
  78. <version>0.0.1</version>
  79. <date>2006-08-30</date>
  80. <initials>deb</initials>
  81. <remark>
  82. <p>First draft.</p>
  83. </remark>
  84. </revision>
  85. </header>
  86. <!-- INTRODUCTION -->
  87. <section1 topic="Introduction" anchor="intro">
  88. <p>
  89. While the value of IM and Multi-user chat is obvious to anyone reading this JEP, the potential for ambiguity and miscommunication
  90. (particularly in a structured data environment) may not be. There are several domains where text communication is accompanied
  91. by a need to exchange structured data, e.g.: a help desk dealing with trouble tickets; a financial institution dealing with trades (buy and sell orders),
  92. an emergency scenario with first responders. The purpose of this JEP is to define a set of Collaborative Data Object (CDO) protocols
  93. that support the exchange of structured data objects. These data objects are explicitly described by a declarative language, instantiated as
  94. structured XML, and transported as extended XMPP stanzas. This JEP defines a protocol for exchanging these structured CDOs as
  95. part of a session conversation (either IM or Multi-User Chat) based around a <em>strict synchronization</em> model. In a strict synchronization model,
  96. participants will receive every change made to a CDO. An alternative synchronization model, a
  97. <em>lazy synchronization</em>
  98. model is also described to support users who either do not wish, or are not able because of infrastructure limitations, to receive the CDO stanzas
  99. in real time and wish to explicitly request them.
  100. </p>
  101. </section1>
  102. <!-- REQUIREMENTS -->
  103. <section1 topic="Requirements" anchor="reqs">
  104. <p>This JEP describes a protocol that is designed to fulfill the following requirements: </p>
  105. <ol>
  106. <li>Determine the ability for clients and servers to support and exchange collaborative data objects</li>
  107. <li>Enable the exchange of structured data objects between clients</li>
  108. <li>Define a protocol that supports the synchronization of structure data among participating clients. Currently
  109. the protocol is based on a strict synchronization model where users will receive every change made to a CDO.
  110. Future versions of the protocol may contain a <em>lazy</em> synchronization model that may relax the current approach.
  111. </li>
  112. <li>Operate in both private and group chat</li>
  113. </ol>
  114. <p>Future enhancements may provide the ability to:</p>
  115. <ul>
  116. <li>Query room for active CDOs</li>
  117. <li>Query room history - results in CDO events for playback (per CDO or for all CDOs)</li>
  118. <li>Register methods to a CDO</li>
  119. <li>Register synchronization preference with framework (strict, lazy) CDO</li>
  120. <li>Method invocation request to framework to execute and return response</li>
  121. </ul>
  122. </section1>
  123. <!-- USAGE MODEL -->
  124. <section1 topic="Usage Model" anchor="usemodel">
  125. <p>Here is a high-level description of the flow between two clients exchanging information using the CDO protocol.</p>
  126. <section2 topic="Strict Synchronization mode" anchor="strictmode">
  127. <p>Participants using strict synchronization will receive
  128. <strong>every</strong> change event to the CDOs in a room or private chat.
  129. </p>
  130. <p>Imagine two chat clients,
  131. <strong>A</strong> and
  132. <strong>B</strong>,that wish to share structured data in a synchronized manner.
  133. Both clients want to ensure they have the most up-to-date information. The two endpoints can do so by collaborating on the data using the CDO protocol.
  134. </p>
  135. <p>For example, let's assume the clients wish to coordinate a meeting over chat. The process may look like this:</p>
  136. <ol>
  137. <li>Client
  138. <strong>A</strong> creates a new meeting that contains structured data such as the title of the meeting, participant e-mail list, start time, date,
  139. length, and location.
  140. </li>
  141. <li>Client
  142. <strong>A</strong> sends the meeting information to client B over normal chat.
  143. </li>
  144. <li>When client
  145. <strong>A</strong> adds, updates, or deletes an item on the meeting, the changes are reflected to Client
  146. <strong>B</strong>
  147. </li>
  148. <li>Similarily, when client
  149. <strong>B</strong> adds, updates, or deletes an item on the meeting, the changes are reflected to Client
  150. <strong>A</strong>
  151. </li>
  152. </ol>
  153. <p>The above example describes the main flow between two clients. However a more detailed description of the flow using the example above would look
  154. like the following below. In this example we also show the interaction with the server (server
  155. <strong>X</strong>). Server
  156. <strong>X</strong> is the IM
  157. server that both client
  158. <strong>A</strong> and
  159. <strong>B</strong> are connected to.
  160. </p>
  161. <ol>
  162. <li>Client
  163. <strong>A</strong> wishes to send information about a new meeting to client
  164. <strong>B</strong>
  165. </li>
  166. <li>Client
  167. <strong>A</strong> first sends an IQ packet to client
  168. <strong>B</strong> to determine if the client supports the CDO protocol.
  169. </li>
  170. <li>Client
  171. <strong>B</strong> responds to the IQ packet from client
  172. <strong>A</strong> confirming that it does support the CDO protocol.
  173. </li>
  174. <li>Client
  175. <strong>A</strong> creates a new meeting that contains structured data such as the title of the meeting and the location.
  176. </li>
  177. <li>When client
  178. <strong>A</strong> sends the CDO to client
  179. <strong>B</strong>, the message is intercepted by server
  180. <strong>X</strong>.
  181. </li>
  182. <li>Server
  183. <strong>X</strong>, examines the message from client
  184. <strong>A</strong> and determines that it is a CDO create message. The server
  185. increments the version of the meeting items and forwards the message to client
  186. <strong>B</strong>.
  187. </li>
  188. <li>When client
  189. <strong>A</strong> adds, updates, or deletes an item on the meeting, the changes are first interrogated by server
  190. <strong>X</strong>
  191. and then forwarded to Client
  192. <strong>B</strong>
  193. </li>
  194. <li>Similarily, When client
  195. <strong>B</strong> adds, updates, or deletes an item on the meeting, the changes are first interrogated by server
  196. <strong>X</strong>
  197. and then forwarded to Client
  198. <strong>A</strong>
  199. </li>
  200. <li>After processing the message from Client
  201. <strong>A</strong>, Server
  202. <strong>X</strong> will return a receipt to Client
  203. <strong>A</strong>.
  204. The receipt contains the UUID for the new item along with confirming the event was valid.
  205. </li>
  206. </ol>
  207. </section2>
  208. <section2 topic="Lazy Synchronization mode" anchor="lazymode">
  209. <p>
  210. Lazy synchronization is a proposed alternate synchronization scheme that is appropriate for entities who either do
  211. not wish, or are not able because of infrastructure limitations, to receive the CDO stanzas in real time and wish to
  212. explicitly request them. Under lazy synchronization, entities are only notified that CDOs have been created, retired or
  213. that the existing CDOs that they keep track of have been updated and are now outdated. The details behind these
  214. events are not transmitted. Explicit action is required to resynchronized to the current state for any specific CDO identifier or
  215. change to the strict synchronization scheme. Lazy synchronization is set per endpoint (groupchat room).
  216. </p>
  217. </section2>
  218. </section1>
  219. <!-- DESCRIPTION LANGUAGE -->
  220. <section1 topic="Description Language" anchor="descriptionLanguage">
  221. <p>In topic-focused collaboration, a group of participants come together to discuss particular categories of information. This use of a topic as a focal point is significant because it provides participants with meaningful, often unspoken, context of information. Semantic cues, manipulation capabilities, state transitions, and information presentation are all included in this context.</p>
  222. <p>CDOs leverage topic-focused collaboration by requiring every CDO to be an instance of a type. A type is analogous to a topic because participants are given a common understanding of the information being discussed and its context. This relationship is also similar to the programming concept of a class and an object. Much like a class describes the capabilities of an object, a CDO type describes an instance.</p>
  223. <p>CDO Description Language (CDO-DL) is the means by which a type is defined. It is meant to be a highly extensible framework through which multiple (but equivalent) definitions of type capabilities can exist. This extensibility allows users with different operating environments to collaborate consistently.</p>
  224. <p>Some information is required for every CDO-DL to maintain consistent interpretation:</p>
  225. <ul>
  226. <li>
  227. <strong>UUID</strong>: A universally unique identifier to distinguish this type from all others. This value is meant for machine use, but it may also be structured for human use.</li>
  228. <li>
  229. <strong>Label</strong>: The primary identifier meant for human use. This should concisely describe the data and context of a type. Although uniqueness of this field is not required, it is highly recommended.</li>
  230. <li>
  231. <strong>Version</strong>: The version associated with the type. As a type matures, its UUID and version will change. This also provides a mechanism for determining deprecation of previous versions.</li>
  232. <li>
  233. <strong>Description</strong>: A more complete description of the data and context of a type. A description can exist for individual languages.</li>
  234. <li>
  235. <strong>Schema</strong>: The XML Schema definition of the data associated with a type. This can either be embedded in the CDO-DL or referenced in an external URL.</li>
  236. </ul>
  237. <p>Beyond this core data, every CDO-DL can have multiple (but equivalent) standard-specific implementations for the remaining context of the type:</p>
  238. <ul>
  239. <li>
  240. <strong>Layout</strong>: The means by which data is presented to a user. Layouts are arranged in groups, each with a unique identifier and title. Each group is capable of containing multiple equivalent standard-specific presentations to support a diverse client base, but each group must contain at least an XHTML/XForm presentation. Individual presentations can embedded or referenced in an external URL, and one layout group must be marked as the default layout through which users will initially interact with the data.</li>
  241. <li>
  242. <strong>Method</strong>: The operations which can be carried out on the data. Equivalent standard-specific operations can be grouped together as a single notional method with a single unique identifier and description.</li>
  243. <li>
  244. <strong>State</strong>: The finite states through which a data set can transition. States are individually defined along with the criteria for entering each. State transitions are also defined along with the actions they perform (such as turning on or off specific layouts and methods).</li>
  245. </ul>
  246. </section1>
  247. <!-- PROTOCOL -->
  248. <section1 topic="Protocol" anchor="protocol">
  249. <p>The CDO protocol uses the namespace:
  250. <strong>http://www.xmpp.org/extensions/xep-0204.html#ns</strong>
  251. </p>
  252. <p>
  253. <strong>&lt;data-sync/&gt;</strong> is the root element and
  254. <strong>MUST</strong> be contained within a message stanza
  255. <strong>&lt;message/&gt;</strong> element. When the
  256. <strong>&lt;data-sync&gt;</strong> element is present in the
  257. <strong>&lt;message&gt;</strong>,the message
  258. <strong>MUST</strong> not contain a
  259. <strong>&lt;body&gt;</strong> element.
  260. </p>
  261. <example caption="Message with data-sync element"><![CDATA[
  262. <message to='romeo@example.net/orchard'
  263. from='juliet@example.com/balcony'
  264. type='chat' xml:lang='en'>
  265. <data-sync protocol="1.0" uuid="" type="cdo:Meeting"
  266. event="create" xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  267. <item type="field" uuid="" event="create" ref="/Meeting/Title" version="0">
  268. <value>This is a new meeting</value>
  269. </item>
  270. </data-sync>
  271. </message>
  272. ]]></example>
  273. <p>The
  274. <strong>&lt;data-sync&gt;</strong> element
  275. <strong>may </strong>contain
  276. <strong>&lt;item&gt;</strong> elements.The attributes of the
  277. <strong>&lt;data-sync&gt;</strong> element maintain high-level information about the enclosed
  278. <strong>&lt;item&gt;</strong> elements to help synchronize information exchanged between clients.
  279. </p>
  280. <table caption="Attributes in the &lt;data-sync&gt; element:">
  281. <tr>
  282. <td>
  283. <strong>Attribute</strong>
  284. </td>
  285. <td>
  286. <strong>Description</strong>
  287. </td>
  288. <td>
  289. <strong>Mandatory?</strong>
  290. </td>
  291. </tr>
  292. <tr>
  293. <td> protocol
  294. </td>
  295. <td>
  296. The version of the CDO exchange protocol
  297. </td>
  298. <td>
  299. Yes
  300. </td>
  301. </tr>
  302. <tr>
  303. <td>
  304. uuid
  305. </td>
  306. <td>
  307. A universal unique identification number
  308. </td>
  309. <td>
  310. Yes
  311. </td>
  312. </tr>
  313. <tr>
  314. <td>
  315. packetID
  316. </td>
  317. <td>
  318. a unique number created by the client to identify the cdo request, referenced by the framework
  319. in responses to a client (errors, responses to events). The packetID of the receipt MUST match the original data-synch message from the sender.
  320. </td>
  321. <td>
  322. Yes
  323. </td>
  324. </tr>
  325. <tr>
  326. <td>
  327. type
  328. </td>
  329. <td>
  330. the uuid of the CDO definition (CDO-DL)
  331. </td>
  332. <td>
  333. mandatory on create event and info event, otherwise forbidden
  334. </td>
  335. </tr>
  336. <tr>
  337. <td>
  338. event
  339. </td>
  340. <td>
  341. cdo event type: create, update, retire, info
  342. </td>
  343. <td>
  344. Yes
  345. </td>
  346. </tr>
  347. </table>
  348. <table caption="Attributes in the &lt;item&gt; element:">
  349. <tr>
  350. <td>
  351. <p>
  352. <strong>Attribute</strong>
  353. </p>
  354. </td>
  355. <td>
  356. <p>
  357. <strong>Description</strong>
  358. </p>
  359. </td>
  360. <td>
  361. <p>
  362. <strong>Mandatory?</strong>
  363. </p>
  364. </td>
  365. </tr>
  366. <tr>
  367. <td>
  368. <p>uuid</p>
  369. </td>
  370. <td>
  371. <p>assigned ID of the field instance at creation time</p>
  372. </td>
  373. <td>
  374. <p>Yes</p>
  375. </td>
  376. </tr>
  377. <tr>
  378. <td>
  379. <p>type</p>
  380. </td>
  381. <td>
  382. <p>distinguishes the type of field (allowed children may vary)</p>
  383. </td>
  384. <td>
  385. <p>No</p>
  386. </td>
  387. </tr>
  388. <tr>
  389. <td>
  390. <p>ref</p>
  391. </td>
  392. <td>
  393. <p>xpath reference to the element</p>
  394. </td>
  395. <td>
  396. <p>mandatory on create event and info event, otherwise forbidden</p>
  397. </td>
  398. </tr>
  399. <tr>
  400. <td>
  401. <p>event</p>
  402. </td>
  403. <td>
  404. <p>identified action on the item: create, update, delete, and info with update as default</p>
  405. </td>
  406. <td>
  407. <p>Yes</p>
  408. </td>
  409. </tr>
  410. <tr>
  411. <td>
  412. <p>version</p>
  413. </td>
  414. <td>
  415. <p>integer version number of item being changed</p>
  416. </td>
  417. <td>
  418. <p>Yes</p>
  419. </td>
  420. </tr>
  421. <tr>
  422. <td>
  423. <p>updateStyle</p>
  424. </td>
  425. <td>
  426. <p>indicates inclusive or exclusive update style with exclusive as the default</p>
  427. </td>
  428. <td>
  429. <p>No</p>
  430. </td>
  431. </tr>
  432. </table>
  433. <p>Each &lt;item&gt; <strong>may</strong> contain:
  434. </p>
  435. <ul>
  436. <li>
  437. <p> 0 or 1 (0..1)
  438. <strong>&lt;value&gt;</strong> elements with content corresponding to the change to the identified CDO instance element contents
  439. </p>
  440. </li>
  441. </ul>
  442. <example caption="Value elements"><![CDATA[
  443. <item type="field" uuid="" event="create" ref="/Meeting/Title" version="0">
  444. <value>This is a new meeting</value>
  445. </item>]]></example>
  446. <ul>
  447. <li>
  448. <p> 0 or unbounded (0..*)
  449. <strong>&lt;attribute&gt;</strong> elements.
  450. The name attribute corresponds to the name of the attribute in the CDO-DL. Note: All attributes are sent as part of an item, even those not changed when
  451. using the updateStyle exclusive.
  452. </p>
  453. </li>
  454. </ul>
  455. <example caption="Attribute elements"><![CDATA[
  456. <item type="field" uuid="" event="create" ref="/Meeting/Time/Start" version="0">
  457. <attribute name="date">28 May 2006</attribute>
  458. </item>]]></example>
  459. </section1>
  460. <!-- USE CASES -->
  461. <section1 topic="Use Cases" anchor="usecases">
  462. <section2 topic="Query a client to determine if it supports a CDO message" anchor="queryforcdosupport">
  463. <p>
  464. Client A should send an IQ packet to another client (client B) before exchanging CDO messages to determine
  465. if client B supports CDO processing. This is accomplished using Service Discovery as described in &xep0030;.
  466. </p>
  467. <p>
  468. NOTE: This assumes we register our information in the Jabber registrar. Here is an example of the exchange
  469. between two clients: See Service Discovery for specific packet requirements
  470. </p>
  471. <example caption="Client A construct an IQ packet and sends it to Client B"><![CDATA[
  472. <iq type='get'from='joe@mitre.org/Desktop' to='bob.mitre.org/Laptop'>
  473. <query xmlns='http://jabber.org/protocol/disco#info'/>
  474. </iq>]]></example>
  475. <example caption="Client B receives the packet and responds with the following"><![CDATA[
  476. <iq type='result'
  477. from='bob.mitre.org/Laptop'
  478. to='joe@mitre.org/Desktop'>
  479. <query xmlns='http://jabber.org/protocol/disco#info'>
  480. <identity
  481. category='cdo'
  482. type='text'
  483. name='Collborative Data Objects'/>
  484. <feature var='http://www.xmpp.org/extensions/xep-0204.html#ns'/>
  485. <feature var='jabber:iq:register'/>
  486. <feature var='jabber:iq:search'/>
  487. <feature var='jabber:iq:time'/>
  488. <feature var='jabber:iq:version'/>
  489. </query>
  490. </iq>
  491. ]]></example>
  492. <example caption="When client A receives the response above, it will look for the value of the var attribute in feature"><![CDATA[
  493. <feature var='http://www.xmpp.org/extensions/xep-0204.html#ns'/>
  494. ]]></example>
  495. <example caption="If client A finds the value"><![CDATA[
  496. http://www.xmpp.org/extensions/xep-0204.html#ns
  497. ]]></example>
  498. <p>
  499. it can assume the Client B supports the CDO protocol.
  500. </p>
  501. </section2>
  502. <section2 topic="Query the Server to determine available CDO types" anchor="queryfortypes">
  503. <p>
  504. A CDO client can determine what types of CDOs are available by querying the server
  505. </p>
  506. <example caption="Client A constructs an IQ get and sends it to Server X"><![CDATA[
  507. <iq type='get' from='joe@mitre.org/Desktop' id='cdo_list_1>
  508. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-types'/>
  509. </iq>
  510. ]]></example>
  511. <example caption="Server X responds with an IQ result listing the available CDO types"><![CDATA[
  512. <iq type='result' to= id='joe@mitre.org/Desktop' cdo_list_1>
  513. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-types'>
  514. <item id='1023'>
  515. <name>Meeting CDO</name>
  516. <description>Describes a meeting</description>
  517. </item>
  518. <item id='2001'>
  519. <name>Trouble ticket</name>
  520. <description>Describes a Trouble shooting ticket</description>
  521. </item>
  522. </query>
  523. </iq>
  524. ]]></example>
  525. <example caption="Client A selects the CDO type it would like to download by the item id"><![CDATA[
  526. <iq type='get' from='joe@mitre.org/Desktop' id='cdo_list_2>
  527. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-types'>
  528. <item id = '1023'/>
  529. </query>
  530. </iq>
  531. ]]></example>
  532. <example caption="Server X responds with the selected CDO type. Returning the CDO description
  533. language needed by the client"><![CDATA[
  534. <iq type='result' to='joe@mitre.org/Desktop' id='cdo_list_2'>
  535. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-types'>
  536. <cdo-dl>
  537. ...Actual CDO-DL definition
  538. </cdo-dl>
  539. </query>
  540. </iq>
  541. ]]></example>
  542. </section2>
  543. <section2 topic="Query the Server to determine the state of a specific CDO" anchor="cdostate">
  544. <p>
  545. A CDO client can query the server to determine the specific state of a particular CDO:
  546. </p>
  547. <example caption="Client A constructs an IQ get and sends it to Server X wishing to obtain the current state of an existing CDO"><![CDATA[
  548. <iq type='get' from='joe@mitre.org/Desktop' id='cdo_state_1>
  549. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-state'/>
  550. <cdo uuid='ly8qoxl6r0rk42faell48a'/>
  551. </query>
  552. </iq>
  553. ]]></example>
  554. <example caption="Server X responds with an IQ result showing the current state of the selected CDO."><![CDATA[
  555. <iq type='result' to='joe@mitre.org/Desktop' id='cdo_state_1'>
  556. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-state'>
  557. <data-sync protocol="1.0"
  558. uuid="ly8qoxl6r0rk42faell48a"
  559. type="cdo:Meeting"
  560. packetID="0001"
  561. event="info"
  562. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  563. <item type="field"
  564. uuid="kej3n4kd"
  565. event="info"
  566. ref="/Meeting/Attendees"
  567. version="2">
  568. <value>Bob, Jim, Mike, Added Dave</value>
  569. </item>
  570. </data-sync>
  571. </query>
  572. </iq>
  573. ]]></example>
  574. <p>Note an event type of info. This requires all attributes for the data-sync element and items be present</p>
  575. </section2>
  576. <section2 topic="Query an endpoint for a list of CDOs" anchor="cdolist">
  577. <p>In some cases a client may be interested in the state of all CDOs belonging to a specific endpoint - for example a chat room.</p>
  578. <example caption="Client A constructs an IQ get and sends it to Server X wishing to obtain the current state of all CDOs belonging to the CDO users chatroom"><![CDATA[
  579. <iq type='get' from='joe@mitre.org/Desktop' to='cdo_users@mitre.org' id='cdo_state_2>
  580. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-state'>
  581. <cdo uuid='*'/>
  582. </query>
  583. </iq>
  584. ]]></example>
  585. <example caption="Server X responds with an IQ result listing all current CDOs belonging to the CDO users chatroom"><![CDATA[
  586. <iq type='result' to='joe@mitre.org/Desktop' id='cdo_state_2'>
  587. <query xmlns='http://www.xmpp.org/extensions/xep-0204.html#ns-state'>
  588. <data-sync protocol="1.0"
  589. uuid="ly8qoxl6r0rk42faell48a"
  590. type="cdo:Meeting"
  591. event="info"
  592. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns"/>
  593. <data-sync protocol="1.0"
  594. uuid="9sdfs454jh5"
  595. type="cdo:Location"
  596. event="info"
  597. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns"/>
  598. ...
  599. </query>
  600. </iq>
  601. ]]></example>
  602. <p>Note the value of the uuid for the cdo tag above uses an asterisk (*) to indicate all CDOs</p>
  603. <p>
  604. If desired, Client A can then query the Server for the details on the state of a specific CDO using the protocol described earlier.
  605. </p>
  606. </section2>
  607. <section2 topic="Create a new CDO" anchor="cdocreate">
  608. <p>When two endpoints (client A and client B) wish to create a new CDO. Each client and server MUST follow this algorithm:</p>
  609. <example caption="Client A creates a new CDO and sends it to client B"><![CDATA[
  610. <message
  611. to='joe@mitre.org/Desktop'
  612. from='bob@mitre.org/Laptop'
  613. type='chat'
  614. xml:lang='en'>
  615. <data-sync protocol="1.0"
  616. uuid=""
  617. type="cdo:Meeting"
  618. packetID="0001"
  619. event="create"
  620. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  621. <item type="field" uuid="" event="create" ref="/Meeting/Title" version="0">
  622. <value>Technical Exchange Meeting</value>
  623. </item>
  624. </data-sync>
  625. </message>
  626. ]]></example>
  627. <p>Here client A, has created a packetID and set event=create in both &lt;data-sync&gt; and &lt;item&gt;. The version MUST be set to zero</p>
  628. <p>
  629. Next, the message is intercepted by Server X. Server X is the IM server that both clients are connected to. When the server receives
  630. the message, it MUST increment the version number and assign a uuid for both the &lt;data-sync&gt; and &lt;item&gt;. Once processed
  631. Server X MUST send a copy of the message back to client A as a receipt that the message has been processed by Server X and forward the message to client B
  632. </p>
  633. <example caption="Send receipt from Server X to client A"><![CDATA[
  634. <message
  635. to='joe@mitre.org/Desktop'
  636. from='joe@mitre.org/Desktop'
  637. type='chat'
  638. xml:lang='en'>
  639. <data-sync protocol="1.0"
  640. uuid="ly8qoxl6r0rk42faell48a"
  641. type="cdo:Meeting"
  642. packetID="0001"
  643. event="create"
  644. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  645. <item type="field"
  646. uuid="xdF10939"
  647. event="create"
  648. ref="/Meeting/Title"
  649. version="1">
  650. <value>Technical Exchange Meeting</value>
  651. </item>
  652. </data-sync>
  653. </message>
  654. ]]></example>
  655. <example caption="Forward the processed message from Server X to client B"><![CDATA[
  656. <message
  657. to='joe@mitre.org/Desktop'
  658. from='bob@mitre.org/Laptop'
  659. type='chat'
  660. xml:lang='en'>
  661. <data-sync protocol="1.0"
  662. uuid="ly8qoxl6r0rk42faell48a"
  663. type="cdo:Meeting"
  664. packetID="0001"
  665. event="create"
  666. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  667. <item type="field"
  668. uuid="xdF10939"
  669. event="create"
  670. ref="/Meeting/Title"
  671. version="1">
  672. <value>Technical Exchange Meeting</value>
  673. </item>
  674. </data-sync>
  675. </message>
  676. ]]></example>
  677. <p>Once this is completed, both clients have a synchronized CDO message with a uuid and a version number assigned by the server.</p>
  678. </section2>
  679. <section2 topic="Create a new Item on an existing CDO" anchor="cdoitemcreate">
  680. <p>When client A wishes to create a new Item on an existing CDO, he sends the following information to client B</p>
  681. <example caption="Client A creates a new item on an existing CDO and sends it to client B"><![CDATA[
  682. <message
  683. to='joe@mitre.org/Desktop'
  684. from='bob@mitre.org/Laptop'
  685. type='chat'
  686. xml:lang='en'>
  687. <data-sync protocol="1.0"
  688. uuid="ly8qoxl6r0rk42faell48a"
  689. type="cdo:Meeting"
  690. packetID="0002"
  691. event="update"
  692. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  693. <item type="field" uuid="" event="create" ref="/Meeting/Title" version="0">
  694. <value>Meeting</value>
  695. </item>
  696. </data-sync>
  697. </message>
  698. ]]></example>
  699. <p>
  700. Here client A, has set event=update on the &lt;data-sync&gt; and event=create on the new &lt;item&gt;. The version MUST be set to zero on the new item.
  701. The message is intercepted by Server X. Server X is the IM server that both clients are connected to. When the server receives the message, it MUST increment
  702. the version number and assign a uuid for the new &lt;item&gt;
  703. </p>
  704. <p>
  705. Next, Server X MUST send a copy of the message back to client A as a receipt that the message has been processed by Server X and forward the message to client B
  706. </p>
  707. <example caption="Send receipt from Server X to client A"><![CDATA[
  708. <message
  709. to='joe@mitre.org/Desktop'
  710. from='joe@mitre.org/Desktop'
  711. type='chat'
  712. xml:lang='en'>
  713. <data-sync protocol="1.0"
  714. uuid="ly8qoxl6r0rk42faell48a"
  715. type="cdo:Meeting"
  716. packetID="0002"
  717. event="update"
  718. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  719. <item type="field" uuid="kej3n4kd" event="create" ref="/Meeting/Title/" version="1">
  720. <value>Meeting</value>
  721. </item>
  722. </data-sync>
  723. </message>
  724. ]]></example>
  725. <example caption="Forward the message from Server X to client B"><![CDATA[
  726. <message
  727. to='joe@mitre.org/Desktop'
  728. from='bob@mitre.org/Laptop'
  729. type='chat'
  730. xml:lang='en'>
  731. <data-sync protocol="1.0"
  732. uuid="ly8qoxl6r0rk42faell48a"
  733. type="cdo:Meeting"
  734. packetID="0002"
  735. event="update"
  736. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  737. <item type="field" uuid="kej3n4kd" event="create" ref="/Meeting/Title/" version="1">
  738. <value>Meeting</value>
  739. </item>
  740. </data-sync>
  741. </message>
  742. ]]></example>
  743. <p>Once this is completed, both clients have a synchronized CDO message with a new item. The new item has been assigned a uuid and a version number by the server.</p>
  744. </section2>
  745. <section2 topic="Update an Item on an existing CDO" anchor="cdoitemupdate">
  746. <p>When client A wishes to update an item on an existing CDO, he sends the following information to client B</p>
  747. <example caption="Client A updates an item on an existing CDO and sends it to client B"><![CDATA[
  748. <message
  749. to='joe@mitre.org/Desktop'
  750. from='bob@mitre.org/Laptop'
  751. type='chat'
  752. xml:lang='en'>
  753. <data-sync protocol="1.0"
  754. uuid="ly8qoxl6r0rk42faell48a"
  755. type="cdo:Meeting"
  756. packetID="0003"
  757. event="update"
  758. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  759. <item type="field"
  760. uuid="kej3n4kd"
  761. event="update"
  762. version="1">
  763. <value>2006-07-24T14:55:00</value>
  764. </item>
  765. </data-sync>
  766. </message>
  767. ]]></example>
  768. <p>
  769. Here client A, has set event=update on the &lt;data-sync&gt; and event=update on the changed &lt;item&gt;. Note the version is set to the current
  770. version being edited, in this case 1, and both the &lt;item&gt; and &lt;data-sync&gt; have an existing uuid.
  771. </p>
  772. <p>
  773. The message is intercepted by Server X. Server X is the IM server that both clients are connected to. When the server receives the message, it
  774. MUST increment the version number and assign a uuid for the new &lt;item&gt;
  775. </p>
  776. <p>
  777. Next, Server X MUST send a copy of the message back to client A as a receipt that the message has been processed by Server X and forward the message to client B
  778. </p>
  779. <example caption="Send receipt from Server X to client A"><![CDATA[
  780. <message
  781. to='joe@mitre.org/Desktop'
  782. from='joe@mitre.org/Desktop'
  783. type='chat'
  784. xml:lang='en'>
  785. <data-sync protocol="1.0"
  786. uuid="ly8qoxl6r0rk42faell48a"
  787. type="cdo:Meeting"
  788. packetID="0003"
  789. event="update"
  790. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  791. <item type="field"
  792. uuid="kej3n4kd"
  793. event="update"
  794. version="2">
  795. <value>2006-07-24T14:55:00</value>
  796. </item>
  797. </data-sync>
  798. </message>
  799. ]]></example>
  800. <example caption="Forward the message from Server X to client B"><![CDATA[
  801. <message
  802. to='joe@mitre.org/Desktop'
  803. from='bob@mitre.org/Laptop'
  804. type='chat'
  805. xml:lang='en'>
  806. <data-sync protocol="1.0"
  807. uuid="ly8qoxl6r0rk42faell48a"
  808. type="cdo:Meeting"
  809. packetID="0003"
  810. event="update"
  811. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  812. <item type="field"
  813. uuid="kej3n4kd"
  814. event="update"
  815. version="2">
  816. <value>2006-07-24T14:55:00</value>
  817. </item>
  818. </data-sync>
  819. </message>
  820. ]]></example>
  821. <p>Once this is completed, both clients have a synchronized CDO message with an updated item. The updated item has the version number incremented.</p>
  822. <section3 topic="Update Styles">
  823. <p>
  824. There are two types of behaviors associated with an item update: inclusive and exclusive. For an inclusive update, the content of the item element
  825. in the CDO data synchronization packet is considered to be fully representative of the value that item will have at the end of the update operation.
  826. This behavior results in previously set values for an item being destroyed if they are not repeated for each item update. For an exclusive update, the
  827. content of the item element in the CDO data synchronization packet is considered to contain only the values to be modified as a result of the update
  828. operation. This behavior results in previously set values for an item being carried over if they are not explicitly contradicted in each subsequent item update.
  829. </p>
  830. <p>
  831. Assume that client A has created a CDO cdo_1. This CDO has an item item_1 with the attribute named attr_1 set. If A wants to update item_1 with a value
  832. for the attribute named attr_2 without destroying the previously set value for attr_1, the following data synchronization packets are equivalent:
  833. </p>
  834. <code><![CDATA[
  835. <data-sync protocol="1.0" uuid="cdo_1" packetID="0003"
  836. event="update" xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  837. <item type="field"
  838. uuid="item_1"
  839. event="update"
  840. version="1"
  841. updateStyle="inclusive">
  842. <attribute name="attr_1">old value</attribute>
  843. <attribute name="attr_2">new value</attribute>
  844. </item>
  845. </data-sync>
  846. ]]></code>
  847. <code><![CDATA[
  848. <data-sync protocol="1.0" uuid="cdo_1" packetID="0003"
  849. event="update" xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  850. <item type="field"
  851. uuid="item_1"
  852. event="update"
  853. version="1"
  854. updateStyle="exclusive">
  855. <attribute name="attr_2">new value</attribute>
  856. </item>
  857. </data-sync>
  858. ]]></code>
  859. </section3>
  860. </section2>
  861. <section2 topic="Delete an Item on an existing CDO" anchor="cdoitemdelete">
  862. <p>When client A wishes to delete an item on an existing CDO, he sends the following information to client B</p>
  863. <example caption="Client A deletes an item on an existing CDO and sends it to client B"><![CDATA[
  864. <message
  865. to='joe@mitre.org/Desktop'
  866. from='bob@mitre.org/Laptop'
  867. type='chat'
  868. xml:lang='en'>
  869. <data-sync protocol="1.0"
  870. uuid="ly8qoxl6r0rk42faell48a"
  871. type="cdo:Meeting"
  872. packetID="0004"
  873. event="update"
  874. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  875. <item type="field"
  876. uuid="kej3n4kd"
  877. event="delete"
  878. version="2">
  879. </item>
  880. </data-sync>
  881. </message>
  882. ]]></example>
  883. <p>
  884. Here client A, has set event=update on the &lt;data-sync&gt; and event=delete on the changed &lt;item&gt;. Note the version is set to the current
  885. version being deleted, in this case 2, and both the &lt;item&gt; and &lt;data-sync&gt; have an existing uuid.
  886. </p>
  887. <p>
  888. The message is intercepted by Server X. Server X is the IM server that both clients are connected to. Server X MUST send a copy of the message
  889. back to client A as a receipt that the message has been processed by Server X and forward the message to client B
  890. </p>
  891. <example caption="Send receipt from Server X to client A"><![CDATA[
  892. <message
  893. to='joe@mitre.org/Desktop'
  894. from='joe@mitre.org/Desktop'
  895. type='chat'
  896. xml:lang='en'>
  897. <data-sync protocol="1.0"
  898. uuid="ly8qoxl6r0rk42faell48a"
  899. type="cdo:Meeting"
  900. packetID="0004"
  901. event="update"
  902. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  903. <item type="field"
  904. uuid="kej3n4kd"
  905. event="delete"
  906. version="2">
  907. </item>
  908. </data-sync>
  909. </message>
  910. ]]></example>
  911. <example caption="Forward the message from Server X to client B"><![CDATA[
  912. <message
  913. to='joe@mitre.org/Desktop'
  914. from='bob@mitre.org/Laptop'
  915. type='chat'
  916. xml:lang='en'>
  917. <data-sync protocol="1.0"
  918. uuid="ly8qoxl6r0rk42faell48a"
  919. type="cdo:Meeting"
  920. packetID="0004"
  921. event="update"
  922. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  923. <item type="field"
  924. uuid="kej3n4kd"
  925. event="delete"
  926. version="2">
  927. </item>
  928. </data-sync>
  929. </message>
  930. ]]></example>
  931. <p>Once this is completed, both clients have a synchronized CDO message with a deleted item.</p>
  932. </section2>
  933. <section2 topic="Retire an existing CDO" anchor="cdoretire">
  934. <p>
  935. Retired objects are different than deleted items in that retired objects can still be referenced and reviewed but no changes can be made.
  936. </p>
  937. <p>
  938. When client A wishes to retire an entire existing CDO, he sends the following information to client B
  939. </p>
  940. <example caption="Client A deletes an existing CDO and sends it to client B"><![CDATA[
  941. <message
  942. to='joe@mitre.org/Desktop'
  943. from='bob@mitre.org/Laptop'
  944. type='chat'
  945. xml:lang='en'>
  946. <data-sync protocol="1.0"
  947. uuid="ly8qoxl6r0rk42faell48a"
  948. type="cdo:Meeting"
  949. packetID="0005"
  950. event="retire"
  951. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  952. </data-sync>
  953. </message>
  954. ]]></example>
  955. <p>
  956. Here client A, has set event=retire on the &lt;data-sync&gt;.
  957. </p>
  958. <p>
  959. The message is intercepted by Server X. Server X is the IM server that both clients are connected to. Server X MUST send a copy of the
  960. message back to client A as a receipt that the message has been processed by Server X and forward the message to client B:
  961. </p>
  962. <example caption="Send receipt from Server X to client A"><![CDATA[
  963. <message
  964. to='joe@mitre.org/Descktop'
  965. from='joe@mitre.org/Descktop'
  966. type='chat'
  967. xml:lang='en'>
  968. <data-sync protocol="1.0"
  969. uuid="ly8qoxl6r0rk42faell48a"
  970. type="cdo:Meeting"
  971. packetID="0005"
  972. event="retire"
  973. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  974. </data-sync>
  975. </message>
  976. ]]></example>
  977. <example caption="Forward the message from Server X to client B"><![CDATA[
  978. <message
  979. to='joe@mitre.org/Desktop'
  980. from='bob@mitre.org/Laptop'
  981. type='chat'
  982. xml:lang='en'>
  983. <data-sync protocol="1.0"
  984. uuid="ly8qoxl6r0rk42faell48a"
  985. type="cdo:Meeting"
  986. packetID="0005"
  987. event="retire"
  988. xmlns="http://www.xmpp.org/extensions/xep-0204.html#ns">
  989. </data-sync>
  990. </message>
  991. ]]></example>
  992. <p>Once this is completed, both clients have retired (deleted) the CDO.</p>
  993. </section2>
  994. </section1>
  995. <section1 topic="Errors" anchor="errors">
  996. <p>
  997. The error reporting mechanism for this specification follows the recommendations as set forth in the XMPP Core RFC. As such, when an error condition is detected,
  998. a stanza-related error must be generated and returned to sending entity. The error condition should be described using an XMPP general condition and CDO specific
  999. condition. Further amplification to the error condition should be provided by including the applicable subset of the data-sync message which caused the error.
  1000. </p>
  1001. <p>
  1002. Error types other than continue (cancel, modify, wait) disrupt the normal processing of CDO data-synch messages and only the associate error message
  1003. will be issued by a supporting server.
  1004. </p>
  1005. <p>
  1006. Addition of only the applicable subset of the data-sync message in an error stanza is meant to assist the sending entity in isolating what directive in the message caused the error.
  1007. Most CDO specific conditions include sufficient metadata to enable the sender to isolate the cause, but it is possible for the sender to generate messages in which this metadata is
  1008. not present. In this case, it may not be possible for the sender to determine the message subset causing the error unless that subset is included in the error.
  1009. </p>
  1010. <example caption="Assume the following message is sent:"><![CDATA[
  1011. <message from="miles@example.com" to="aral@example.com">
  1012. <cdo:data-sync
  1013. protocol="1.0"
  1014. packetID="miles@example.com:packet-1"
  1015. event="update"
  1016. uuid="miles@example.com:instance-1">
  1017. <item type="field" event="create" ref="/Meeting/Title">
  1018. <value>Winterfair preparation</value>
  1019. </item>
  1020. <item type="field" event="update"
  1021. uuid="miles@example.com:field-1" version="2">
  1022. <value>Imperial waltz</value>
  1023. </item>
  1024. </cdo:data-sync>
  1025. </message>
  1026. ]]></example>
  1027. <p>
  1028. The first potential cause for an error in a data syonchronization packet is the root data-sync element. An error at this level is indepedent of the content of any element descendents of the data-sync element. When this occurs, a server error sent to the recipient <strong>MUST</strong> include the data-sync element to provide context; a bandwidth-constrainted connection <strong>MAY</strong> omit the element descendants.
  1029. </p>
  1030. <example caption=""><![CDATA[
  1031. <message to="aral@example.com" type="error">
  1032. <cdo:data-sync
  1033. protocol="1.0"
  1034. packetID="miles@example.com:packet-1"
  1035. event="update"
  1036. uuid="miles@example.com:instance-1"/>
  1037. <error type="cancel">
  1038. <item-not-found/>
  1039. <cdo:no-such-instance/>
  1040. </error>
  1041. </message>
  1042. ]]></example>
  1043. <p>
  1044. The second potential cause for an error is a child item element. For an item of event type create, the sender is not required to nominate a UUID for the item. If multiple items are used
  1045. in this fashion, it is not possible for the item related to the error to be identified by reference. The only way to indicate to the sender the item related to the error is by isolating that
  1046. item in the error stanza. As a result, the subset for this case is the data-sync element with all child item elements removed except the item related to the error.
  1047. </p>
  1048. <example caption=""><![CDATA[
  1049. <message to="aral@example.com" type="error">
  1050. <cdo:data-sync
  1051. protocol="1.0"
  1052. packetID="miles@example.com:packet-1"
  1053. event="update"
  1054. uuid="miles@example.com:instance-1">
  1055. <item type="field" event="update"
  1056. uuid="miles@example.com:field-1" version="2">
  1057. <value>Imperial waltz</value>
  1058. </item>
  1059. </cdo:data-sync>
  1060. <error type="cancel">
  1061. <item-not-found/>
  1062. <cdo:no-such-item/>
  1063. </error>
  1064. </message>
  1065. ]]></example>
  1066. <section2 topic="CDO specific conditions" anchor="cdoerrorconditions">
  1067. <table caption="Specific Conditions">
  1068. <tr>
  1069. <td>
  1070. <p>
  1071. <strong>Error Type</strong>
  1072. </p>
  1073. </td>
  1074. <td>
  1075. <p>
  1076. <strong>General Condition</strong>
  1077. </p>
  1078. </td>
  1079. <td>
  1080. <p>
  1081. <strong>Specific Condition</strong>
  1082. </p>
  1083. </td>
  1084. <td>
  1085. <p>
  1086. <strong>Description</strong>
  1087. </p>
  1088. </td>
  1089. </tr>
  1090. <tr>
  1091. <td>
  1092. <p>cancel</p>
  1093. </td>
  1094. <td>
  1095. <p>
  1096. <tt>&lt;xmpp:feature-not-implemented/&gt;</tt>
  1097. </p>
  1098. </td>
  1099. <td>
  1100. <p>
  1101. <tt>&lt;cdo:unkown-protocol-version/&gt;</tt>
  1102. </p>
  1103. </td>
  1104. <td>
  1105. <p>The protocol version for the data sync packet is unknown to the framework and cannot be processed.</p>
  1106. </td>
  1107. </tr>
  1108. <tr>
  1109. <td>
  1110. <p>continue</p>
  1111. </td>
  1112. <td>
  1113. <p>
  1114. <tt>&lt;xmpp:undefined-condition/&gt;</tt>
  1115. </p>
  1116. </td>
  1117. <td>
  1118. <p>
  1119. <tt>&lt;cdo:deprecated-protocol-version framework-protocol-version="P"/&gt;</tt>
  1120. </p>
  1121. </td>
  1122. <td>
  1123. <p>The protocol version for the data sync packet is older than that used by the framework, but the packet can still be processed.</p>
  1124. </td>
  1125. </tr>
  1126. <tr>
  1127. <td>
  1128. <p>cancel</p>
  1129. </td>
  1130. <td>
  1131. <p>
  1132. <tt>&lt;xmpp:feature-not-implemented/&gt;</tt>
  1133. </p>
  1134. </td>
  1135. <td>
  1136. <p>
  1137. <tt>&lt;cdo:deprecated-protocol-version framework-protocol-version="P"/&gt;</tt>
  1138. </p>
  1139. </td>
  1140. <td>
  1141. <p>The protocol version for the data sync packet is older than that used by the framework, and the framework cannot process the packet.</p>
  1142. </td>
  1143. </tr>
  1144. <tr>
  1145. <td>
  1146. <p>continue</p>
  1147. </td>
  1148. <td>
  1149. <p>
  1150. <tt>&lt;xmpp:undefined-condition/&gt;</tt>
  1151. </p>
  1152. </td>
  1153. <td>
  1154. <p>
  1155. <tt>&lt;cdo:instance-identifier- conflict new-identifier="I"/&gt;</tt>
  1156. </p>
  1157. </td>
  1158. <td>
  1159. <p>The framework cannot create a new instance with the specified identifier because one already exists with that identifier. As a result, the framework has created a new identifier for the instance to be created.</p>
  1160. </td>
  1161. </tr>
  1162. <tr>
  1163. <td>
  1164. <p>cancel</p>
  1165. </td>
  1166. <td>
  1167. <p>
  1168. <tt>&lt;xmpp:item-not-found/&gt;</tt>
  1169. </p>
  1170. </td>
  1171. <td>
  1172. <p>
  1173. <tt>&lt;cdo:no-such-instance/&gt;</tt>
  1174. </p>
  1175. </td>
  1176. <td>
  1177. <p>The framework has no record of an instance with the specified identifier.</p>
  1178. </td>
  1179. </tr>
  1180. <tr>
  1181. <td>
  1182. <p>cancel</p>
  1183. </td>
  1184. <td>
  1185. <p>
  1186. <tt>&lt;xmpp:not-allowed/&gt;</tt>
  1187. </p>
  1188. </td>
  1189. <td>
  1190. <p>
  1191. <tt>&lt;cdo:instance-retired/&gt;</tt>
  1192. </p>
  1193. </td>
  1194. <td>
  1195. <p>The event cannot be executed on the instance because that instance has been retired.</p>
  1196. </td>
  1197. </tr>
  1198. <tr>
  1199. <td>
  1200. <p>wait</p>
  1201. </td>
  1202. <td>
  1203. <p>
  1204. <tt>&lt;xmpp:undefined-condition/&gt;</tt>
  1205. </p>
  1206. </td>
  1207. <td>
  1208. <p>
  1209. <tt>&lt;cdo:instance-is-active/&gt;</tt>
  1210. </p>
  1211. </td>
  1212. <td>
  1213. <p>The retire event cannot be executed on the instance because the instance is actively being updated.</p>
  1214. </td>
  1215. </tr>
  1216. <tr>
  1217. <td>
  1218. <p>cancel</p>
  1219. </td>
  1220. <td>
  1221. <p>
  1222. <tt>&lt;xmpp:item-not-found/&gt;</tt>
  1223. </p>
  1224. </td>
  1225. <td>
  1226. <p>
  1227. <tt>&lt;cdo:no-such-type/&gt;</tt>
  1228. </p>
  1229. </td>
  1230. <td>
  1231. <p>The framework has no record of a type with the specified identifier.</p>
  1232. </td>
  1233. </tr>
  1234. <tr>
  1235. <td>
  1236. <p>continue</p>
  1237. </td>
  1238. <td>
  1239. <p>
  1240. <tt>&lt;xmpp:undefined-condition/&gt;</tt>
  1241. </p>
  1242. </td>
  1243. <td>
  1244. <p>
  1245. <tt>&lt;cdo:deprecated-type latest-type="type-identifier"/&gt;</tt>
  1246. </p>
  1247. </td>
  1248. <td>
  1249. <p>The framework will create a new instance with the specified type, but one or more types have been registered as superseding this type.</p>
  1250. </td>
  1251. </tr>
  1252. <tr>
  1253. <td>
  1254. <p>continue</p>
  1255. </td>
  1256. <td>
  1257. <p>
  1258. <tt>&lt;xmpp:undefined-condition/&gt;</tt>
  1259. </p>
  1260. </td>
  1261. <td>
  1262. <p>
  1263. <tt>&lt;cdo:item-identifier- conflict old-identifier="I0" new-identifier="I1"/&gt;</tt>
  1264. </p>
  1265. </td>
  1266. <td>
  1267. <p>The framework cannot create a new item with the specified identifier because one already exists with that identifier. As a result, the framework has created a new identifier for the item to be created.</p>
  1268. </td>
  1269. </tr>
  1270. <tr>
  1271. <td>
  1272. <p>cancel</p>
  1273. </td>
  1274. <td>
  1275. <p>
  1276. <tt>&lt;xmpp:item-not-found/&gt;</tt>
  1277. </p>
  1278. </td>
  1279. <td>
  1280. <p>
  1281. <tt>&lt;cdo:no-such-item identifier="I"/&gt;</tt>
  1282. </p>
  1283. </td>
  1284. <td>
  1285. <p>The framework has no record of an item with the specified identifier for the specified instance.</p>
  1286. </td>
  1287. </tr>
  1288. <tr>
  1289. <td>
  1290. <p>cancel</p>
  1291. </td>
  1292. <td>
  1293. <p>
  1294. <tt>&lt;xmpp:conflict/&gt;</tt>
  1295. </p>
  1296. </td>
  1297. <td>
  1298. <p>
  1299. <tt>&lt;cdo:item-version-outdated identifier=I" version=V"/&gt;</tt>
  1300. </p>
  1301. </td>
  1302. <td>
  1303. <p>The request cannot be executed on the item because the referenced version is outdated. The framework MAY indicate the current version in the reply.</p>
  1304. </td>
  1305. </tr>
  1306. <tr>
  1307. <td>
  1308. <p>modify</p>
  1309. </td>
  1310. <td>
  1311. <p>
  1312. <tt>&lt;xmpp:bad-request/&gt;</tt>
  1313. </p>
  1314. </td>
  1315. <td>
  1316. <p>
  1317. <tt>&lt;cdo:no-such-item-version identifier="I" version="V"/&gt;</tt>
  1318. </p>
  1319. </td>
  1320. <td>
  1321. <p>The framework has no record of the specified version for the specified item. The framework MAY return the current version in the reply.</p>
  1322. </td>
  1323. </tr>
  1324. <tr>
  1325. <td>
  1326. <p>cancel</p>
  1327. </td>
  1328. <td>
  1329. <p>
  1330. <tt>&lt;xmpp:item-not-found/&gt;</tt>
  1331. </p>
  1332. </td>
  1333. <td>
  1334. <p>
  1335. <tt>&lt;cdo:no-such-item-xpath identifier="I"/&gt;</tt>
  1336. </p>
  1337. </td>
  1338. <td>
  1339. <p>The xpath in the specified identifier is not valid.</p>
  1340. </td>
  1341. </tr>
  1342. <tr>
  1343. <td>
  1344. <p>modify</p>
  1345. </td>
  1346. <td>
  1347. <p>
  1348. <tt>&lt;xmpp:not-acceptable/&gt;</tt>
  1349. </p>
  1350. </td>
  1351. <td>
  1352. <p>
  1353. <tt>&lt;cdo:item-xpath-not-acceptable identifier="I"/&gt;</tt>
  1354. </p>
  1355. </td>
  1356. <td>
  1357. <p>The xpath in the specified identifier does not resolve to a leaf element.</p>
  1358. </td>
  1359. </tr>
  1360. <tr>
  1361. <td>
  1362. <p>modify</p>
  1363. </td>
  1364. <td>
  1365. <p>
  1366. <tt>&lt;xmpp:not-acceptable/&gt;</tt>
  1367. </p>
  1368. </td>
  1369. <td>
  1370. <p>
  1371. <tt>&lt;cdo:item-modification-insufficient identifier="I"/&gt;</tt>
  1372. </p>
  1373. </td>
  1374. <td>
  1375. <p>The modification proposed on the item does not actually constitute a modification.</p>
  1376. </td>
  1377. </tr>
  1378. <tr>
  1379. <td>
  1380. <p>modify</p>
  1381. </td>
  1382. <td>
  1383. <p>
  1384. <tt>&lt;xmpp:bad-request/&gt;</tt>
  1385. </p>
  1386. </td>
  1387. <td>
  1388. <p>
  1389. <tt>&lt;cdo:invalid-item-value identifier="I"/&gt;</tt>
  1390. </p>
  1391. </td>
  1392. <td>
  1393. <p>The value proposed for the specified item is invalid.</p>
  1394. </td>
  1395. </tr>
  1396. <tr>
  1397. <td>
  1398. <p>cancel</p>
  1399. </td>
  1400. <td>
  1401. <p>
  1402. <tt>&lt;xmpp:item-not-found/&gt;</tt>
  1403. </p>
  1404. </td>
  1405. <td>
  1406. <p>
  1407. <tt>&lt;cdo:no-such-item-attribute identifier="I" attribute-name="N"/&gt;</tt>
  1408. </p>
  1409. </td>
  1410. <td>
  1411. <p>The item attribute in the specified identifier is invalid.</p>
  1412. </td>
  1413. </tr>
  1414. <tr>
  1415. <td>
  1416. <p>modify</p>
  1417. </td>
  1418. <td>
  1419. <p>
  1420. <tt>&lt;xmpp:bad-request/&gt;</tt>
  1421. </p>
  1422. </td>
  1423. <td>
  1424. <p>
  1425. <tt>&lt;cdo:invalid-item-value identifier="I" attribute-name="N"/&gt;</tt>
  1426. </p>
  1427. </td>
  1428. <td>
  1429. <p>The value proposed for the specified item's attribute is invalid.</p>
  1430. </td>
  1431. </tr>
  1432. <tr>
  1433. <td>
  1434. <p>modify</p>
  1435. </td>
  1436. <td>
  1437. <p>
  1438. <tt>&lt;xmpp:bad-request/&gt;</tt>
  1439. </p>
  1440. </td>
  1441. <td>
  1442. <p>
  1443. <tt>&lt;cdo:invalid-constraint type="T" identifier="I"/&gt;</tt>
  1444. </p>
  1445. </td>
  1446. <td>
  1447. <p>The data-sync packet is not logically valid as described by the type T (see section X.3). The framework MAY include the identifier of the offending data-sync packet or item.</p>
  1448. </td>
  1449. </tr>
  1450. </table>
  1451. <p>Errors which may result from schema validation have been omitted.</p>
  1452. </section2>
  1453. <section2 topic="Invalid Constraint condition types" anchor="invalidconstraints">
  1454. <p>
  1455. The CDO specific condition "invalid-constraint" enables the server to indicate logical invalidity of a data-sync packet. The use of a single condition for this purpose provides a consistent
  1456. reporting mechanism to the sender, but the invalidity must be described with the "type" attribute as follows:
  1457. </p>
  1458. <table caption="Invalid Constraint types">
  1459. <tr>
  1460. <td>
  1461. <p>
  1462. <strong>Type</strong>
  1463. </p>
  1464. </td>
  1465. <td>
  1466. <p>
  1467. <strong>Description</strong>
  1468. </p>
  1469. </td>
  1470. </tr>
  1471. <tr>
  1472. <td>
  1473. <p>instance-identifier-required</p>
  1474. </td>
  1475. <td>
  1476. <p>Data-sync packets of event type "update" and "retire" MUST specify the target instance.</p>
  1477. </td>
  1478. </tr>
  1479. <tr>
  1480. <td>
  1481. <p>instance-type-prohibited</p>
  1482. </td>
  1483. <td>
  1484. <p>Data-sync packets of event type "update" and "retire" MUST NOT specify an instance type.</p>
  1485. </td>
  1486. </tr>
  1487. <tr>
  1488. <td>
  1489. <p>instance-type-required</p>
  1490. </td>
  1491. <td>
  1492. <p>Data-sync packets of event type "create" MUST specify an instance type.</p>
  1493. </td>
  1494. </tr>
  1495. <tr>
  1496. <td>
  1497. <p>item-required</p>
  1498. </td>
  1499. <td>
  1500. <p>Data-sync packets of event type "update" MUST include at least one data-sync item.</p>
  1501. </td>
  1502. </tr>
  1503. <tr>
  1504. <td>
  1505. <p>items-prohibited</p>
  1506. </td>
  1507. <td>
  1508. <p>Data-sync packets of event type "retire" MUST NOT include any data-sync items.</p>
  1509. </td>
  1510. </tr>
  1511. <tr>
  1512. <td>
  1513. <p>item-event-prohibited</p>
  1514. </td>
  1515. <td>
  1516. <p>Data-sync packets of event type "create" MUST ONLY include data-sync items of event type "create."</p>
  1517. </td>
  1518. </tr>
  1519. <tr>
  1520. <td>
  1521. <p>item-identifier-required</p>
  1522. </td>
  1523. <td>
  1524. <p>Data-sync items of event type "update" and "delete" MUST include the target identifier.</p>
  1525. </td>
  1526. </tr>
  1527. <tr>
  1528. <td>
  1529. <p>item-update-style-prohibited</p>
  1530. </td>
  1531. <td>
  1532. <p>Data-sync items of event type "create" and "delete" MUST NOT specify an update style.</p>
  1533. </td>
  1534. </tr>
  1535. <tr>
  1536. <td>
  1537. <p>item-value-prohibited</p>
  1538. </td>
  1539. <td>
  1540. <p>Data-sync items of event type "delete" MUST NOT contain a value.</p>
  1541. </td>
  1542. </tr>
  1543. <tr>
  1544. <td>
  1545. <p>item-value-required</p>
  1546. </td>
  1547. <td>
  1548. <p>Data-sync items of event type "create" and "update" MUST contain a value.</p>
  1549. </td>
  1550. </tr>
  1551. <tr>
  1552. <td>
  1553. <p>item-version-prohibited</p>
  1554. </td>
  1555. <td>
  1556. <p>Data-sync items of event type "create" MUST NOT specify a version.</p>
  1557. </td>
  1558. </tr>
  1559. <tr>
  1560. <td>
  1561. <p>item-version-required</p>
  1562. </td>
  1563. <td>
  1564. <p>Data-sync items of event type "update" and "delete" MUST specify a version.</p>
  1565. </td>
  1566. </tr>
  1567. <tr>
  1568. <td>
  1569. <p>item-xpath-prohibited</p>
  1570. </td>
  1571. <td>
  1572. <p>Data-sync items of event type "update" and "delete" MUST NOT specify an XPath.</p>
  1573. </td>
  1574. </tr>
  1575. <tr>
  1576. <td>
  1577. <p>item-xpath-required</p>
  1578. </td>
  1579. <td>
  1580. <p>Data-sync items of event type "create" MUST specify an XPath.</p>
  1581. </td>
  1582. </tr>
  1583. </table>
  1584. </section2>
  1585. <section2 topic="Special Case: Outdated version error" anchor="specialcases">
  1586. <p>
  1587. It is possible for a notional conflict to exist between two clients attempting to update a CDO instance. In this case, two separate clients submit data sync packets
  1588. containing at least one overlapping item. When this occurs, the first packet to arrive at the framework is executed, but the error information
  1589. reported back to the client of the second packet MAY be extended to describe the notional conflict. This additional error information is meant to facilitate
  1590. collaboration between the clients.
  1591. </p>
  1592. <p>The additional error information provide includes:</p>
  1593. <ul>
  1594. <li>The resource identifier of the client originating the data sync packet with which this error conflicts.</li>
  1595. <li>The timestamp of when the originating data sync packet was executed.</li>
  1596. <li>The item element of the originating data sync packet with which this error conflicts.</li>
  1597. </ul>
  1598. <example caption=""><![CDATA[
  1599. <cdo:item-version-outdated identifier='I' version='V'>
  1600. <cdo:conflict resource-identifier='R' execution-timestamp='T'>
  1601. <item identifier='I' version='V1' event='E'>
  1602. <value>VALUE</value>
  1603. <attribute name='N'>VALUE</attribute>
  1604. </cdo:conflict>
  1605. </cdo:item-version-outdated>
  1606. ]]></example>
  1607. </section2>
  1608. </section1>
  1609. <section1 topic="Implementation Notes" anchor="impl">
  1610. <section2 topic="Service" anchor="service">
  1611. <p>
  1612. To properly handle the protocol described in this JEP. A server side service will need to be able to process CDO packets and IQ messages.
  1613. This means at a minimum, the service will need to be able to:
  1614. </p>
  1615. <ol>
  1616. <li>Filter for data-sync and IQ protocol extentions as described above</li>
  1617. <li>Handle packet extentions that appear as a child element to the message element</li>
  1618. <li>Provide an underlying framework that can manage versioning of data-sync messages. If designed accordingly, it may be possible for this framework to be re-used by clients as well.</li>
  1619. </ol>
  1620. <p>
  1621. Additionally, a server MUST ignore any 'to' address on a cdo related IQ "set", and MUST treat any cdo IQ "set" as applying to the sender.
  1622. </p>
  1623. </section2>
  1624. <section2 topic="Client" anchor="client">
  1625. <p>For a client to be able to exchange CDO messages it will need to provide capabilites similar to those described above: </p>
  1626. <ol>
  1627. <li>Filter and respond to data-sync and IQ protocol extentions described in this specification</li>
  1628. <li>Properly handle packet extentions that appear as a child elements to the message element</li>
  1629. <li>Provide an underlying framework that can manage the version of data-sync messages. (see 3. above)</li>
  1630. <li>Provide a form based GUI to properly construct the CDO messages.</li>
  1631. <li>Provide the ability to construct data-sync related IQ messages</li>
  1632. </ol>
  1633. <p>
  1634. Additionally, a client SHOULD check the "from" address of a cdo query (incoming IQ of type "result" containing a cdo type) to ensure that it is
  1635. from a trusted source; specifically, the stanza MUST either have no 'from' attribute (i.e., implicitly from the server) or have a 'from' attribute whose
  1636. value matches the user's bare JID (of the form &lt;user@domain&gt;) or full JID (of the form &lt;user@domain/resource&gt;); otherwise, the client
  1637. SHOULD ignore the cdo query result.
  1638. </p>
  1639. </section2>
  1640. </section1>
  1641. <section1 topic="Security Considerations" anchor="security">
  1642. <section2 topic="User Authentication and Authorization" anchor="authentication">
  1643. <p>
  1644. No form of authentication or authorization is defined by this specification. However, if required, RFC 3920 describes channel encryption and
  1645. strong authentication via TLS and SASL that may fulfill this requirement.
  1646. </p>
  1647. </section2>
  1648. <section2 topic="End-to-End Encryption" anchor="encryption">
  1649. <p>
  1650. No end-to-end message or session encryption method defined in this specification. Users SHOULD NOT trust a service to exchange secret CDO messages.
  1651. </p>
  1652. </section2>
  1653. </section1>
  1654. <section1 topic="IANA Considerations" anchor="iana">
  1655. <p>This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA).</p>
  1656. </section1>
  1657. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  1658. <section2 topic='Protocol Namespace' anchor='ns'>
  1659. <p>Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0204.html#ns" (along with relevant "sub-namespaces" in which "#ns" is followed by the "-" character and a subname string); upon advancement of this specification, the XMPP Registrar shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
  1660. <p>Note: As this protocol is currently used in implemented software, the namespaces are of the form "http://www.mitre.org/mtp/cdo", "http://www.mitre.org/mtp/cdo/types", etc.</p>
  1661. </section2>
  1662. </section1>
  1663. <section1 topic="XML Schema" anchor="schema">
  1664. <section2 topic="Description Language" anchor="xmlschemaDescriptionLanguage">
  1665. <code><![CDATA[
  1666. <?xml version='1.0' encoding='UTF-8'?>
  1667. <xsd:schema
  1668. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  1669. xmlns:cdodl="http://mitre.org/MTP/CDO-DL"
  1670. targetNamespace="http://mitre.org/MTP/CDO-DL"
  1671. elementFormDefault="unqualified"
  1672. attributeFormDefault="unqualified">
  1673. <xsd:element name="Definition" type="cdodl:DefinitionType"/>
  1674. <xsd:complexType name="DefinitionType">
  1675. <xsd:sequence>
  1676. <xsd:element name="MetaData" minOccurs="1" maxOccurs="1">
  1677. <xsd:complexType>
  1678. <xsd:sequence>
  1679. <xsd:element name="Label" minOccurs="1" maxOccurs="1"/>
  1680. <xsd:element name="Version" minOccurs="1" maxOccurs="1">
  1681. <xsd:simpleType>
  1682. <xsd:restriction base="xsd:string">
  1683. <xsd:pattern value="[1-9][0-9]*\.[0-9]+.[0-9]+.[0-9]+"/>
  1684. </xsd:restriction>
  1685. </xsd:simpleType>
  1686. </xsd:element>
  1687. <xsd:element name="Description" minOccurs="1" maxOccurs="1"/>
  1688. </xsd:sequence>
  1689. </xsd:complexType>
  1690. </xsd:element>
  1691. <xsd:element name="Type" minOccurs="1" maxOccurs="1">
  1692. <xsd:complexType>
  1693. <xsd:sequence>
  1694. <xsd:element ref="xsd:schema" minOccurs="0" maxOccurs="1"/>
  1695. </xsd:sequence>
  1696. <xsd:attribute name="rootElement" use="required" type="xsd:QName"/>
  1697. <xsd:attribute name="schemaLocation" use="optional" type="xsd:anyURI"/>
  1698. </xsd:complexType>
  1699. </xsd:element>
  1700. <xsd:element name="Layouts" minOccurs="1" maxOccurs="1">
  1701. <xsd:complexType>
  1702. <xsd:sequence>
  1703. <xsd:element name="Layout" minOccurs="1" maxOccurs="unbounded">
  1704. <xsd:complexType>
  1705. <xsd:sequence>
  1706. <xsd:element name="Description"
  1707. minOccurs="1"
  1708. maxOccurs="1"
  1709. type="xsd:string"/>
  1710. <any namespace="##other" minOccurs="1" maxOccurs="unbounded"/>
  1711. </xsd:sequence>
  1712. <xsd:attribute name="default"
  1713. use="optional"
  1714. default="false"
  1715. type="xsd:boolean"/>
  1716. <xsd:attribute name="uuid" use="required" type="xsd:string"/>
  1717. </xsd:complexType>
  1718. </xsd:element>
  1719. </xsd:sequence>
  1720. </xsd:complexType>
  1721. </xsd:element>
  1722. <xsd:element name="Methods" minOccurs="1" maxOccurs="1">
  1723. <xsd:complexType>
  1724. <xsd:sequence>
  1725. <xsd:element name="Method" minOccurs="1" maxOccurs="unbounded">
  1726. <xsd:complexType>
  1727. <xsd:sequence>
  1728. <xsd:element name="Description"
  1729. minOccurs="1"
  1730. maxOccurs="1"
  1731. type="xsd:string"/>
  1732. <any namespace="##other" minOccurs="1" maxOccurs="unbounded"/>
  1733. </xsd:sequence>
  1734. <xsd:attribute name="uuid" use="required" type="xsd:string"/>
  1735. </xsd:complexType>
  1736. </xsd:element>
  1737. </xsd:sequence>
  1738. </xsd:complexType>
  1739. </xsd:element>
  1740. <xsd:element name="States" minOccurs="1" maxOccurs="1">
  1741. <xsd:complexType>
  1742. <xsd:sequence>
  1743. <any namespace="##other" minOccurs="1" maxOccurs="unbounded"/>
  1744. </xsd:sequence>
  1745. </xsd:complexType>
  1746. </xsd:element>
  1747. </xsd:sequence>
  1748. <xsd:attribute name="uuid" use="required" type="xsd:string"/>
  1749. </xsd:complexType>
  1750. </xsd:schema>
  1751. ]]></code>
  1752. </section2>
  1753. <section2 topic="Data Synchronization Protocol" anchor="xmlschemaProtocol">
  1754. <code><![CDATA[
  1755. <?xml version='1.0' encoding='UTF-8'?>
  1756. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  1757. xmlns:cdo="http://www.xmpp.org/extensions/xep-0204.html#ns-data-sync"
  1758. targetNamespace="http://www.xmpp.org/extensions/xep-0204.html#ns-data-sync"
  1759. elementFormDefault="unqualified"
  1760. attributeFormDefault="unqualified">
  1761. <xsd:element name="data-sync" type="cdo:DataSyncPacketType" />
  1762. <xsd:complexType name="DataSyncPacketType">
  1763. <xsd:sequence>
  1764. <xsd:element name="item"
  1765. type="cdo:DataSyncItemType"
  1766. minOccurs="0"
  1767. maxOccurs="unbounded" />
  1768. </xsd:sequence>
  1769. <xsd:attribute name="protocol" use="required">
  1770. <xsd:simpleType>
  1771. <xsd:restriction base="xsd:string">
  1772. <xsd:pattern value="[1-9][0-9]*\.[0-9]+" />
  1773. </xsd:restriction>
  1774. </xsd:simpleType>
  1775. </xsd:attribute>
  1776. <xsd:attribute name="packetID" use="required" type="xsd:string" />
  1777. <xsd:attribute name="event" use="required">
  1778. <xsd:simpleType>
  1779. <xsd:restriction base="xsd:string">
  1780. <xsd:enumeration value="create" />
  1781. <xsd:enumeration value="update" />
  1782. <xsd:enumeration value="retire" />
  1783. <xsd:enumeration value="info" />
  1784. </xsd:restriction>
  1785. </xsd:simpleType>
  1786. </xsd:attribute>
  1787. <xsd:attribute name="uuid" use="optional" type="xsd:string" />
  1788. <xsd:attribute name="type" use="optional" type="xsd:string" />
  1789. </xsd:complexType>
  1790. <xsd:complexType name="DataSyncItemType">
  1791. <xsd:sequence>
  1792. <xsd:element name="value" type="xsd:string" minOccurs="0" maxOccurs="1" />
  1793. <xsd:element name="attribute"
  1794. type="cdo:DataSyncAttributeType"
  1795. minOccurs="0"
  1796. maxOccurs="unbounded" />
  1797. </xsd:sequence>
  1798. <xsd:attribute name="type" use="optional" default="field">
  1799. <xsd:simpleType>
  1800. <xsd:restriction base="xsd:string">
  1801. <xsd:enumeration value="field" />
  1802. <xsd:enumeration value="method" />
  1803. <xsd:enumeration value="state" />
  1804. </xsd:restriction>
  1805. </xsd:simpleType>
  1806. </xsd:attribute>
  1807. <xsd:attribute name="event" use="required">
  1808. <xsd:simpleType>
  1809. <xsd:restriction base="xsd:string">
  1810. <xsd:enumeration value="create" />
  1811. <xsd:enumeration value="update" />
  1812. <xsd:enumeration value="delete" />
  1813. <xsd:enumeration value="info" />
  1814. </xsd:restriction>
  1815. </xsd:simpleType>
  1816. </xsd:attribute>
  1817. <xsd:attribute name="updateStyle" use="optional" default="exclusive">
  1818. <xsd:simpleType>
  1819. <xsd:restriction base="xsd:string">
  1820. <xsd:enumeration value="inclusive" />
  1821. <xsd:enumeration value="exclusive" />
  1822. </xsd:restriction>
  1823. </xsd:simpleType>
  1824. </xsd:attribute>
  1825. <xsd:attribute name="uuid" use="optional" type="xsd:string" />
  1826. <xsd:attribute name="ref" use="optional">
  1827. <xsd:simpleType>
  1828. <xsd:restriction base="xsd:string">
  1829. <xsd:annotation>
  1830. <xsd:documentation xml:lang="en">
  1831. The pattern associated with this restriction
  1832. is intended to model a simple XPath statement
  1833. restricted only to element names. The included
  1834. regular expression is not fully representative
  1835. of all legal XML element names and should be
  1836. extended.
  1837. </xsd:documentation>
  1838. </xsd:annotation>
  1839. <xsd:pattern value="(/([a-zA-Z_][\w\.-_]*:)?[a-zA-Z_][\w\.-_]*)+" />
  1840. </xsd:restriction>
  1841. </xsd:simpleType>
  1842. </xsd:attribute>
  1843. <xsd:attribute name="version" use="optional" type="xsd:positiveInteger" />
  1844. </xsd:complexType>
  1845. <xsd:complexType name="DataSyncAttributeType">
  1846. <xsd:simpleContent>
  1847. <xsd:extension base="xsd:string">
  1848. <xsd:attribute name="name" type="xsd:QName" use="required" />
  1849. </xsd:extension>
  1850. </xsd:simpleContent>
  1851. </xsd:complexType>
  1852. </xsd:schema>
  1853. ]]></code>
  1854. </section2>
  1855. </section1>
  1856. </xep>