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-0317.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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>Hats</title>
  10. <abstract>This specification defines a more extensible model for roles and affiliations in Multi-User Chat rooms.</abstract>
  11. &LEGALNOTICE;
  12. <number>0317</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. <spec>XEP-0045</spec>
  20. <spec>XEP-0050</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>NOT_YET_ASSIGNED</shortname>
  25. &stpeter;
  26. <revision>
  27. <version>0.1</version>
  28. <date>2013-01-03</date>
  29. <initials>psa</initials>
  30. <remark><p>Initial published version approved for publication by the XMPP Council; clarified ad-hoc commands logic and syntax.</p></remark>
  31. </revision>
  32. <revision>
  33. <version>0.0.2</version>
  34. <date>2012-12-09</date>
  35. <initials>psa</initials>
  36. <remark><p>Described use of ad-hoc commands for adding and removing hats.</p></remark>
  37. </revision>
  38. <revision>
  39. <version>0.0.1</version>
  40. <date>2012-12-06</date>
  41. <initials>psa</initials>
  42. <remark><p>First draft.</p></remark>
  43. </revision>
  44. </header>
  45. <section1 topic='Introduction' anchor='intro'>
  46. <p>&xep0045; defines a widely-implemented XMPP extension for chatrooms, including basic roles and affiliations such as owner, administrator, and moderator. However, in many scenarios it is desirable to define different roles that are appropriate for the relevant application. Examples might include a "presenter" or a "scribe" in an online meeting system, a "representative" or a "manager" in a customer service application, a "comms officer" in a military chat system, an "incident manager" in a first responder system, a "teacher" or a "teacher's assistant" in an online classroom, specialized roles in online games, etc. To prevent confusion with standard MUC roles, these extended roles are call "hats", since a participant can "wear many hats" in a room.</p>
  47. </section1>
  48. <section1 topic='Discovery' anchor='disco'>
  49. <p>A MUC service that supports hats MUST advertise a &xep0030; feature of "urn:xmpp:hats:0".</p>
  50. </section1>
  51. <section1 topic='Protocol' anchor='protocol'>
  52. <section2 topic='Including a Hat in Presence' anchor='presence'>
  53. <p>MUC already includes a way for the room to signal the roles and affiliations of room occupants. Hats are signalled in a similar way. For example, the following presence notification would be sent by the room for an occupant who is a MUC room moderator but who also has a hat of "teacher's assistant" in an online classroom.</p>
  54. <example caption='Presence With Hat'><![CDATA[
  55. <presence
  56. from='physicsforpoets@courses.example.edu/Terry'
  57. id='DE5C66DE-EC7D-4ECB-844A-B717A67CCE3D'
  58. to='steve@example.edu/tablet'>
  59. <x xmlns='http://jabber.org/protocol/muc#user'>
  60. <item affiliation='owner' role='moderator'/>
  61. </x>
  62. <hats xmlns='urn:xmpp:hats:0'>
  63. <TeacherAssistant xmlns='http://tech.example.edu/hats' displayname='Teacher&apos; Assistant' xml:lang='en-us'/>
  64. </hats>
  65. </presence>
  66. ]]></example>
  67. <p>Note: The format is open for debate. Possibilities include:</p>
  68. <ol>
  69. <li>
  70. <p>XML element in the hats namespace with name as a URI:</p>
  71. <p>&lt;hat xmlns='urn:xmpp:hats:0' name='http://tech.example.edu/hats#TeacherAssistant' display='Teacher&amp;apos;s Assistant' xml:lang='en-us'/&gt;</p>
  72. <p>Pro: Clients that don't understand the 'http://tech.example.edu/hats#TeacherAssistant' semantics can at least display a human-readable name. Names can be registered with the XMPP Registrar. Also appropriate as a field name in Ad-Hoc Commands.</p>
  73. <p>Con: Not a very Jabberish way of structuring information.</p>
  74. </li>
  75. <li>
  76. <p>XML element in the hats namespace with name scoped using Clark Notation:</p>
  77. <p>&lt;hat xmlns='urn:xmpp:hats:0' name='{http://tech.example.edu/hats}TeacherAssistant' display='Teacher&amp;apos;s Assistant' xml:lang='en-us'/&gt;</p>
  78. <p>Pro: Clients that don't understand the 'http://tech.example.edu/hats#TeacherAssistant' semantics can at least display a human-readable name. Names can be registered with the XMPP Registrar. Also integrates well with Ad-Hoc Commands.</p>
  79. <p>Con: Not a very Jabberish way of structuring information.</p>
  80. </li>
  81. <li>
  82. <p>XML element qualified by custom namespace:</p>
  83. <p>&lt;TeacherAssistant xmlns='http://tech.example.edu/hats' displayname='Teacher&amp;apos;s Assistant' xml:lang='en-us'/&gt;</p>
  84. <p>Pro: A more Jabberish way to structure information.</p>
  85. <p>Con: Clients won't show anything if they don't understand the custom namespace.</p>
  86. </li>
  87. </ol>
  88. <p>As noted, a participant can wear many hats. The following example shows a participant who is a MUC room owner and both a "host" and a "presenter" in an online meeting system.</p>
  89. <example caption='Presence With Multiple Hats'><![CDATA[
  90. <presence
  91. from='meeting123@meetings.example.com/Harry'
  92. id='D568A74F-E062-407C-83E9-531E91526516'
  93. to='someone@example.com/foo'>
  94. <x xmlns='http://jabber.org/protocol/muc#user'>
  95. <item affiliation='owner' role='moderator'/>
  96. </x>
  97. <hats xmlns='urn:xmpp:hats:0'>
  98. <hat displayName='Host' name='http://schemas.example.com/hats#host' xml:lang='en-us'/>
  99. <hat displayName='Presenter' name='http://schemas.example.com/hats#presenter' xml:lang='en-us'/>
  100. </hats>
  101. </presence>
  102. ]]></example>
  103. </section2>
  104. <section2 topic='Adding a Hat' anchor='add'>
  105. <p>Hats are added and removed using &xep0050;.</p>
  106. <p>The following flow shows how to add a hat.</p>
  107. <example caption='Admin Requests to Add a Hat'><![CDATA[
  108. <iq from='professor@example.edu/office'
  109. id='fdi3n2b6'
  110. to='physicsforpoets@courses.example.edu'
  111. type='set'
  112. xml:lang='en'>
  113. <command xmlns='http://jabber.org/protocol/commands'
  114. action='execute'
  115. node='urn:xmpp:hats:commands:don'/>
  116. </iq>
  117. ]]></example>
  118. <p>Unless an error occurs, the service returns the appropriate form.</p>
  119. <example caption='Service Returns Form to Admin'><![CDATA[
  120. <iq from='physicsforpoets@courses.example.edu'
  121. id='fdi3n2b6'
  122. to='professor@example.edu/office'
  123. type='result'
  124. xml:lang='en'>
  125. <command xmlns='http://jabber.org/protocol/commands'
  126. node='urn:xmpp:hats:commands:don'
  127. sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
  128. status='executing'>
  129. <x xmlns='jabber:x:data' type='form'>
  130. <title>Assigning a Hat</title>
  131. <instructions>Fill out this form to assign a hat.</instructions>
  132. <field type='hidden' var='FORM_TYPE'>
  133. <value>urn:xmpp:hats:commands</value>
  134. </field>
  135. <field label='User Address'
  136. type='jid-single'
  137. var='accountjid'>
  138. <required/>
  139. </field>
  140. <field label='The role'
  141. type='list-single'
  142. var='hat'>
  143. <option label='Teacher'><value>http://tech.example.edu/hats#Teacher</value></option>
  144. <option label='Teacher&apos;s Assistant'><value>http://tech.example.edu/hats#TeacherAssistant</value></option>
  145. <option label='Test Proctor'><value>http://tech.example.edu/hats#Proctor</value></option>
  146. </field>
  147. </x>
  148. </command>
  149. </iq>
  150. ]]></example>
  151. <example caption='Admin Submits Form'><![CDATA[
  152. <iq from='professor@example.edu/office'
  153. id='9fens61z'
  154. to='physicsforpoets@courses.example.edu'
  155. type='set'
  156. xml:lang='en'>
  157. <command xmlns='http://jabber.org/protocol/commands'
  158. node='urn:xmpp:hats:commands:don'
  159. sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'>
  160. <x xmlns='jabber:x:data' type='submit'>
  161. <field type='hidden' var='FORM_TYPE'>
  162. <value>urn:xmpp:hats:commands</value>
  163. </field>
  164. <field var='accountjid'>
  165. <value>terry.anderson@example.edu</value>
  166. </field>
  167. <field var='hat'>
  168. <value>http://tech.example.edu/hats#TeacherAssistant</value>
  169. </field>
  170. </x>
  171. </command>
  172. </iq>
  173. ]]></example>
  174. <example caption='Service Informs Admin of Completion'><![CDATA[
  175. <iq from='physicsforpoets@courses.example.edu'
  176. id='9fens61z'
  177. to='professor@example.edu/office'
  178. type='result'
  179. xml:lang='en'>
  180. <command xmlns='http://jabber.org/protocol/commands'
  181. node='urn:xmpp:hats:commands:don'
  182. sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
  183. status='completed'/>
  184. </iq>
  185. ]]></example>
  186. <p>Note: only one hat is added at a time, and the form uses a field of type "list-single" to enforce that logic.</p>
  187. </section2>
  188. <section2 topic='Removing a Hat' anchor='remove'>
  189. <p>The following flow shows how to remove a hat.</p>
  190. <example caption='Admin Requests to Remove a Hat'><![CDATA[
  191. <iq from='professor@example.edu/office'
  192. id='fdi3n2b6'
  193. to='physicsforpoets@courses.example.edu'
  194. type='set'
  195. xml:lang='en'>
  196. <command xmlns='http://jabber.org/protocol/commands'
  197. action='execute'
  198. node='urn:xmpp:hats:commands:doff'>
  199. <x xmlns='jabber:x:data' type='submit'>
  200. <field type='hidden' var='FORM_TYPE'>
  201. <value>urn:xmpp:hats:commands</value>
  202. </field>
  203. <field var='accountjid'>
  204. <value>terry.anderson@example.edu</value>
  205. </field>
  206. <field var='hat'>
  207. <option label='Teacher&apos;s Assistant'><value>http://tech.example.edu/hats#TeacherAssistant</value></option>
  208. </field>
  209. </x>
  210. </command>
  211. </iq>
  212. ]]></example>
  213. <example caption='Service Informs Admin of Completion'><![CDATA[
  214. <iq from='physicsforpoets@courses.example.edu'
  215. id='9fens61z'
  216. to='professor@example.edu/office'
  217. type='result'
  218. xml:lang='en'>
  219. <command xmlns='http://jabber.org/protocol/commands'
  220. node='urn:xmpp:hats:commands:doff'
  221. sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
  222. status='completed'/>
  223. </iq>
  224. ]]></example>
  225. </section2>
  226. </section1>
  227. <section1 topic='Security Considerations' anchor='security'>
  228. <p>To follow.</p>
  229. </section1>
  230. <section1 topic='IANA Considerations' anchor='iana'>
  231. <p>This document requires no interaction with &IANA;.</p>
  232. </section1>
  233. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  234. <section2 topic='Protocol Namespaces' anchor='registrar-protocol'>
  235. <p>The XMPP Registrar shall add "urn:xmpp:hats:0" to its registry of protocol namespaces.</p>
  236. </section2>
  237. </section1>
  238. <section1 topic='XML Schema' anchor='schema'>
  239. <p>To follow.</p>
  240. </section1>
  241. <section1 topic='Acknowledgements' anchor='acks'>
  242. <p>The concepts underlying this specification were first discussed several years ago at an XMPP Summit in Brussels, Belgium. Special thanks to Joe Hildebrand and Ralph Meijer for their contributions to those discussions. Thanks also to Matt Miller, Kevin Smith, and Matthew Wild for their feedback on the written specification.</p>
  243. </section1>
  244. </xep>