Cadenza Variables

You can use Cadenza variables to store any character strings that are required multiple times centrally for a Cadenza installation, for example URLs or paths to data sources. The variables can then be used in most configuration files.

The following applies: System properties and environment variables can be used in Cadenza variables.

Defining and Setting Cadenza Variables

Cadenza variables can be defined in the variables.xml configuration file using the <variable> element as in the following example:

<var:variables xmlns:var="http://www.disy.net/cadenza/variable/schema">
  <var:variable name="REPOSITORY_BASE_PATH" description="Pfad zum Repository">$SYSTEM{REPOSITORY_BASE_PATH}{./repository}</var:variable>
  ...
  <var:variable name="GEOCODER_URL">https://geocoding.gdi.disy.net/</var:variable>
</var:variables>

The following applies:

  • <variable>: Value of the variable. Environment variables and system properties ()$SYSTEM) can be used.

    • name: Name of the variable

    • description (optional): Description of the variables

If configured correctly, the variables are evaluated from the next restart.

Using Cadenza Variables: Syntax

Cadenza variables can be used with the following syntax:

$VAR{variable}{optional_default_value}`

The specification of a default value is optional. If the variable has no value or is not defined and no default value is specified, a warning is logged.

Using Cadenza Variables in Files

Cadenza variables can be used in configuration files (exceptions: cadenza-web-config.xml, variables.xml) in the repositoryList.xml file for the content of all elements in the <databaseRepository> block

Example for using in a configuration file (here: geocoder-config.xml)

<geocodingService id="poi">
  ...
  <server>
    <url>$VAR{GEOCODER_URL}</url>
    ...
  </server>
</geocodingService>