Documentation Center

Use of parameters in configuration files

In Content Delivery configuration files, parameters are sometimes used inside quoted strings. A parameter has a specific format and some constraints, and is an alternative to literal or hardcoded strings for configuration values.

Content Delivery configuration files have many quoted strings to provide configuration values. Some of these quoted strings have been replaced with parameters of the following supported formats:

FormatDescription
${PROPERTYNAME:-DEFAULT}Use environment variable or Java System Property named variable, where PROPERTYNAME is the name, and where DEFAULT is the value to use if no environment variable or Java System Property is set.
${PROPERTYNAME:-DEFAULT:-*HIDDEN*}Same as above, but the value will not be logged in the debug logs.
${PROPERTYNAME:-*HIDDEN*}Use environment variable or Java System Property named variable, where PROPERTYNAME is the name, which needs to be specified at install or startup, but the value will not be logged in the debug logs.
${PROPERTYNAME}For these parameters, you need to specify values at install or startup since no default value is provided

When working with the Content Delivery configuration files that use parameters, you should be aware of the following:

  • Some values in the Content Delivery sample configuration files are already parameterized. Such values are recognizable in configuration files due to the specific formats supported for parameters. For example you can find parameters using the sample files for Storage Layer configuration, cd_storage_conf.xml. Some examples are:
    • ${discoveryurl:-http://localhost:8082/discovery.svc}
    • ${systempassword:-changeme:-*HIDDEN*}
    • ${systempassword:-*HIDDEN*}
  • When there are parameters used in your configuration files, you can supply configuration values at run or install time in one of three ways. If there is no default supplied with a parameter, as is the case with a parameters of the format ${PROPERTYNAME} or ${PROPERTYNAME:-*HIDDEN*}, then you need to supply the value at in one of these three ways:
    • set it as a system environment variable
    • define it in the Java Virtual Machine options, using the D switch
    • define it on a command prompt when running a PowerShell or Linux installation script or, using the D switch.
  • In theory, any quoted string in a Content Delivery configuration file can be replaced with a parameterized value. For example, in a Storage Layer configuration file, cd_storage_conf.xml, the default attribute for the namespace element in literal form is <Namespace default="tcm">. Instead the literal quoted string "tcm" is replaced by "${namespaceprefix:-tcm}", that uses the namespaceprefix parameter with a prefix. Here are the constraints for parameters:
    • the variable name cannot contain the characters :- or }
    • The default value cannot contain the characters :- or }
    • The :-*HIDDEN* modifier must be the last one if used with a default value
    • You can not parameterize these configuration files
      • logback.xml
      • cd_client_conf
      • web.xml
      • web.config.
  • Values are picked up with the following order (highest priority wins)
    1. set on command line
    2. Java System Property
    3. environment variable
    4. default as set in the config file