Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update all links to point to Commons Config v2

...

All DSpace *.cfg files use the Apache Commons Configuration properties file syntax.  This syntax is very similar to a standard Java properties file, with a few notable enhancements described below.

...

Additional examples of escaping special characters are provided in the documentation of the Apache Commons Configuration properties file syntax.

Specifying Multiple Values for Properties

Because DSpace supports the Apache Commons Configuration properties file syntax, it is much easier to specify multiple values for a single setting. All you have to do is repeat the same property name multiple times in the same *.cfg file.

...

Additional examples of creating lists or arrays of values are provided in the documentation of the Apache Commons Configuration properties file syntax.

Including other Property Files

Because DSpace supports the Apache Commons Configuration properties file syntax, it also can include/embed property files within other property files by using the "include=" setting.

...

Configuration Scheme for Reloading and Overriding

Note
titleKnown limitations to reloadable configurations

While In DSpace 6.0, while the DSpace API supports dynamically reloading configurations, the user interfaces (e.g. XMLUI and JSPUI) or machine interfaces may still cache some configuration settings.  This means that while the API layer may reload a new value, that new value may not always affect/change the behavior of your user interface (until you restart Tomcat).

Also, please be aware that all DSpace configuration values loaded into Spring beans (for example configurations that appear in Spring XML configuration files or in @Value annotations) are cached by Spring. This is something we are working to correct in future versions of DSpacemeans that they will not be reloadable within Spring beans until Tomcat is restarted.

Because DSpace supports the Apache Commons Configuration, its configurations can now be reloaded without restarting your servlet container (e.g. Tomcat). By default, DSpace checks for changes to any of its runtime configuration files every 5 seconds. If a change has been made, the configuration file is reloaded. The 5 second interval is configurable in the config-definition.xml (which defines the configuration scheme DSpace uses).

...

Both of these features are defined in DSpace's default "configuration scheme" or "configuration definition" in the [dspace]/config/config-definition.xml file. This file defines the Apache Commons Configuration settings that DSpace utilizes by default. It is a valid "configuration definition" file as defined by Apache Commons Configuration. See their Configuration Definition File Documentation for more details.

You are welcome to customize the config-definition.xml to customize your local configuration scheme as you see fit.  Any customizations to this file will require restarting your servlet container (e.g. Tomcat).

...

  • Configuration File Syntax/Sources: All DSpace configurations are loaded via Properties files (using the Configuration File Syntax detailed above)
    • Note: Apache Commons Configuration does support other configuration sources such as XML configurations or database configurations (see its Overview documentation).  At this time, DSpace does not utilize these other sorts of configurations by default. However, it would be possible to customize your local config-definition.xml to load settings from other locations.
  • Configuration Files/Sources: By default, only two configuration files are loaded into Apache Commons Configuration for DSpace:
    • local.cfg (see The local.cfg Configuration Properties File documentation below)
    • dspace.cfg (NOTE: all modules/*.cfg are loaded by dspace.cfg via "include=" statements at the end of that configuration file. They are essentially treated as sub-configs which are embedded/included into the dspace.cfg)
  • Configuration Override Scheme: The configuration override scheme is defined as follows. Configurations specified in earlier locations will automatically override any later values:
    • System Properties (-D[setting]=[value]) override all other options
    • Environment Variables
    • local.cfg
    • dspace.cfg (and all modules/*.cfg files) contain the default values for all settings.
  • Configuration Auto-Reload: By default, all configuration files are automatically checked every 5 seconds for changes. If they have changed, they are automatically reloaded.

For more information on customizing our default config-definition.xml file, see the Apache Commons Configuration documentation on the configuration definition file. Internally, DSpace simply uses the DefaultConfigurationBuilder class provided by Apache Commons Configuration to initialize our configuration scheme (and load all configuration files).

Info
titleCustomizing the default configuration scheme

Because the config-definition.xml file is just a Configuration Definition file for Apache Commons Configuration, you can also choose to customize the above configuration scheme based on your institution's local needs. This includes, but is not limited to, changing the name of "local.cfg", adding additional configuration files/sources, or modifying the override or auto-reload schemes.  For more information, see the Configuration Definition File Documentation from Apache Commons Configuration.

...