XForms Internal

1. HTTP Parameters

Currently in use:

  • $instance – The instance, serialized as XML, compressed, gzipped, stored in base64.
  • $node^{id} – Name of the HTML form elements. Form elements are bound to a node in the instance and the end of the name if the node id (e.g. node^42).
  • $upload^{1}^{2}^{3}^{4}^{5}^{6}^{7} – Where:
    • {1}: node id for file content
    • {2}: original value
    • {3}: node id for file name
    • {4}: current value of file name
    • {5}: node id for media type
    • {6}: current value for media type
    • {7}: node id for size
    • {8}: current id for size
  • $action^... and $actionImg^... – Are used to store the actions to be performed when a submit control is clicked. The value is create in xforms-to-xhtml.xml (look for the xxforms:submit-name function). This value is used as the name of form contro for submit buttons and images. For links, JavaScript is generated to set the value of a hidden field to this value. The hidden field name starts with wsrp_rewrite_action.
  • All the other parameter names are ignored by the XForms Input processor.

Obsolete:

  • $submitted – Was set to 'true' when the form was submitted. When set, the XForms engine did not take into account the instance from the XForms model, but instead recreates the instance entirely from the request. We do not need this anymore as $instance is always going to be set when the instance is submitted.
  • $hidden – Was used to aggregate store the aggregation of all the hidden variables. This is has been replaced by $instance.
  • $idRef

2. Instance To Parameters Processor

Private processor to generate a URL from an instance. This processor gets used internally by the Page Flow Controller when doing a redirect. The content of the nodes referenced from <param ref="..."> is not serialized in the URL.

Example usage:

  <p:processor name="oxf:instance-to-parameters">
  <p:input name="instance" href="#instance"/>
  <p:input name="filter">
  <params>
  <param ref="/instance/department"/>
  <param ref="/instance/employee"/>
  </params>
  </p:input>
  <p:output name="data" id="parameters"/>
  </p:processor>

Example output:

  <parameters>
  <parameter>
  <name>department</name>
  <value>hr</value>
  </parameter>
  <parameter>
  <name>$instance</name>
  <value>...</value>
  </parameter>
  </parameters>

3. Params Declared in the Page Flow Controller

When a <p:param ref="..."> is declared in the page flow controller for a given page, it means that the content of the referenced node of the instance is on the path part of the URL. Let's consider this page, which displays the detailed information about a product with the product stored in the URL:

  <page id="view-product" path-info="/view-product/(.*)" matcher="oxf:perl5-matcher">
  <param ref="/instance/product-id"/>
  </page>

To handle this case we need:

  1. XFormsInput – When a request is received, extract the relevant section of the URL and populate the instance. If a preexisting instance is passed through the $instance parameter, update that instance. This happens before model item properties are evaluated on the instance.
  2. InstanceToParametersProcessor – When doing a redirect to another page, if all the nodes in the instance are referenced are stored in the URL, we don't need include the $instance parameter. This makes the URL less cluttered.