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 configurations.
System properties and environment variables can be used in Cadenza variables.
Defining and Setting Cadenza Variables
Cadenza variables can be defined in variables.xml, as YAML code, and as environment variables, as in the following examples:
-
Multi-File XML
-
Single-File YAML
-
Environment Variables
variables.xml configuration file<variables>
<variable name="REPOSITORY_BASE_PATH">$SYSTEM{REPOSITORY_BASE_PATH}{./repository}</variable>
...
</variables>
myConfig.yamlcadenzaconfig:
...
variables:
- name: REPOSITORY_BASE_PATH
value: $SYSTEM{REPOSITORY_BASE_PATH}{./repository}
...
cadenzaconfig_variables_0_name=REPOSITORY_BASE_PATH
cadenzaconfig_variables_0_value=$SYSTEM{REPOSITORY_BASE_PATH}{./repository}
The following applies:
-
value: Value of the variable. Environment variables and system properties ($SYSTEM) can be used. -
name: Name of the variable
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
Cadenza variables can be used in all configuration settings, with the exceptions of activating plugins and the variables configuration itself.
Example for using in a configuration file.
geocoder-config.xml<geocodingService id="poi">
...
<server>
<url>$VAR{GEOCODER_URL}</url>
...
</server>
</geocodingService>