Configuring FX Sales

This page describes how to configure FX Sales.

For information on individual configuration options, see FX Sales Configuration.

Configuring FX Sales at deployment

From FX Sales version 2.30, you can use an external JSON file to override application configuration in the FX Sales WAR file. This makes it easier to change configuration in testing environments, facilitating the testing of configuration and features not yet enabled in production.

This method is suitable for overriding string, integer, and boolean configuration values (and arrays thereof). To override a configuration option that takes a JavaScript object or function, see Configuring FX Sales in development below.

Follow the steps below to override configuration in an existing FX Sales deployment on Apache Tomcat 9:

  1. In the application context for FX Sales, set the JNDI environment variable CONFIG_FILE to an absolute or relative path to the external configuration file:

    <tomcat_root>/conf/Catalina/localhost/<variant>salestrader.xml
    <Environment name="CONFIG_FILE"
      value="../../conf/fxsales/ExternalAppConfig.json"
      type="java.lang.String" override="false" />

    For more information on setting JNDI environment entries for FX Sales, see FX Sales JNDI configuration and Deploying FX Sales.

  2. Create the external configuration file with the content below:

    <tomcat_root>/conf/fxsales/ExternalAppConfig.json
    {
    
    }
  3. To override a configuration option, add a property of the same name to the JSON object. For example, to set the BLOCK_TRADING.ENABLED configuration option to true, add the following property to the JSON object:

    <tomcat_root>/conf/fxsales/ExternalAppConfig.json
    {
      "BLOCK_TRADING.ENABLED": true
    }
  4. Restart the FX Sales web application

Configuring FX Sales in development

This method requires the source code distribution of FX Sales. The benefits of overriding the configuration in the source code are that any changes are tracked, and any new configuration set is guaranteed to be present at deployment.

To override a configuration option, assign an identically named property to the extendedOptions object in the configuration file for your variant: apps/salestrader/src/customers/<variant>/<variant>SalesAppConfig.js.

Do not edit the file apps/salestrader/src/salestrader-default-aspect/AppConfig.js, which contains Caplin-set application defaults. Instead, edit the configuration file for your variant: apps/salestrader/src/customers/<variant>/<variant>SalesAppConfig.js.

In the example below, <variant>SalesAppConfig.js has been used to enable the Block Trades feature and adjust the maximum number of rows that may be uploaded to Block Trades in a spreadsheet:

Example use of <variant>SalesAppConfig.js
import AppConfig from "../../salestrader-default-aspect/AppConfig";
const extendedOptions = {
  "BLOCK_TRADING.ENABLED": true,
  "BLOCK_TRADING.UPLOAD_ROW_LIMIT": 80
};
export default Object.assign({}, AppConfig, extendedOptions);

See also: