Wednesday, December 12, 2012

Orbeon Forms 4.0 M19

Today we released Orbeon Forms 4.0 M19 (Milestone 19). Like 4.0 M18 and the previous milestones this is not a final release.
In this release, the following issues were addressed:
  • Form Builder
    • Copy/paste of control loses translation (#625)
    • Enable XPath type annotations by default in Builder (#630)
    • When creating a new form, dialog shouldn't show a 'cancel' link (#590)
    • Form settings: textarea is not tall enough (#622)
    • Setting help to blank doesn't remove help (#577)
    • Custom XML: focus taken out of XML editor on click (#642)
    • Custom XML: dialog is too narrow, not high enough (#643)
    • Should not be able to set the focus on a readonly CodeMirror (#645)
    • Regression: Action editor: input/output values can't be set (#647)
    • 403 error when testing form containing an XPath error (#627)
    • Wizard view by default for orbeon/controls
    • Make fields required in Action Editor
  • Form Runner
    • Required asterisk doesn't show in dialogs (#639)
    • fr:number is now documented (#546)
    • Add fr-grid-col-<x> classes on cols and fr-grid-<id> on table (a4bcef1766)
    • More files converted to LESS
  • XForms engine
More information is available in the in-progress release notes for 4.0.

You can download the builds using these links:
Don't forget to grab a trial license for the PE version.

Please send feedback:

Monday, December 10, 2012

Creating REST services with Google Apps Script

There are times when you'd like to create a service, want the service to be available publicly, and want to do this quickly, maybe for testing or for a demo you're putting together. In those cases, Google Apps Script might just be the solution you're looking for.

As an example, let's create a service that tells us if a number it receives is even. The number will be passed as a request parameter, e.g. ...?number=42, and will provide an XML response, e.g. <result>true</result>. Then, we will call this service from a form created with Form Builder, to show, next to an input field, whether the typed number is even or odd. Let's start by creating and deploying the service:

  1. To create a new script, load Google Drive, click on Create, and under More, choose Script. Click on Untitled project, and name it IsEven.

  2. Edit your script, or in this case copy-pate the following code in the editor:

    function doGet(request) {
        var result = '' + (request.parameter.number % 2 == 0) + '';
        return ContentService.createTextOutput(result)
            .setMimeType(ContentService.MimeType.XML);
    }

  3. To deploy your service, make sure it is first saved, then go to File | Manage Versions, click on Save New Version, and click OK to close the dialog. Go to Publish | Deploy as web app…, in Who has access to the app choose Anyone even anonymous, click Deploy. Copy and save somewhere the URL given to you in the following dialog: this is the URL of your script.

  4. Test the service by pasting the URL in a new tab of your browser and adding ?parameter=42. The service should respond <result>true</result>.

Now let's call the service from a form we create with Form Builder:

  1. In Form Builder, create a new form, create an input field, type a label and name it number, create and output field, type a label and name it even. Your form might look like:

  2. Define an HTTP service, by clicking on Add under HTTP Service in the sidebar. Name the service is-even, in Resource URL paste the URL from step 3 above. Under Serialization, choose HTML form. In Request Body enter <number/>.

  3. Define a action, by clicking on Add under Actions in the sidebar. Name it check-even, under React To choose Value Change, under Control choose number, in Service to call to choose is-even. In Set Service Request Values click the plus icon choose number and type /number, in Destination Control choose even and type /result.

  4. Test the form by clicking on the Test button. Type 42 and hit enter: the output next to it should show true. Type 43 and hit enter: similarly the output should show false.

Congratulations, you just created a service and a form calling that service, and all this without leaving your web browser.

Tuesday, December 4, 2012

Orbeon Forms 4.0 M18

Today we released Orbeon Forms 4.0 M18 (Milestone 18). Like 4.0 M17 and the previous milestones this is not a final release.
In this release, the following issues were addressed:
  • Form Builder
    • Form Builder should use logo specified in oxf.fr.default-logo.uri (#616)
    • Permissions dialog layout scrambled (#570)
    • Hover over button doesn't show proper button editor (#553)
  • Form Runner
    • FB summary page doesn't show app/form name for new forms with MySQL persistence layer (#611)
    • eXist persistence not to throw an error when the database is empty (#614)
    • Form Runner home page: message for no forms, include forms without permission (#94)
    • Don't highlight title on hover (#615)
    • Lots of CSS and cosmetic improvements
    • fr:number focus in/out loses formatting (#586)
    • Wizard: better navigation buttons
  • XForms engine
    • Server sets index of todo instead of list when re-adding first list (#591)
    • Non-visible dialog content should be non-relevant (#15)
    • Tooltip for a trigger hint in a dialog shows below the dialog (#620)
    • Add deferred flag to xf:rebuild/xf:revalidate actions
    • Move xforms.css to LESS
    • Refactoring of control bindings support
More information is available in the in-progress release notes for 4.0.

You can download the builds using these links:
Don't forget to grab a trial license for the PE version.

Please send feedback:

Form Runner Wizard View


One of the cool new features of Orbeon Forms 4.0 is the wizard view.

By default with Form Runner all the form sections appear in the same page, on top of each other. If your form is large that means that you have to scroll to fill out the entire form.

With the wizard view, top-level sections instead appear in a navigation area to the left, and only a single top-level section is shown at any given time.

You can navigate between sections by clicking on a section title, or you can use the navigation arrows.

Errors on your form appear at the bottom as usual, and sections that contain errors are highlighted in red. If you click on an error you are taken directly to the section and control containing the error.

The wizard view is optional - you can use the regular view instead, and you can enable this view per form, per app, or globally with a property:
<property
  as="xs:string"
  name="oxf.fr.detail.view.appearance.*.*"
  value="wizard"/>
We hope you enjoy this new feature!