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:
Other properties depend on the resource manager defined by the factory. These properties are described in the following sections.
Filesystem resource manager
Configuration
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.
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.
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.
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.
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.