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
          • 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
      • 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
  • Introduction
  • General configuration
  • Filesystem resource manager
  • Configuration
  • Example
  • ClassLoader resource manager
  • Configuration
  • Example
  • WebApp resource manager
  • Configuration
  • Example
  • URL resource manager
  • Configuration
  • Example
  • Priority resource manager
  • Configuration
  • Examples
  1. XML Platform
  2. Resources

Resource managers

Introduction

A resource manager is an Orbeon Forms component responsible for reading and writing XML and other resources like binary and text documents. A resource manager abstracts the actual mechanisms used to store resources. An important benefit of using such an abstraction is that it is possible to store all your application files in a sandbox which can be moved at will within a filesystem or between storage mechanisms. For instance, resources can be stored:

  • As files on disk (using your operating system's file system)

  • As resources within a WAR file

  • As resources within one or more JAR files

A resource manager is both used:

  • Internally by Orbeon Forms

  • By your own Orbeon Forms applications through URLs with the oxf: protocol

This page describes the different types of resource managers and explains their configuration.

General configuration

A single resource manager is initialized per Orbeon Forms web application. Configuration is handled in the web application descriptor (web.xml) by setting a number of context parameters. The first parameter indicates the resource manager factory:

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value>
</context-param>

Other properties depend on the resource manager defined by the factory. These properties are described in the following sections.

Filesystem resource manager

Configuration

Purpose

Loading resources from a filesystem

Factory

org.orbeon.oxf.resources.FilesystemResourceManagerFactory

Properties

oxf.resources.filesystem.sandbox-directory

The filesystem resource manager loads resources from a filesystem. This is especially useful during development, since no packaging of resources is necessary. The oxf.resources.filesystem.sandbox-directory property can be used to define a sandbox, and if used must point to a valid directory on a filesystem. If not specified, no sandbox is defined, and it is possible to access all the files on the filesystem.

Using the filesystem resource manager without a sandbox is particularly useful for command-line applications.

Example

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.filesystem.sandbox-directory</param-name>
    <param-value>/home/user/oxf/myapp/resources</param-value>
</context-param>

ClassLoader resource manager

Configuration

Purpose

Loading resources from a JAR file in the classpath

Factory

org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory

Properties

None

The class loader resource manager can load resource from a JAR file or from a directory in the classpath. This resource manager is required to load internal resources for Orbeon Forms.

Example

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value>
</context-param>

WebApp resource manager

Configuration

Purpose

Loading resources from a WAR file or deployed Web Application

Factory

org.orbeon.oxf.resources.WebAppResourceManagerFactory

Properties

oxf.resources.webapp.rootdir

This resource manager is useful when you want to package an application into a single WAR file for distribution and deployment. The configuration property indicates the path prefix of the resources directory inside a WAR file. It is recommended to store resources under the WEB-INF directory to make sure that the resources are not exposed to remote clients.

Example

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory
</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.webapp.rootdir</param-name>
    <param-value>/WEB-INF/resources</param-value>
</context-param>

URL resource manager

Configuration

Purpose

Loading resources from a URL

Factory

org.orbeon.oxf.resources.URLResourceManagerFactory

Properties

oxf.resources.url.base

This resource manager is able to load resources form any URL (typically http or https). It can be used if your resources are located on a web server or a content management system with an HTTP interface.

Example

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.URLResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.url.base</param-name>
    <param-value>http://www.somwhere.com/base/</param-value>
</context-param>

Priority resource manager

Configuration

Purpose

Chains several resource managers in order

Factory

org.orbeon.oxf.resources.PriorityResourceManagerFactory

Properties

oxf.resources.priority.1 … oxf.resources.priority.n

With the priority resource manager you can chain several resource managers. It is crucial to be able to load resources from multiple sources since some resources are bundled in the Orbeon Forms JAR file. Thus, the class loader resource manager must always be in the priority chain. It usually has the lowest priority so the application developer can override system resources.

There can be any number of chained resource managers. They are configured by adding a oxf.resources.priority.n property, where n is an integer.

NOTE: The priority resource manager is more efficient when most resources are found in the first resource manager specified.

Examples

Configuration from Orbeon Forms 2016.3 to 2019.2

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2</param-name>
    <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2.oxf.resources.webapp.rootdir</param-name>
    <param-value>/WEB-INF/resources</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.6</param-name>
    <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value>
</context-param>

With Tomcat, you can add local resources by adding the following to the context configuration:

<Parameter
    override="false"
    name="oxf.resources.priority.0"
    value="org.orbeon.oxf.resources.FilesystemResourceManagerFactory"/>
<Parameter
    override="false"
    name="oxf.resources.priority.0.oxf.resources.filesystem.sandbox-directory"
    value="$PATH_TO_ORBEON/resources-local"/>

where $PATH_TO_ORBEON must be updated to point to your Orbeon Forms source directory.

Production configuration as of Orbeon Forms 4.10

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2</param-name>
    <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2.oxf.resources.webapp.rootdir</param-name>
    <param-value>/WEB-INF/resources</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.4</param-name>
    <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value>
</context-param>

Configuration for developers as of Orbeon Forms 4.10

<context-param>
    <param-name>oxf.resources.factory</param-name>
    <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.0</param-name>
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.0.oxf.resources.filesystem.sandbox-directory</param-name>
    <param-value>/Users/orbeon/Orbeon/OF/src/resources-local</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.1</param-name>
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.1.oxf.resources.filesystem.sandbox-directory</param-name>
    <param-value>/Users/orbeon/Orbeon/OF/src/resources</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.3</param-name>
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.3.oxf.resources.filesystem.sandbox-directory</param-name>
    <param-value>/Users/orbeon/Orbeon/OF/src/resources-packaged</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.5</param-name>
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.5.oxf.resources.filesystem.sandbox-directory</param-name>
    <param-value>/Users/orbeon/Orbeon/OF/src/test/resources</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2</param-name>
    <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.2.oxf.resources.webapp.rootdir</param-name>
    <param-value>/WEB-INF/resources</param-value>
</context-param>
<context-param>
    <param-name>oxf.resources.priority.4</param-name>
    <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value>
</context-param>
PreviousResourcesNextSetting up an external resources directory

Last updated 5 years ago