Documentation Center

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

For example, OAuth authentication is pre-configured to work out of the box, thus it is enabled by default in the Ambient Data Framework client configuration file cd_ambient_conf.xml as follows:
 <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 export command 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 called OAuthEnabled and gives it the value false:
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 -D switch to set a property and its value in your startup script's Java Virtual Machine (JVM) options, a sequence of settings called JVM_OPTIONS in Unix or $jvmoptions in 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 property OAuthEnabled and gives it the value false:
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 -D command 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 called OAuthEnabled set to false in a Bash script called start.sh:
./start.sh -DOAuthEnabled=false
For Windows Powershell, the format is the same:
start.ps1 -DOAuthEnabled=false