About parameters in the Ambient Data Framework configuration
Rather than providing hardcoded values in your Ambient Data Framework client configuration file cd_ambient_conf.xml, you can specify strings of the format ${PROPERTYNAME} instead, where PROPERTYNAME is the name of an environment variable or of a property whose value you set when running a script that uses the client configuration file.
An example- setting parameter values at run or install time
<Security OAuthEnabled="${oauthenabled:-true}">
The placeholder parameter of the format${PROPERTYNAME:-true} indicates that you can supply the value for this property at startup or install time, or else the default value is "true". Although SDL strongly recommends against disabling OAuth authentication, it is possible. OAuth authentication must be switched on everywhere or switched off everywhere. So with parameters you can supply the OAuthEnabled 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_ambient_conf.xml, and then give them the right value in each context.For example, the following Unix command creates an environment variable calledOAuthEnabledand gives it the valuefalse:export OAuthEnabled="false"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 propertyOAuthEnabledand gives it the valuefalse:JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -DOAuthEnabled=false"The format is slightly different for a Windows Powershell script:$jvmoptions = "-Xrs", "-Xms256m", "-Xmx512m", "-DOAuthEnabled=false" - 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 calledOAuthEnabledset tofalsein a Bash script called start.sh:./start.sh -DOAuthEnabled=falseFor Windows Powershell, the format is the same:start.ps1 -DOAuthEnabled=false