Monday, May 12, 2014

Inline property values

A small change coming in Orbeon Forms 4.6 is the ability to set inline configuration property values.
Orbeon Forms uses properties for a lot of its configuration. For example, to set which standard buttons appear in a form:
<property
  as="xs:string"
  name="oxf.fr.detail.buttons.orbeon.controls"
  value="refresh pdf wizard-prev wizard-next review"/>
When a property value is not too long, and using proper indentation, this format is acceptable. But some property values are longer or require multiple lines, and placing them in an XML attribute becomes less than ideal.
So starting with Orbeon Forms 4.6 you can place long property values inline instead. For example the following is identical to the above:
<property as="xs:string" name="oxf.fr.detail.buttons.orbeon.controls">
    refresh pdf wizard-prev wizard-next review
</property>
This is even better for multi-line properties, such as the whitespace stripping configuration:
<property as="xs:string" name="oxf.xforms.whitespace.html.preserve">
    xh|pre,
    xh|textarea,
    xh|script,
    xh|style,
    xh|template
</property>
or simple processes associated with buttons:
<property as="xs:string" name="oxf.fr.detail.process.save-final.*.*">
    require-uploads
    then validate-all
    then save
    then success-message("save-success")
    recover error-message("database-error")
</property>
or the Form Builder toolbox configuration:
<property as="xs:string"  name="oxf.fb.toolbox.group.typed.uri.*.*">
    oxf:/forms/orbeon/builder/xbl/typed-controls.xbl
    oxf:/xbl/orbeon/us-phone/us-phone.xbl
    oxf:/xbl/orbeon/number/number.xbl
    oxf:/xbl/orbeon/currency/currency.xbl
    oxf:/xbl/orbeon/us-state/us-state.xbl
</property>
See the documentation for more on configuration properties.

No comments:

Post a Comment