Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This page describes the enhanced/reloadable configuration feature, based on Apache Commons Configuration, which has been submitted for possible inclusion in DSpace 6.

Overview

In DSpace 5 or below, DSpace used it's own custom Property-based configuration scheme, along with a custom build.properties which could tweak the build/compilation process in order to "override" some pre-selected configurations in the dspace.cfg file.  While this configuration scheme "worked" at a basic level, it required a lot of custom variable interpolation (i.e. filtering) to occur in both the Maven build process (mvn package) and the Ant install process (ant fresh_install or ant update).  The end result was that configuration files in your DSpace installation directory ([dspace]) contained the correct settings from your build.properties file, but all variables (${setting}) were filled out. So, it was no longer possible to easily tweak certain key settings (like dspace.dir or solr.server) without having to either re-run the entire build process or make corrections to several files at once.

Enter Apache Commons Configuration.

The Enhanced Configuration Scheme feature uses Apache Commons Configuration as the new configuration scheme for DSpace. This provides several key advantages over our old, custom configuration scheme:

  • Apache Commons Configuration is a well-established Java library whose goal is to make configuration more flexible and easier to manage.
  • It automatically interpolates all settings at runtime. This means we no longer need to replace variables (${setting}) within our configurations. They will be auto-determined at runtime based on the value of that variable within one of the configuration files For more on variable interpolation see its Basic Features docs
  • It is a flexible configuration scheme. It can read configurations from several sources at once, including Properties files, XML config files and even database tables (see its Overview docs).  Currently, in the DSpace Enhanced Configuration Scheme we are still only using Properties files, similar to DSpace 5 and below. But, we now be able to easily move all or some configurations to XML configs or database config tables.
    • The locations of the configuration sources can be easily customized by DSpace administrators in a new config-definition.xml file, which configures Apache Commons Configuration for DSpace. More on that below.
  • It allows for easy overriding of configuration values from other sources. How the overrides occur is up to how you've configured Apache Commons Configuration.  For DSpace, we have a new config-definition.xml which defines the following override scheme (again, this can be easily tweaked for local needs):
    • If a setting is specified in Java System Properties (e.g. -D[setting]=[value]), it overrides the same setting found in any below location
    • If a setting is specified as an Environment Variable, it overrides the same setting found in any below location
    • If a setting is specified in the new local.cfg configuration file, it overrides the default value in any below location
    • Default values for all settings are specified in the dspace.cfg and the modules/*.cfg configuration files.
  • It supports enhanced Properties files.  This means our dspace.cfg , local.cfg and other configuration files can now immediately support some enhanced options, including:
    • The ability to easily include other configuration files via: "include=[config-file-location]"
    • The ability to provide multiple values to a list by specifying a setting multiple times (rather than creating a giant comma separated configuration on multiple lines). For example, enabling both LDAP and Password authentication could be done via:
      • plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.LDAPAuthentication
      • plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication
  • More information can also be found in the Apache Commons Configuration v1.10 User Guide
  • No labels