view
Flexible function for viewing different slices of XForms, filtered on different parameters, and in different formats.
Description
The View XForm(s) function provides direct access to the HTML, XML, RSS or JSON rendering of XForms within your Legacy Content Delivery application. Based on the parameters provided, you can access doc-attached (by publication, language or topic) or floating XForms. You cannot access a user's profile or preference via this API call, instead see "view_form".
Parameters
- action
- view
- fid
- ID of the XForm definition.
- status
- If provided, only XForms with the provided status are returned in the result set. This parameter is not available if the pub, lang, or docid parameters are provided.
- parent
- Name of the parent form to which the form replies for the comment. If "ROOT" is provided, then only forms which are a root (parent = '') are returned.
- format
- The output format for the results. Either "html", "json", "rss" or "xml". Defaults to "html"
- date
- If provided, only XForms created after this date are returned in the result set. The format must conform to the following Java Simple Data Format, yyyy-MM-ddTHH:mm:ss.SSSZZ(such as, 2011-05-02T00:00:00.000-00:00). This parameter is not available if the pub, lang, or docid parameters are provided.
- lang
- The language scope to use when querying XForms (such as "en", or "en-US").
- apikey
- A parameter that allows a call for RSS comment stream to bypass application security if it matches the global configuration item, "rss.apikey". This key should be included for applications like RSS feed readers our Microsoft Outlook which cannot login to the application to retrieve comment streams.
- docid
- The document ID scope to use quering XForms.
- start
- The index of the first XForm to return. Defaults to 0.
- length
- The length of the array of XForms to return. Defaults to 10.
- callback
- The name of the cross domain scripting callback function which will be executed on the client and will be passed the JSON rendered form.
- all
- Using this function requires the "View All XForms" permission. If set to "true" and if the pub, lang, and docid parameters are not provided, the function's result will include XForms that are not owned by the current user, and are not public (therefore, "all" XForms).
- pubid
- The publication ID scope to use when querying XForms.
Example URL
http://<host>:<port>/<context>/web/xforms.xql?action=view&fid=<value>&status=<value>&parent=<value>&format=<value>&date=<value>&lang=<value>&apikey=<value>&docid=<value>&start=<value>&length=<value>&callback=<value>&all=<value>&pubid=<value>
Successful Result
If function call succeeds, it will return an xform, otherwise will display an error page.
Failed Result
If a user does not have 'View Forms' permission, it will display 403 unauthorized page.