Abstract: | This specification describes a series of conventions that allow the management of form templates and publishing of completed forms. |
Author: | Kevin Smith |
Copyright: | © 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2014-04-10 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Use Cases
2.1. Node naming
2.2. Listing available templates
2.3. Fetching a template
2.4. Template format
2.5. Submitting a completed form
2.6. Monitoring completed form
2.7. Publishing form templates
2.8. Node configuration
3. Determining Support
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
7. XML Schema
8. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
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 Publish-Subscribe (XEP-0060) [1].
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.
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 "fdp/template/" and for completed forms is "fdp/submitted/".
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 "fdp/template/isode.com/christmas-party-feedback/2013" to contain the form template and "fdp/submitted/isode.com/christmas-party-feedback/2013" for the submitted nodes.
To find the templates present on a pubsub service, do a disco#items as described in Publish-Subscribe (XEP-0060) [1] section 5.2. Those items that have a node ID that starts with "fdp/template" are form templates.
<iq id="34385937-3740-411d-a360-374e9ba73202" to="pubsub.stan.isode.net" type="get"> <query xmlns="http://jabber.org/protocol/disco#items"/> </iq> <iq from='pubsub.stan.isode.net' to='sysop@stan.isode.net/4d67a58b4d16cc1d' type='result' id='34385937-3740-411d-a360-374e9ba73202'> <query xmlns='http://jabber.org/protocol/disco#items'> <item jid='pubsub.stan.isode.net' node='fdp/submitted/stan.isode.net/accidentreport' name='AccidentReport'/> <item jid='pubsub.stan.isode.net' node='fdp/template/stan.isode.net/accidentreport' name='AccidentReport'/> </query> </iq>
In the above example there is one form available, "stan.isode.net/accidentreport"
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 Publish-Subscribe (XEP-0060) [1] 6.5.5
<iq id="fb73efb3-356e-43ce-98a3-f76d86132745" to="pubsub.stan.isode.net" type="get"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <items max_items="1" node="fdp/template/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub"/> </pubsub> </iq> <iq from='pubsub.stan.isode.net' to='sysop@stan.isode.net/4d67a58b4d16cc1d' type='result' id='fb73efb3-356e-43ce-98a3-f76d86132745'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <items node='fdp/template/stan.isode.net/accidentreport'> <item id='version01'> <x xmlns='jabber:x:data' type='form'> <instructions>Please fill in all fields to complete this accident report.</instructions> <title>Accident report form.</title> <field type='list-single' label='Place of fall:' var='Place'> <option label="Kitchen"> <value>Kitchen</value> </option> <option label="Conference Room"> <value>Conference Room</value> </option> <option label="Engineering"> <value>Engineering</value> </option> </field> <field type='text-single' label='Type of injury:' var='Type'> </field> <field type='boolean' label='Ambulance needed?' var='Ambulance'> </field> </x> </item> </items> </pubsub> </iq>
The format of the template should be a standard Data Forms (XEP-0004) [2] form; this can be extended with Data Forms Validation (XEP-0122) [3] and/or Data Forms Layout (XEP-0141) [4] as needed by individual form applications. The template will be the pubsub item.
When the form has been completed, the resultant Data Forms (XEP-0004) [2] payload shall be published to the completed items node corresponding to the form type using the protocol in Publish-Subscribe (XEP-0060) [1] 7.1. The node ID for publishing completed forms corresponds to the node the template was stored in, with the fdp/template prefix replaced with the fdp/submitted prefix.
<iq id="fc2e69de-4626-47d3-b04b-1cd6b4049b3f" to="pubsub.stan.isode.net" type="set"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <publish node="fdp/submitted/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub"> <item id="" xmlns="http://jabber.org/protocol/pubsub"> <x type="submit" xmlns="jabber:x:data"> <title>Accident report form.</title> <field label="Place of fall:" type="list-single" var="Place"> <value>Kitchen</value> </field> <field label="Type of injury:" type="text-single" var="Type"> <value>Ankle</value> </field> <field label="Ambulance needed?" type="boolean" var="Ambulance"> <value>1</value> </field> </x> </item> </publish> </pubsub> </iq>
An entity can monitor completed forms by subscribing to the completed form node, as described in Publish-Subscribe (XEP-0060) [1] 6.1.
<iq id="0f66fbcf-6148-40ed-a084-a3a5e2a71329" to="pubsub.stan.isode.net" type="set"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <subscribe jid="sysop@stan.isode.net/763be9c30f8ee893" node="fdp/submitted/stan.isode.net/accidentreport" xmlns="http://jabber.org/protocol/pubsub"/> </pubsub> </iq>
Form templates are made available by publishing them to the template node for that form using the protocol in Publish-Subscribe (XEP-0060) [1] 7.1.
<iq id="309d632d-fa68-4004-8611-d11cc5074d66" to="pubsub.stan.isode.net" type="set"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <publish node="fdp/template/stan.isode.net/accidentreport"> <item id="version01"> <x xmlns="jabber:x:data" type="form"> <instructions>Please fill in all fields to complete this accident report.</instructions> <title>Accident report form.</title> <field type="list-single" label="Place of fall:" var="Place"> <option label="Kitchen"> <value>Kitchen</value> </option> <option label="Conference Room"> <value>Conference Room</value> </option> <option label="Engineering"> <value>Engineering</value> </option> </field> <field type="text-single" label="Type of injury:" var="Type"> </field> <field type="boolean" label="Ambulance needed?" var="Ambulance"> </field> </x> </item> </publish> </pubsub> </iq>
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.
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'.
<iq type='get' from='sysop@stan.isode.net/763be9c30f8ee893' to='pubsub.stan.isode.net' id='feature1'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
<iq type='result' from='pubsub.stan.isode.net' to='sysop@stan.isode.net/763be9c30f8ee893' id='feature1'> <query xmlns='http://jabber.org/protocol/disco#info'> <identity category='pubsub' type='service'/> <identity category='pubsub' type='urn:xmpp:fdp:0'/> <feature var='http://jabber.org/protocol/pubsub'/> </query> </iq>
Discovery of the template forms or completed form nodes happens using the protocol described in Use Cases.
This document introduces no security considerations beyond those in Publish-Subscribe (XEP-0060) [1].
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
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.
As this document only defines semantics for existing protocol, additional schemas are not required.
Thanks to Matthew Wild, Richard Maudsley and Alex Clayton.
Series: XEP
Number: 0346
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2014-04-10
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0001, XEP-0004, XEP-0030, XEP-0060
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
kevin.smith@isode.com
JabberID:
kevin.smith@isode.com
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.
2. XEP-0004: Data Forms <https://xmpp.org/extensions/xep-0004.html>.
3. XEP-0122: Data Forms Validation <https://xmpp.org/extensions/xep-0122.html>.
4. XEP-0141: Data Forms Layout <https://xmpp.org/extensions/xep-0141.html>.
5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version approved by XMPP Council.
(editor (mam))First draft.
(ks)END