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.
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
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.
An entity can monitor completed forms by subscribing to the completed form node, as described in Publish-Subscribe (XEP-0060) [1] 6.1.
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.
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'.
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.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
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 <https://xmpp.org/community/> 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 https://xmpp.org/extensions/attic/
Initial published version approved by XMPP Council.
First draft.
@report{smith2014xep0346, title = {Form Discovery and Publishing}, author = {Smith, Kevin}, type = {XEP}, number = {0346}, version = {0.2}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-0346.html}, date = {2014-04-07/2017-09-11}, }
END