Orbeon Forms
  • Getting started
  • Installation
    • Logging
    • Configuration banner
    • Docker
    • Azure
    • Tomcat
    • WildFly
    • WebSphere
    • WebLogic
    • GlassFish
    • Caches
    • Replication
    • Upgrading
  • Configuration
    • Properties
      • General
        • HTTP client
      • Form Runner
        • Detail page
          • Attachments
          • Email properties
          • PDF
          • Table of contents
        • Persistence
        • Summary page
      • Form Builder
      • XForms
    • Advanced
      • Workflows
      • Session management
      • State handling
      • Client-side error handling
      • Clustering and High Availability
      • Configuring a Form Runner eXist database
      • Creating a production WAR
      • Environments
      • JavaScript and CSS assets
      • Limiter filter
      • Run modes
      • Security
        • Content-Security-Policy header
      • SAP Hybris Module
      • XForms logging
    • Troubleshooting
      • Troubleshooting with the orbeon.log
      • Memory and threads
      • Relational database logging
      • Misc
  • Form Builder
    • Form settings
      • Time window
    • Form editor
      • Form area
      • Toolbox
      • Buttons bar
      • Control settings
      • Dependent fields and sections
      • Validation
      • Choices editor
      • Publishing
      • Cut, copy and paste
      • Section and grid settings
      • Section settings
      • Grid settings
      • Quick control search
      • Repeat settings
      • Repeated grids
      • Undo and redo
      • Keyboard shortcuts
    • Formulas
      • Examples of formulas
      • Formulas inspector
      • Formulas console
    • Summary page
    • Form localization
    • Advanced
      • Edit source
      • Services and actions
        • HTTP services
        • Database services
        • Simple Actions
        • Action Syntax
        • Action Syntax examples
        • Synchronizing repeated content
      • Testing a form in web mode
      • Testing PDF production
      • Testing offline functionality
      • Email Settings dialog
      • Field-level encryption
      • Messages
      • Section templates
      • Template syntax
      • XML Schemas support
      • Extensibility
        • Extension API
        • Integration
        • Toolbox component metadata
  • Form Runner
    • Overview
      • Terminology
    • Pages
      • Landing page
      • Published Forms page
      • Forms Admin page
      • Summary page
    • Components
      • Alert dialog
      • Attachment
      • Autocomplete
      • Captcha
      • Character counter
      • Checkbox input
      • Currency
      • Date
      • Dropdown date
      • Static and dynamic dropdown
      • Error summary
      • Grid
      • Handwritten signature
      • Hidden field
      • Image
      • Image annotation
      • Image attachment
      • Number
      • Open selection
      • Repeater
      • Formatted Text / Rich Text Editor
      • Section
      • Single-selection tree
      • Source code editor
      • Time
      • US phone
      • US state
      • Video
      • Video attachment
      • Wizard
      • XForms inspector
      • Yes/No answer
    • Features
      • Automatic calculations dependencies
      • Datasets
      • Excel and XML import
      • Excel and XML export
      • Summary page Excel Export
      • Form definitions and form data Zip Export
      • Purging historical data
      • Lease
      • Localization
      • Supported languages
      • Mobile support
      • Multitenancy
      • Form Runner navigation bar
      • PDF production
        • Automatic PDF
        • Automatic PDF header and footer configuration
        • PDF templates
      • Responsive design
      • Revision history
      • S3 storage
      • Simple data migration
      • TIFF production
      • Versioning
      • Wizard view
      • Workflow stage
    • Persistence
      • Using a relational database
      • Relational database schema
      • Purging old data using SQL
      • Auditing
      • Autosave
      • Database support
      • Flat view
    • Linking and embedding
      • Linking
      • Java Embedding API
      • JavaScript Embedding API
      • Liferay full portlet
      • Liferay proxy portlet
      • Securing Form Runner access
      • Form Runner offline embedding API
      • Angular component
      • React component
    • Access control and permissions
      • Users
      • Login & Logout
      • Deployed forms
      • Form fields
      • Editing forms
      • Owner and group member
      • Organizations
      • Scenarios
      • Token-based permissions
    • Styling
      • CSS
      • Grids CSS
      • Automatic PDF styling and CSS
    • APIs
      • Authentication of server-side service APIs
      • Persistence API
        • CRUD API
        • Search API
        • List form data attachments API
        • Form Metadata API
        • Lease API
        • Reindexing API
        • Caching
        • Versioning
        • Revision History API
        • Zip Export API
        • Custom persistence providers
      • Other APIs
        • Connection context API
        • Duplicate form data API
        • File scan API
        • Form Runner JavaScript API
        • Generate XML Schema API
        • PDF API
        • Publish form definition API
        • Run form in the background API
      • Data formats
        • Form data
        • Date and time
        • Form definition
    • Architecture and integration
      • Architecture
      • Access form data
      • Integration
    • Advanced
      • Buttons and processes
        • Simple process syntax
        • Core actions
        • Form Runner actions
          • Save action
          • Send action
          • Email action
        • XForms actions
        • Predefined buttons, processes and dialogs
        • Summary page buttons and processes
      • Custom dialogs/model logic
      • Services
      • Singleton form
      • Monitoring HTTP requests
  • XForms
    • Core
      • Attribute Value Templates (AVTs)
      • Binds
      • Validation
      • Variables
      • Keyboard focus
      • XForms JavaScript API
      • Error handling
        • Detailed behavior
      • Model-Bind variables
      • XForms 2.0 support
    • Events
      • Standard support
      • UI refresh events
      • Keyboard events
      • Extension events
      • Extension context information
      • Other event extensions
    • Actions
      • Repeat, insert and delete
      • Scripting actions
      • Extensions
    • Controls
      • Label, hint, help
      • Input
      • Output
      • Text area
      • Button
      • Upload
      • Dialog
    • Submission
      • Standard support
      • JSON support
      • Asynchronous submissions
      • Caching extension
      • Other submission extensions
    • XPath
      • Type annotations
      • Expression analysis
      • Tips
      • Compatibility
      • Standard functions
      • Maps and arrays Functions
      • Extension functions
        • Core functions
        • Utility functions
        • Model functions
        • Controls functions
        • XML functions
        • JSON functions
        • HTTP functions
        • Form Runner functions
        • Other functions
        • Deprecated functions
    • XBL components
      • FAQ
      • Guide
        • XBL Tutorial
        • Bindings
        • XForms models
        • Including content
        • Event handling
        • Conventions
        • Map XBL example
        • Learning from existing components
      • Advanced topics
        • XBL Modes
        • JavaScript companion classes
        • XBL library
        • Extensions
        • Attachment controls
    • XForms tutorial
      • Introduction
      • Installation
      • The Hello application
      • The Bookcast application
        • The basic app
        • Database access
        • Polishing the app
        • Adding a feed
    • Using XForms from Java apps
  • XML Platform
    • Page Flow Controller
      • Basics
      • XML submission
      • Navigating between pages
      • Paths and matchers
      • Other configuration elements
      • Typical combinations of page model and page view
      • Examples
      • Authorizing pages and services
    • Processors
      • URL generator
      • Request generator
      • PDF to image converter
    • Resources
      • Resource managers
      • Setting up an external resources directory
    • Other
      • Binary and text documents
  • FAQ
    • Licensing
    • PE and Dev Support
    • Form Builder and Form Runner
    • Resources and support
    • Other technical questions
  • Contributors
    • Automated tests
    • Building Orbeon Forms
    • Localizing Orbeon Forms
    • Validation functions
    • Contributor License Agreement
  • Release notes
    • Orbeon Forms 2022.1.9
    • Orbeon Forms 2024.1.1
    • Orbeon Forms 2023.1.7
    • Orbeon Forms 2024.1
    • Orbeon Forms 2023.1.6
    • Orbeon Forms 2023.1.5
    • Orbeon Forms 2021.1.11
    • Orbeon Forms 2022.1.8
    • Orbeon Forms 2023.1.4
    • Orbeon Forms 2023.1.3
    • Orbeon Forms 2023.1.2
    • Orbeon Forms 2022.1.7
    • Orbeon Forms 2023.1.1
    • Orbeon Forms 2023.1
    • Orbeon Forms 2022.1.6
    • Orbeon Forms 2021.1.10
    • Orbeon Forms 2022.1.5
    • Orbeon Forms 2021.1.9
    • Orbeon Forms 2022.1.4
    • Orbeon Forms 2022.1.3
    • Orbeon Forms 2021.1.8
    • Orbeon Forms 2022.1.2
    • Orbeon Forms 2022.1.1
    • Orbeon Forms 2022.1
    • Orbeon Forms 2021.1.7
    • Orbeon Forms 2021.1.6
    • Orbeon Forms 2021.1.5
    • Orbeon Forms 2021.1.4
    • Orbeon Forms 2021.1.3
    • Orbeon Forms 2021.1.2
    • Orbeon Forms 2021.1.1
    • Orbeon Forms 2021.1
    • Orbeon Forms 2020.1.6
    • Orbeon Forms 2019.2.4
    • Orbeon Forms 2019.1.2
    • Orbeon Forms 2018.2.5
    • Orbeon Forms 2018.1.4
    • Orbeon Forms 2020.1.5
    • Orbeon Forms 2020.1.4
    • Orbeon Forms 2020.1.3
    • Orbeon Forms 2020.1.2
    • Orbeon Forms 2019.2.3
    • Orbeon Forms 2020.1.1
    • Orbeon Forms 2020.1
    • Orbeon Forms 2019.2.2
    • Orbeon Forms 2019.2.1
    • Orbeon Forms 2019.1.1
    • Orbeon Forms 2019.2
    • Orbeon Forms 2019.1
    • Orbeon Forms 2018.2.4
  • Release history
  • Use cases
  • Product roadmap
  • Index of features
Powered by GitBook
On this page
  • Usage
  • Rationale
  • Property to enable
  • Generated names
  • View name
  • Metadata column names
  • Repetition column names
  • Data column names
  • Limitations
  1. Form Runner
  2. Persistence

Flat view

PreviousDatabase supportNextLinking and embedding

Last updated 3 months ago

Usage

Rationale

If you're using Oracle, SQL Server [SINCE Orbeon Forms 2016.2], DB2 [SINCE Orbeon Forms 4.7], PostgreSQL [SINCE Orbeon Forms 4.8], or MySQL , when you deploy a form created in Form Builder, Orbeon Forms can create a form-specific view of your data, with one column for each form field.

Property to enable

You enable this feature by setting the relevant property listed below to true.

Database
Property

Oracle

oxf.fr.persistence.oracle.create-flat-view

MySQL

oxf.fr.persistence.mysql.create-flat-view

SQL Server

oxf.fr.persistence.sqlserver.create-flat-view

PostgreSQL

oxf.fr.persistence.postgresql.create-flat-view

DB2

oxf.fr.persistence.db2.create-flat-view

For instance, if using Oracle, you set:

<property
    as="xs:boolean"
    name="oxf.fr.persistence.oracle.create-flat-view"
    value="true"/>

Generated names

View name

When you enable this property, upon publishing a form, the persistence layer creates a view specific to that form. The name of the view is based on the app name, form name, and [SINCE Orbeon Forms 2021.1] form version. It has the form:

[SINCE Orbeon Forms 2021.1] orbeon_f_#{app}_#{form}_#{form_version}
[UP TO Orbeon Forms 2020.1] orbeon_f_#{app}_#{form}

For instance, on Orbeon Forms 2021.1 and newer, if your app is hr, your form is expense, and you are publishing version 2 of that form, then the view is named orbeon_f_hr_expense_2. If upon publishing, there is already a view with that name, the persistence layer deletes it before recreating a new view.

orbeon_f_#{app}_#{form}_#{form_version}_#{repeated_section_or_grid}

Metadata column names

Each view always has one or more metadata columns, with information copied from the equivalent columns in orbeon_form_data. For views related to repeated sections or grids, only the metadata_document_id column is included.

  • [UP TO Orbeon Forms 4.3]

    • metadata_document_id

    • metadata_created

    • metadata_last_modified

    • metadata_username

  • [SINCE Orbeon Forms 4.4]

    • metadata_document_id

    • metadata_created

    • metadata_last_modified_time

    • metadata_last_modified_by

Repetition column names

#{repeated_section_or_grid}_repetition

Data column names

In addition to the metadata and repetition columns, one column is created for each form field. Each column is named using the control name, optionally prefixed with enclosing section/grid names. See below for details on how column names are generated depending on the version of Orbeon Forms you are using.

As databases limit the length of column names, the persistence layer truncates them if needed. It also converts dashes to underscores, and removes any non-alphanumeric character except inner underscores.

With Orbeon Forms 2024.1 and newer

By default, the column names are generated using the control names only, unless they are located in a section template, in which case they will be prefixed with the name of the template section.

To get the previous behavior (Orbeon Forms 2023.1 and earlier), where the names of all enclosing sections/grids are included in the column names, the following property can be changed from false to true:

<property
  as="xs:boolean"
  name="oxf.fr.persistence.[provider].flat-view.prefixes-in-main-view-column-names"
  value="false"/>

This property doesn't affect column names in views for repeated sections and grids. In those views, the names of enclosing sections/grids are never included in the column names.

In previous versions, column names were always truncated to 30 characters. With Orbeon Forms 2024.1 and newer, they are now truncated to a number of characters which depends on the database used. Those limits are defined in properties, which can be overridden if needed:

<property
  as="xs:integer"
  name="oxf.fr.persistence.oracle.flat-view.max-identifier-length"
  value="128"/>
<property
  as="xs:integer"
  name="oxf.fr.persistence.mysql.flat-view.max-identifier-length"
  value="64"/>
<property
  as="xs:integer"
  name="oxf.fr.persistence.postgresql.flat-view.max-identifier-length"
  value="63"/>
<property
  as="xs:integer"
  name="oxf.fr.persistence.db2.flat-view.max-identifier-length"
  value="128"/>
<property
  as="xs:integer"
  name="oxf.fr.persistence.sqlserver.flat-view.max-identifier-length"
  value="128"/>

With Orbeon Forms 4.5 and newer

Orbeon Forms 4.5 introduces a new truncation algorithm so names are not cut short unnecessarily, and a numerical suffix is used instead for those columns which would introduce duplicates.

Examples:

  • Section name: personal-information

    • Control name: first-name ⇒ column name: personal_informatio_first_name

    • Control name: last-name ⇒ column name: personal_information_last_name

    • Control name: address ⇒ column name: personal_information_address

  • Section name: company

    • Control name: name ⇒ column name: company_name

    • Control name: industry ⇒ column name: company_industry

  • Section name: section-with-long-name

    • Control name: my-control-with-a-pretty-long-name ⇒ column name: section_with_l_my_control_with

    • Control name: my-control-with-a-pretty-long-name-too ⇒ column name: section_with_l_my_control_wit1

    • Control name: my-control-with-a-pretty-long-name-really ⇒ column name: section_with_l_my_control_wit2

Enclosing section and grid names are always included in the column names. A truncation limit of 30 characters is enforced.

With Orbeon Forms 4.4 and earlier

The section name is truncated to 14 characters, the control name to 15 characters, and both are combined with an underscore in between. In the vast majority of the cases, this will result in distinct and recognizable column names. In cases where two or more columns would end up having the same name or conflict with one of the metadata column, the persistence layer adds a number prefix of the form 001_, 002_, 003_… to each column to make it unique. If this happens, you might want to change your section and/or control names to have more recognizable column names.

Examples:

Section name
Control name
Column name

personal-information

first-name

PERSONAL_INFOR_FIRST_NAME

last-name

PERSONAL_INFOR_LAST_NAME

address

PERSONAL_INFOR_ADDRESS

company

name

COMPANY_NAME

industry

COMPANY_INDUSTRY

Limitations

  • With MySQL, fields within repeated sections or grids are not supported. This is because the MySQL built-in XML function ExtractValue() is quite limited and does not directly support returning multiple rows from a single XML document.

  • Flat views are not supported at all with SQLite.

  • [SINCE Orbeon Forms 2016.1] Fields inside nested sections and nested section templates are supported.

One extra view will be created for each repeated section and grid, if any. In that case, the view name will be suffixed with the name of the repeated section or grid.

Note that there is no metadata_draft column, as drafts are not included the view. (Before 4.7 they were, incorrectly, see .)

For repeated sections and grids, the view includes the repetition number for the current repeated section or grid, as well as for any enclosing repeated section. The column names are generated as follows:

The Multiple File Attachments control is not supported, see .

Only the default is supported, see .

Fields inside repeated sections or grids are also supported.

[SINCE Orbeon Forms 2024.1]
[SINCE Orbeon Forms 2024.1]
issue 1870
[SINCE Orbeon Forms 2024.1]
issue 6296
form data format
issue 4440
[SINCE Orbeon Forms 2024.1]