Orbeon PresentationServer is an open source development platform for building form-based applications. OPS 3.0 makes it easy to build web forms by bringing standard W3C XForms to mainstream browsers thanks to user-friendly Ajax technology. It deploys to any Servlet container.

While a W3C standard for about two years, XForms has so far not managed to become widespread. There are probably several reasons for this, including the lack of native support in web browsers. However, with the XForms efforts in Firefox coming along nicely, and new open source Ajax-based XForms implementations able to provide XForms support to mainstream browsers, we think that the time for XForms has come.

With its declarative approach and features that cover many of the needs for dynamic user interfaces implemented today with bare-metal Ajax, XForms provides a serious alternative to both traditional heavy-weight development in Java and lightweight scripting alternatives such as PHP, Ruby, and Python.

Currently OPS only generates (X)HTML, but the architecture is in fact quite open, and while we are not thinking about supporting Swing at this point, we are thinking about plain (non-Ajax) HTML support, which of course would mean that the UI would not be as responsive as it is with the current Ajax support. But as a fallback mechanism, it would certainly be good enough.

OPS deploys as a WAR, and you can integrate with your own app in multiple ways: generating XForms from JSP or Servlet output capture, to a Servlet forwarding a request to the OPS Servlet, etc. We are also thinking about an out-of-the-box proxy mode, but that's for the future.+

It is of course also possible to use OPS functionalities directly: they make it easy to either serve static XHTML + XForms files, or dynamically generated with XSLT. Note that an XForms page can also integrate with an existing application through the mechanism of XML submission, which just requires that your own app (Java, PHP, anything) be able to serve an XML document which XForms then integrates into its execution model.

I have a set of interlinked XML Schemas defining the set of acceptable XML documents. I can use a standard XML editor (XmlSpy) create edit and validate XML documents from those Schema, including indicating which elements are required/optional at every position in the XML document.

What is a suitable strategy for using those XML Schema with OPS to create valid documents?

XForms supports validation of XForms instances (i.e. the XML documents that serve as XForms' data model) with XML schema. That's a first step. Now to actually edit the XForms instance with XForms, you need to create XForms controls (input fields, repetitions, etc.). XForms does not have built-in facilities to generate controls dynamically. However, many have been looking at generating them based on a schema definition, and in theory, this is quite possible, although you probalby need annotations to tell how to represent certain types of data.

So the answer is that if you write your controls manually, certainly. If you write a tool to automate the generation of the controls, certainly as well.

The bottom line is that in these two cases, XForms can be used as an editor for XML documents.

XML Schema validation will check in the end that the document is valid before submitting it.

Then you would expect to be able to edit a "LuckyNumbers" XML document via XForms by adding/removing/editing the "number" elements. And in principle XForms allows you to do that, and OPS provides beautiful UI elements to view the table of "number"s and add/remove lines from that table.

*However*, the nasty detail is that XForms can only add an element to such a collection by *cloning* an existing element (a template). I.e. when the "LuckyNumbers" XML document is loaded into the XForms player it must already contain *at least one* "number" otherwise you won't be able to add any. In addition, when the edited XML document is validated by the XForms player against the XML-schema, the template element is validated as well (after all, it's part of the "number"s collection), and unless it contains a valid number that validation will fail.

The obvious solution is to create/remove a template element to each and every collection of elements before/as the XML document is loaded into the XForms player, and then somehow remove them again before the XML document is validated by the player. But somehow this spoiled the beauty of the approach for me...

You will be happy to know that this is the case with XForms 1.0, but in XForms 1.1 (draft) you can copy templates from anywhere. You can therefore have a series of templates (even in other instances) and copy them as you wish, and have much more flexibility with repetitions. We use this extension with the DMV Forms example, and this approach solves not only the question of empty repeats but also that of validation.

You have to realize that XForms is final in its version 1.0, but that the Working Group is working on the upcoming versions, in particular XForms 1.1 which will address feedback from implementors and users of 1.0.

Just a note here. A similar product is Chiba (http://chiba.sourceforge.net/). To provide what you are asking for it comes with a tool and API for creating XForms from XML Schemas. I'd look at it, if only for ideas.

Though, I'd go for a XSLT transformation with some annotations as mentioned here :)

The last time I used it (I think OPS 3.0 beta 2) it was very slow and used very much memory. For every request (to one of their demos, don't know which one) I made the CPU was spinning at 100% for several seconds (for 1 concurrent user). There were plans at that time to rewrite a major portion on code, but that experience made me think that maybe that xml-based approach just is not suitable to applications where you cannot cache the output of some pipelines and might possibly have quite a few concurrent users. I then took a look on apache cocoon, but in the end I ended up using Spring (because the xml based approach was not sellable to my management, but that is another story...)

How is the OPS 3.0 performance today (Average processing time and memory footprint per concurrent user of one of the more complex demos)?

We do not have numbers ready for you as we are not sure there is a typical use case which is typical or representative. BTW do other open source platforms provide such numbers? If so I would be interested in hearing about how they go about providing them.

In our opinion the best thing to do is to download OPS and do your own performance testing based on a prototype you think is representative of your own use cases. Forms can be of various complexity: they can have few controls and very large XML instances; they can have many controls but not that big XML instances. They can do complex validation or not. Etc.

We did rewrite natively a good portion of the new XForms engine before 3.0, and performance has become much better. Certainly, it doesn't take seconds to produce one page!

We also provide out of the box two options for state handling: client-side and server-side (session), both helped with a cache. The benefits and drawbacks of these two options are described in the OPS doc:

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.