Thursday, February 20, 2014

Form versioning

What versioning does

Form versioning is an important new feature in Orbeon Forms 4.5. In the past, Orbeon Forms was only keeping track of one form definition for every published form. This meant that if you republished a form, the previous form definition was overwritten. It also meant that when showing data, Orbeon Forms was always using the latest published version of the form definition. However, there were cases where this could lead to unexpected results, as fields might have been added or removed in the new form definition, which means that some values could either not be shown, or would be missing when using a newer version of the form definition.

Starting with Orbeon Forms 4.5, publishing a form definition doesn't overwrite any previously published one, but creates a new version. Also, Orbeon Forms now keeps track of the version of the form definition that was used when creating data, so it can use the same version in the future when that piece of data is edited, viewed, printed, etc.

This feature will be available in Orbeon Forms 4.5, and can be used with all the supported relational databases (Oracle, MySQL, and DB2). At this point, it isn't supported with the eXist database. For relational databases it uses columns that were already added in version 4.4, but were still unused at the time; so if you are upgrading from 4.4, the changes to the schema are relatively minor: there are none on DB2, and only minor DDL changes for Oracle and MySQL.

Data migration

The idea of data migration is to automatically update data created with an older version of the form definition to match the format of a newer form definition. It's obviously not something that you always want to happen, but there are cases when migrating data makes sense. For now, Orbeon Forms 4.5 doesn't do any data migration: editing, viewing, printing, etc of saved data is always done using the same version of the form definition used when that data was initially created. However we do have ideas on how to migrate data, for the cases where this would be desirable, and it might be something future versions of Orbeon Forms might do.

The summary page

The summary page for a form only uses the latest version of the form definition. In particular, this means that there will be additional columns in the table only for fields you marked as show in summary in the last version of the form definition. (Similarly, the summary page will show search fields only for fields marked as show in search in the last version.) In some case, this behavior isn't optimal, as you might have fields marked as show in summary in the last version that didn't exist in earlier versions, and vice versa, fields that were marked as show in summary in earlier versions and that aren't in the last version. A row in the summary page for data created with such an older version will show an empty cell in the corresponding column in the former case, and no data, since there is no corresponding column, in the latter case. This is something that we're planning to improve.

No comments:

Post a Comment