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.
- In a .properties file:
PROPERTYNAME=${PLACEHOLDERNAME:} - In an XML configuration file:
<ELEMENTNAME ATTRNAME="${PLACEHOLDERNAME}"/>
- 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
- 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
- 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.
- Editing the configuration file directly
- In the configuration file itself, you can replace the entire placeholder string with an actual value.
- 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.