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-0346.xml 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. <!ENTITY templatePrefix "fdp/template">
  6. <!ENTITY completedPrefix "fdp/submitted">
  7. ]>
  8. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  9. <xep>
  10. <header>
  11. <title>Form Discovery and Publishing</title>
  12. <abstract>This specification describes a series of conventions that allow the management of form templates and publishing of completed forms.</abstract>
  13. &LEGALNOTICE;
  14. <number>0346</number>
  15. <status>Deferred</status>
  16. <type>Standards Track</type>
  17. <sig>Standards</sig>
  18. <approver>Council</approver>
  19. <dependencies>
  20. <spec>XMPP Core</spec>
  21. <spec>XEP-0001</spec>
  22. <spec>XEP-0004</spec>
  23. <spec>XEP-0030</spec>
  24. <spec>XEP-0060</spec>
  25. </dependencies>
  26. <supersedes/>
  27. <supersededby/>
  28. <shortname>NOT_YET_ASSIGNED</shortname>
  29. &ksmithisode;
  30. <revision>
  31. <version>0.2</version>
  32. <date>2017-09-11</date>
  33. <initials>XEP Editor (jwi)</initials>
  34. <remark>Defer due to lack of activity.</remark>
  35. </revision>
  36. <revision>
  37. <version>0.1</version>
  38. <date>2014-04-10</date>
  39. <initials>editor (mam)</initials>
  40. <remark>
  41. <p>Initial published version approved by XMPP Council.</p>
  42. </remark>
  43. </revision>
  44. <revision>
  45. <version>0.0.1</version>
  46. <date>2014-04-07</date>
  47. <initials>ks</initials>
  48. <remark>
  49. <p>First draft.</p>
  50. </remark>
  51. </revision>
  52. </header>
  53. <section1 topic='Introduction' anchor='intro'>
  54. <p>There are many circumstances in which it is necessary for entities to 'fill out forms' to be consumed by other entities (such an example might be for reporting an accident in the workplace). This document provides a method by which an entity can discover which forms are available, fetch the templates and submit the completed forms, using standard XMPP &xep0060;.</p>
  55. <p>This is achieved by every form having a pair of pubsub nodes on the same service; one of the nodes contains the template form (the empty form that is to be completed) and the other is used for publishing completed forms.</p>
  56. </section1>
  57. <section1 topic='Use Cases' anchor='usecases'>
  58. <section2 topic='Node naming' anchor='naming'>
  59. <p>Pubsub nodes used for these forms are comprised of a standard prefix and an application-specific suffix. Templates and completed forms for the same form type have the same application-specific suffix, but a different prefix. The prefix for form templates is "&templatePrefix;/" and for completed forms is "&completedPrefix;/".</p>
  60. <p>The application-specific suffix must be guaranteed to be unique to the application, so it is suggested to start with a domain under the application author's control; as such if Isode Ltd. were to use this approach for feedback on the Christmas party, a node ID might be formed as "&templatePrefix;/isode.com/christmas-party-feedback/2013" to contain the form template and "&completedPrefix;/isode.com/christmas-party-feedback/2013" for the submitted nodes.</p>
  61. </section2>
  62. <section2 topic='Listing available templates' anchor='list_templates'>
  63. <p>To find the templates present on a pubsub service, do a disco#items as described in &xep0060; section 5.2. Those items that have a node ID that starts with "&templatePrefix;" are form templates.</p>
  64. <example caption='User discovers available nodes'><![CDATA[
  65. <iq id="34385937-3740-411d-a360-374e9ba73202" to="pubsub.stan.isode.net" type="get">
  66. <query xmlns="http://jabber.org/protocol/disco#items"/>
  67. </iq>
  68. <iq from='pubsub.stan.isode.net' to='sysop@stan.isode.net/4d67a58b4d16cc1d' type='result' id='34385937-3740-411d-a360-374e9ba73202'>
  69. <query xmlns='http://jabber.org/protocol/disco#items'>
  70. <item jid='pubsub.stan.isode.net' node='fdp/submitted/stan.isode.net/accidentreport' name='AccidentReport'/>
  71. <item jid='pubsub.stan.isode.net' node='fdp/template/stan.isode.net/accidentreport' name='AccidentReport'/>
  72. </query>
  73. </iq>
  74. ]]></example>
  75. <p>In the above example there is one form available, "stan.isode.net/accidentreport"</p>
  76. </section2>
  77. <section2 topic='Fetching a template' anchor='fetch_templates'>
  78. <p>To fetch a template, first identify the node that the template is stored in and then request the last published item for that node, as in &xep0060; 6.5.5</p>
  79. <example caption='User fetches a template'><![CDATA[
  80. <iq id="fb73efb3-356e-43ce-98a3-f76d86132745" to="pubsub.stan.isode.net" type="get">
  81. <pubsub xmlns="http://jabber.org/protocol/pubsub">
  82. <items max_items="1" node="fdp/template/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub"/>
  83. </pubsub>
  84. </iq>
  85. <iq from='pubsub.stan.isode.net' to='sysop@stan.isode.net/4d67a58b4d16cc1d' type='result' id='fb73efb3-356e-43ce-98a3-f76d86132745'>
  86. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  87. <items node='fdp/template/stan.isode.net/accidentreport'>
  88. <item id='version01'>
  89. <x xmlns='jabber:x:data' type='form'>
  90. <instructions>Please fill in all fields to complete this accident report.</instructions>
  91. <title>Accident report form.</title>
  92. <field type='list-single' label='Place of fall:' var='Place'>
  93. <option label="Kitchen">
  94. <value>Kitchen</value>
  95. </option>
  96. <option label="Conference Room">
  97. <value>Conference Room</value>
  98. </option>
  99. <option label="Engineering">
  100. <value>Engineering</value>
  101. </option>
  102. </field>
  103. <field type='text-single' label='Type of injury:' var='Type'>
  104. </field>
  105. <field type='boolean' label='Ambulance needed?' var='Ambulance'>
  106. </field>
  107. </x>
  108. </item>
  109. </items>
  110. </pubsub>
  111. </iq>
  112. ]]></example>
  113. </section2>
  114. <section2 topic='Template format' anchor='template_format'>
  115. <p>The format of the template should be a standard &xep0004; form; this can be extended with &xep0122; and/or &xep0141; as needed by individual form applications. The template will be the pubsub item.</p>
  116. </section2>
  117. <section2 topic='Submitting a completed form' anchor='submit_form'>
  118. <p>When the form has been completed, the resultant &xep0004; payload shall be published to the completed items node corresponding to the form type using the protocol in &xep0060; 7.1. The node ID for publishing completed forms corresponds to the node the template was stored in, with the &templatePrefix; prefix replaced with the &completedPrefix; prefix.</p>
  119. <example caption='User submits the completed form'><![CDATA[
  120. <iq id="fc2e69de-4626-47d3-b04b-1cd6b4049b3f" to="pubsub.stan.isode.net" type="set">
  121. <pubsub xmlns="http://jabber.org/protocol/pubsub">
  122. <publish node="fdp/submitted/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub">
  123. <item id="" xmlns="http://jabber.org/protocol/pubsub">
  124. <x type="submit" xmlns="jabber:x:data">
  125. <title>Accident report form.</title>
  126. <field label="Place of fall:" type="list-single" var="Place">
  127. <value>Kitchen</value>
  128. </field>
  129. <field label="Type of injury:" type="text-single" var="Type">
  130. <value>Ankle</value>
  131. </field>
  132. <field label="Ambulance needed?" type="boolean" var="Ambulance">
  133. <value>1</value>
  134. </field>
  135. </x>
  136. </item>
  137. </publish>
  138. </pubsub>
  139. </iq>
  140. ]]></example>
  141. </section2>
  142. <section2 topic='Monitoring completed form' anchor='monitor_forms'>
  143. <p>An entity can monitor completed forms by subscribing to the completed form node, as described in &xep0060; 6.1.</p>
  144. <example caption='User subscribes to a completed form node'><![CDATA[
  145. <iq id="0f66fbcf-6148-40ed-a084-a3a5e2a71329" to="pubsub.stan.isode.net" type="set">
  146. <pubsub xmlns="http://jabber.org/protocol/pubsub">
  147. <subscribe jid="sysop@stan.isode.net/763be9c30f8ee893" node="fdp/submitted/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub"/>
  148. </pubsub>
  149. </iq>
  150. ]]></example>
  151. </section2>
  152. <section2 topic='Publishing form templates' anchor='publish_templates'>
  153. <p>Form templates are made available by publishing them to the template node for that form using the protocol in &xep0060; 7.1.</p>
  154. <example caption='Administrator publishes a form template'><![CDATA[
  155. <iq id="309d632d-fa68-4004-8611-d11cc5074d66" to="pubsub.stan.isode.net" type="set">
  156. <pubsub xmlns="http://jabber.org/protocol/pubsub">
  157. <publish node="fdp/template/stan.isode.net/accidentreport">
  158. <item id="version01">
  159. <x xmlns="jabber:x:data" type="form">
  160. <instructions>Please fill in all fields to complete this accident report.</instructions>
  161. <title>Accident report form.</title>
  162. <field type="list-single" label="Place of fall:" var="Place">
  163. <option label="Kitchen">
  164. <value>Kitchen</value>
  165. </option>
  166. <option label="Conference Room">
  167. <value>Conference Room</value>
  168. </option>
  169. <option label="Engineering">
  170. <value>Engineering</value>
  171. </option>
  172. </field>
  173. <field type="text-single" label="Type of injury:" var="Type">
  174. </field>
  175. <field type="boolean" label="Ambulance needed?" var="Ambulance">
  176. </field>
  177. </x>
  178. </item>
  179. </publish>
  180. </pubsub>
  181. </iq>
  182. ]]></example>
  183. </section2>
  184. <section2 topic='Node configuration' anchor='node_configuration'>
  185. <p>Template nodes must be configured to support at least one persistent item. Both templates and published nodes need to be configured with appropriate access to publish and subscribe. Deployments may be configured such that entities are allowed to read the templates and submit completed forms, but not to read the completed forms.</p>
  186. </section2>
  187. </section1>
  188. <section1 topic='Determining Support' anchor='support'>
  189. <p>All of the form activity happens over standard pubsub, so initial discovery is of the pubsub domain. A pubsub domain supporting these forms will have an additional disco identity (additional to the standard pubsub identity) with a category of 'pubsub' and a type of 'urn:xmpp:fdp:0'. </p>
  190. <example caption='Entity Queries Pubsub Service Regarding Supported Features'><![CDATA[
  191. <iq type='get'
  192. from='sysop@stan.isode.net/763be9c30f8ee893'
  193. to='pubsub.stan.isode.net'
  194. id='feature1'>
  195. <query xmlns='http://jabber.org/protocol/disco#info'/>
  196. </iq>]]></example>
  197. <example caption='Pubsub Service Includes FDP in its identities'><![CDATA[
  198. <iq type='result'
  199. from='pubsub.stan.isode.net'
  200. to='sysop@stan.isode.net/763be9c30f8ee893'
  201. id='feature1'>
  202. <query xmlns='http://jabber.org/protocol/disco#info'>
  203. <identity category='pubsub' type='service'/>
  204. <identity category='pubsub' type='urn:xmpp:fdp:0'/>
  205. <feature var='http://jabber.org/protocol/pubsub'/>
  206. </query>
  207. </iq>]]></example>
  208. <p>Discovery of the template forms or completed form nodes happens using the protocol described in <link url="#usecases">Use Cases</link>.
  209. </p>
  210. </section1>
  211. <!-- <section1 topic='Implementation Notes' anchor='impl'>
  212. </section1>-->
  213. <section1 topic='Security Considerations' anchor='security'>
  214. <p>This document introduces no security considerations beyond those in &xep0060;.</p>
  215. </section1>
  216. <section1 topic='IANA Considerations' anchor='iana'>
  217. <p>This document requires no interaction with &IANA;.</p>
  218. </section1>
  219. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  220. <p>Include the "urn:xmpp:fdp:0" namespace in the registry of protocol namespaces. Include "urn:xmpp:fdp:0" as an additional type in the pubsub category of service discovery identities.</p>
  221. </section1>
  222. <section1 topic='XML Schema' anchor='schema'>
  223. <p>As this document only defines semantics for existing protocol, additional schemas are not required.</p>
  224. </section1>
  225. <section1 topic='Acknowledgements' anchor='ack'>
  226. <p>Thanks to Matthew Wild, Richard Maudsley and Alex Clayton.</p>
  227. </section1>
  228. </xep>