Thursday, September 11, 2014

Control required values with formulas in Orbeon Forms 4.7

Up to Orbeon Forms 4.6, Form Builder only lets you determine whether a field is required or not once and for all, by saying "Yes" or "No.

With the upcoming Orbeon Forms 4.7, you can also choose to use a formula, which means that the choice can be dynamic: for example, a field might be required only if another field is set to a specific value.

As usual, you express the formula with an XPath expression, which gives you access to all of the form's data as well as the Orbeon Forms XPath function library.




For more details, see the documentation.

Wednesday, September 3, 2014

Embedding support in Orbeon Forms 4.7

So far there have been a couple of ways to integrate Orbeon Forms with existing applications:
  • Side by side: linking or posting data from other applications to Orbeon Forms pages, and linking or posting data from Orbeon Forms to other applications.
  • Embedded in a portal: using the full portlet or the proxy portlet within Liferay.
Orbeon Forms 4.7 introduces a new way to integrate forms within Java (and other Java Virtual Machine-based languages) applications: server-side embedding.

Your application simply includes a small JAR file, adds some configuration parameters, and then each page which needs to embed a form simply calls the API to tell which form to embed. You control where in your page the form must show, which means that your page can include your own header, footer, sidebars, and other content in addition to the form.

A form embedded in a simple page with a top banner
See the documentation for more details.

Monday, August 25, 2014

Fail to handle the session properly, and make your site useless

I was recently on vacation abroad. Just before taking the flight back home, I embarked on the mundane task of doing the online check-in for my return flight. The process started nicely, on what looked like a modern and well designed site; it was obvious that a lot of care went into creating that site.

Then, I arrived at the page where you need to enter information about yourself and family members traveling with you: passport number, expiration date, address of residence, information about the green card when it applies, and so on. In my case, with 4 family members, that was a pretty long page. I had all the passports handy, but it still took me maybe 10 minutes to enter that information. Apparently, I wasn't fast enough: upon pressing the Next button, I got that dreadful your session has expired message.

I ended up preparing all the information required for the form in a text file, so I could just copy-paste it very quickly, and fill out the form before the session could expire. Check-in done. But I seriously doubt that many people manage to get through this process. See such a nicely designed site completely fail because of a session issue is a shame.

The thing is that doing it right isn't as easy as it seems. You have to deals with competing requirements:

  1. Having a session last for a longer time is worse for security and uses more resources on your servers.
  2. But of course, the session should last long so the site is actually usable, and users don't get a session expired while filling out a form.

Say you setup your server to have the session last only 10 minutes, favoring security and lower resource usage on your server. The issue is that the "counter" typically gets reset every time users submit a form, e.g. click on the next button in a wizard. This means that if you have a long form, you're saying your users must fill it out in less than 10 minutes, which might not be possible. But of course, you can do better:

  1. Why not "reset the counter" every time users fill out a field? This way, whatever the length of the form is, the session will only expire after 10 minutes of true inactivity.
  2. If you want to be more aggressive about keeping the session alive, why not prevent it from expiring as long as users have a tab open pointing to your site?

Orbeon Forms does both. Out-of-the-box1. And we think every site should do the same. (Especially if those I use to check-in before an international flight with 4 family members.)


1 In Orbeon Forms, the feature that keeps the session alive as long as users have a tab open is called session heartbeat. Since doing this does put more strain on your servers, you have the option of disabling session heartbeat.

Thursday, August 7, 2014

Orbeon Forms 4.6.2

Today we released Orbeon Forms 4.6.2 PE. This update to Orbeon Forms 4.6.1 PE contains bug-fixes and localization improvements. We recommend this update for all Orbeon Forms 4.6 PE users. For more details about the 4.6 release in general, see Orbeon Forms 4.6.

This release includes the following bug fixes:
  • Form Builder
    • Incorrect copy/paste of control with warning constraint (#1785)
  • Form Runner
    • Alert for constraint shows instead of alert for required (#1829)
    • Required validation must win over other constraints (#1830)
    • Comma-separated roles fail in persistence layer (#1690)
    • Remove Explanation control from the toolbox unless ready (#1825)
    • Versioned resources have expiration date in the past (#1837)
  • XForms
    • XForms inspector doesn't support copy/paste anymore (#1841)
This release also adds:
  • Swedish localization for Form Builder
  • Updated translations for German and Italian (#1832)
Compatibility notes:
You can download the latest version of Orbeon Forms from the downloads page.
    Don't forget to grab a trial license for the PE version.

    Please send feedback:
    We hope you enjoy this release!

    Wednesday, July 23, 2014

    Multiple remote servers

    Orbeon Forms 4.4 introduced the ability to connect Orbeon Forms to a remote server to publish, unpublish, and transfer form definitions back and forth.

    It is now possible to configure more than one server, for example a staging and a production server. You choose to which server to connect when loading the Form Runner Home page.

    Multiple remote servers
    See the documentation for the details, including the change in configuration. This feature will be available in Orbeon Forms 4.7.

    Thursday, July 10, 2014

    Orbeon Forms 4.6.1

    Today we released Orbeon Forms 4.6.1 PE. This update to Orbeon Forms 4.6 PE contains bug-fixes and a couple of minor features. We recommend this update for all Orbeon Forms 4.6 PE users. For more details about the 4.6 release in general, see Orbeon Forms 4.6.

    This release includes the following:
    • Form Builder
      • FB: Order of apps in new dialog is random (#1794)
      • Copy/paste of control doesn't copy LHHA references correctly (#1820)
    • Form Runner
      • ORA-24816 when saving large form (#1797)
      • fr:fields-date/fr:dropdown-date: use oxf.xforms.format.input.date (#1803)
      • Propagate request parameters between edit/review/pdf (#1736)
      • Don't use spinner for Edit/Review buttons (#1814)
      • Ability to pass custom parameters to persistence layers (#1735)
    • XForms
      • Filter returns blank page navigating to .xhtml page (#1796)
      • Email validation is too lax (#1347)
      • Spinner doesn't show properly in Liferay (#1804)
      • Standard Orbeon error dialog not read out (#1724)
    • Other
      • Option to remove Orbeon version number everywhere (#1720)
      • Flickr examples fail because Flickr APIs moved to SSL (#1805)
    Compatibility notes:
    • The oxf.fr.version property has been removed. Use the global oxf.show-version property instead.
    You can download the latest version of Orbeon Forms from the downloads page.
      Don't forget to grab a trial license for the PE version.

      Please send feedback:
      We hope you enjoy this release!

      Tuesday, June 24, 2014

      Orbeon Forms 4.6

      Today we released Orbeon Forms 4.6!

      Major features and enhancements
      • Lower memory usage for compiled forms. Orbeon Forms has a sophisticated system of caches, including for compiled form definitions. In previous versions, several compiled form definition were created for different modes of the same form (creation, edition, view, PDF, email, noscript). In this version, we create a single compiled form definition for creation and edition on one hand, and view, PDF and email on the other hand. When the wizard view is not used, a single form definition is created for all those modes. The benefit is that less memory is used per form you create, and that the first access to a given mode of a form can be faster. (#1143)
      • Faster large forms. This version fixes a bottleneck which slowed down very large forms, sometimes by a factor of two. (#1737)
      • SQL Server support. In addition to Oracle, DB2, and MySQL, Orbeon Forms can now store form definitions and data in SQL Server. (#697) (blog post)
      • Improved Form Runner Home page. The Form Runner Home page is now faster, in particular with relational databases, and supports paging. (blog post)
      • Improved versioning options when publishing. When versioning is enabled, publishing a form now gives the form author the option to create a new form version or to override the previous version. (#1669)
      • Upgrade form definitions. Form Builder, when loading forms from older versions of Orbeon Forms, has a mechanism to upgrade the form definition to the new version. Until now, you had to open all those forms in Form Builder and republish them, which could be time consuming. You can  now do this as a batch operation from the Form Runner Home page with the new "Upgrade form definitions" function. (#1695)
      Internationalization

      This version introduces the following new languages:
      • Portuguese (Form Runner and Form Builder)
      • Dutch (Form Runner)
      In addition, the Finnish resources have been brought up to date (Form Runner and Form Builder).

      See Localizing Orbeon Forms for the latest localization support. Localization depends on volunteers, so please let us know if you want to help!

      Other new features and bug-fixes

      Including the major features and enhancements above, we closed about 60 issues since Orbeon Forms 4.5.1 (over 70 since 4.5). We should mention these notable bug-fixes and features:
      • Form Builder
        • You can configure whether services/actions are present in toolbox (#1722), which Publish dialog actions are available (#1721), and which buttons and processes are used in Form Builder (#1416)
      • Form Runner
        • URLs in text fields and textareas are automatically hyperlinked (#1694)
        • The "navigate" action properties can be XPath value templates (#1226) (doc)
        • Attached images are properly resized in PDF files (#872)
        • Focusing out of all fields dispatches a DOMFocusOut event (the Form Runner error summary show errors as expected when this happens) (#619)
        • When paging in the Summary or Home pages, full updates are used and increase UI responsiveness (#1685)
        • The Dynamic Data Dropdown can now be hidden if its itemset is empty (#1621)
        • The min and max attributes on fr:grid are now AVTs (#1665)
      • XForms
        • Required and type MIPs now count as failed validations (#1533)
        • xf:case supports AVT on the selected attribute (#1683)
        • The recalculate and revalidate actions are now unified (#1650)
      • Other
        • Properties support inline values for enhanced readability (#1257) (blog post)
        • Orbeon now uses jQuery version 1.10.2 (#1349)
      Current browser support

      This is unchanged since Orbeon Forms 4.5:
      • Form Builder (creating forms):
        • Chrome (latest versions, both in the stable and dev channels)
        • Firefox (latest released version and current Firefox ESR)
        • IE10 and IE11
        • Additional support for Form Runner (accessing form):
          • IE7 (deprecated), IE8, and IE9
          • Safari Mobile on iOS 6 and iOS 7
          • Chrome for Android (stable channel)
        Compatibility notes
        • If you use Oracle, MySQL or DB2, you need to upgrade your database schemas. (doc)
        • With XForms, the xxf:sequence element child of xf:var is deprecated. Instead, use xxf:value. (#1710)
        • The default is for forms created with Form Builder is to have noscript support disabled. To enable noscript support, add xxf:noscript-support="true" to the main <xf:model> element of the form, via Edit Source.
        You can download the latest version of Orbeon Forms from the downloads page.
          Don't forget to grab a trial license for the PE version.

          Please send feedback:
          We hope you enjoy this release!