major
minor
major
minor
major
#27186
Context-local environment variables: Assigning application properties via JNDI
Currently, the only way to pass additional properties to Top-Logic from outside is via global Java system properties and global Java environment variables.
It should be possible to do this on a per-context basis as well; that is, if multiple applications are running in a container, it should be possible to configure them individually.
Application
It is now possible to specify JNDI variables for the application in the "tl" namespace. These are treated like system properties or environment variables. For example, if the context file (/var/lib/tomcat9/conf/Catalina/localhost/<context-name>.xml) is provided to Tomcat for the application
<Context>
...
<Environment name="tl/tl_storage_path"
value="/var/lib/tomcat9/work/myApp"
type="java.lang.String"
override="false"
/>
...
</Context>
is provided, the property ${env:tl_storage_path} is resolved to the value "/var/lib/tomcat9/work/myApp" at the relevant points in the configuration.
Note that JNDI variables used to populate TopLogic application properties must begin with the prefix "tl/".
Code Migration
- The property "tl.developerMode" (which sets a system to developer mode) has been renamed to "tl_developerMode". Search and replace.
Test
- Build and install BPE as a Debian package.
- Expected: The transaction data is located under "/var/lib/tomcat9/work/bpe"
- Modify a model translation.
- Uninstall BPE and reinstall it
- Expected result: The new model translation is still present.