About parameters in the Content Delivery Storage Layer configuration
Rather than providing hardcoded values in your Storage Layer configuration file, cd_storage_conf.xml, you can specify strings of the format ${PROPERTYNAME} instead, where PROPERTYNAME is the name of an environment variable or of a property that can have a default value and whose value can be set when you are run or install a service that uses the Storage Layer configuration file.
When parameters are used in configuration files you not only have placeholders, you can also specify a default values and/or ensure the value will not be logged in the debug logs.
| Format | Description |
|---|---|
${PROPERTYNAME:-default} | Use environment variable or Java System Property named variable, and if not defined, use this default value. |
${PROPERTYNAME:-default:-*HIDDEN*} | Use environment variable or Java System Property named variable, and if not defined, use this default value, but do not log the value in the debug logs |
${PROPERTYNAME:-*HIDDEN*} | Use environment variable or Java System Property named variable, but do not log the value in the debug logs |
${PROPERTYNAME} | For these parameters, you need to specify values at startup since no default value is provided |
Values can be set in different ways
Storage element as follows:
<Storage Type="persistence" Id="defaultdb" dialect="${dbdialect}" Class="com.tridion.storage.persistence.JPADAOFactory">
${PROPERTYNAME} indicates that you should supply the value for this property at startup or install time. In this example, you can supply the dialect attribute in one of the following ways :
- as a system environment variable
- define it in the Java Virtual Machine options
- define it on the command prompt.
- Setting property-value pairs as environment variables
-
In Unix, use the
exportcommand to create environment variables with the names you specified in cd_storage_conf.xml, and then give them the right value in each context.For example, the following Unix command creates an environment variable calleddbdialectand gives it the valueORACLESQL:export dbdialect="ORACLESQL"In Windows, you can specify environment variables and their values in the Windows Control Panel in the Advanced tab of the System Properties screen.
- Setting property-value pairs in your Java Virtual Machine options
-
You can use the
-Dswitch to set a property and its value in your startup script's Java Virtual Machine (JVM) options, a sequence of settings calledJVM_OPTIONSin Unix or$jvmoptionsin Windows.For example, in addition to setting memory size and the like for the Java Virtual Machine, this Bash script definition for JVM options also sets a propertydbdialectto the valueORACLESQL:JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -Ddbdialect=ORACLESQL"The format is slightly different for a Windows Powershell script:$jvmoptions = "-Xrs", "-Xms256m", "-Xmx512m", "-Ddbdialect=ORACLESQL" - Setting property-value pairs as script command line switches
-
You can use the
-Dcommand line switch, available for Powershell and Bash scripts, to set a property and its value on the command line.For example, this command passes a property calleddbdialectset toORACLESQLto a Bash script called start.sh:./start.sh -Ddbdialect=ORACLESQLFor Windows Powershell, the format is the same:start.ps1 -Ddbdialect=ORACLESQL