Documentation Center

Placeholders in Content Delivery configuration files

Content Delivery configuration files contain placeholders: strings enclosed in ${ and } delimiters. To configure settings in a containerized setup, you resolve these placeholders. You can resolve placeholders in several ways.

Appearance

Placeholders can appear in a configuration file with or without a default value.

Without a default value, a placeholder appears as follows:
  • In a .properties file: PROPERTYNAME=${PLACEHOLDERNAME:}
  • In an XML configuration file: <ELEMENTNAME ATTRNAME="${PLACEHOLDERNAME}"/>
With a default value, a placeholder appears as follows:
  • In a .properties file: PROPERTYNAME=${PLACEHOLDERNAME:DEFAULTVALUE}
  • In an XML configuration file: <ELEMENTNAME ATTRNAME="${PLACEHOLDERNAME:-DEFAULTVALUE}"/>

The default value is assigned as the value if you fail to resolve the placeholder.

Examples

Here are some examples of placeholders being used:
  • In a .properties file: addon.client.timeout=${addonclienttimeout:500}
  • In a .properties file: state.store.cleanup.cron=${statestorecleanupcron:}
  • In an XML file: <DiscoveryService ServiceUri="${discoveryurl:-http://localhost:8082/discovery.svc}"/>
  • In an XML file: <Storage Type="persistence" Id="defaultdb" dialect="${dbtype}" Class="com.tridion.storage.persistence.JPADAOFactory">

Resolving a placeholder

Resolving a placeholder means providing a value to use instead of the placeholder string (other than the default value, if one is given). There are multiple ways of resolving a placeholder:
Defining a Java property
Define a Java property (either programmatically or in a .properties file) with the same name as the placeholder, and set it to your preferred value.
For example, given the line <Storage Type="persistence" Id="defaultdb" dialect="${dbtype}" Class="com.tridion.storage.persistence.JPADAOFactory">, a .properties file containing the line dbtype=mssql ensures that the value of the dialect attribute in the second example will be set to the value mssql.
Editing the configuration file directly
In the configuration file itself, you can replace the entire placeholder string with an actual value.
For example, opening the configuration file containing the second example element and replacing dialect="${dbtype}" with dialect="mssql" ensures that the value of the dialect attribute in the second example is set to the value mssql.
Setting an environment variable
In the operating system on the machine that contains the configuration file, you can declare an environment variable with the same name as the placeholder, and set it to your preferred value.
For example, the Windows command SET dbtype=mssql ensures that the value of the dialect attribute in the second example will be set to the value mssql.