Skip to main content

Hardcoding policies

As of version 2143 configuration values can be hardcoded,hardcoded/overloaded.

The server policies can be hardcoded into the deployment file for various reasons

  1. Ensure system values are not subject to ensurechange easyin databasethe replicationdesigner
  2. from
  3. Ease liveenvironment backreplication: toJust test.

    copy the whole database, and define environmental differences in a file.

Typical fixed parameters include

  • Application name
  • Server daemon autostart
  • SMTP server testmode
  • Base schema name

Adding an overloaded policy

Policy overloads are placed inside the Context element in the deployment file, where the connection strings are placed too.

  • Tomcat: <tomcat root>/conf/Catalina/localhost/<application>.xml
  • JBoss: <jboss root>/standalone/configuration/<application>.xml

The policy in question should use the following syntax:

<Parameter name="Policy.XXXXX" value="YYYYY"/>

X = Name of the policy as per Policy reference

Y = Value of the policy in String, Integer or Boolean format

Usage notes

  • Place in the context file of the application
    • Tomcat: <server root>/conf/Catalina/localhost/<application>.xml
  • The syntax for naming is: "Policy." + configuration name
    • Boolean values use: [true|false]
  • The Context parameters can optionally be set inside the servlet container manager
  • Changing overloaded policies inside the designer will have NO EFFECT at all
  • Please ensure the datatype fits Policy type, or the overloaded value will default to the installation value.
    • For boolean values use "true" or "false"
    • String value " should be escaped normally
  • Policy overloads are loaded ONCE when the application is loaded by the servlet container.
    • If you change the values, you will need to restart the application or the container
    • All parameters are written to the server / application logfile upon startup

Example

 <?xml version="1.0" encoding="UTF-8"?>
 <Context path="/TempusServa" >
     <Parameter name="Policy.applicationName" value="Test server"/>
     <Parameter name="Policy.smtpTestMode" value="true"/>
     <Parameter name="Policy.dbNameBase" value="sandboxtest"/>
     /* More configuration values  */
     /* Connection strings etc.  */
 </Context>

Protecting the variables

By setting the special policy policyHideValues, overloaded are no longer visible from backend system.

<Parameter name="Policy.policyHideValues" value="true"/>