Configuration

The iKnowBase web application can be configured to adapt to different needs using configuration properties.

Overview

First, modules in iKnowBase expose a number of Configuration objects that control the workings of the module. Each configuration object has one or more named configuration properties that can be set by the user. If the user does not set a given configuration property, a default value will be used.

When the iknowbase web application starts, it populates the configuration objects with property values set by the user, and then uses the configuration objects to adapt the module. Note that this implies that making changes to properties will require a restart of the application server.

At run time, the actual property values can be inspected in the management console, e.g. at /ikb$console.

Property sources

Configuration properties are available from many different sources. When an application requires a property value, it will check these sources in order, and the first one that can supply the required property will be used:

In practice, you will probably use either java system properties or the ikb_installation_properties tables:

System properties

System properties is the “standard” java mechanism for configuring an application. They may be set in various ways:

Thus, to enable the activiti process engine inside iKnowBase, you could use the following iKnowBase property file:

db.URL = jdbc:oracle:thin:@//localhost:1521/orcl
db.ikbUser = ikb_prod
db.ikbPassword = SECRETPASSWORD

System.com.iknowbase.process.activiti.enabled=true

The ikb_installation_properties database table

Using the IKB_INSTALLATION_PROPERTY table is the most common option. Since this table is shared between all applications and all application server instances, it is possible to add expressions that are checked at runtime in order to select the proper property. This is done using the “instance_qualifier” table column.

At startup, each iKnowBase java web application loads properties from the ikb_installation_table. For each row, it will evaluate the “instance_qualifier” value to decide if this particular property is valid for this particular application instance. The qualifier is interpreted using the Spring Expression Language, which allows for combining various types of tests.

The available variables and methods for the expression is limited to the following logical interface definition:

Variable Description
hostname Name of server
directory Startup directory; same as the java property “user.dir”
contextPath Root context path of web application (e.g. "“ or ”/CustomContextRoot")
getSystemProperty(name) Value of system property

These can be combined in several ways, to achieve various effects:

Qualifier Description
* Used by any application, anytime
true Used by any application, anytime
hostname == 'tango' Used by any application running on a host named “tango”
directory == '/opt/iknowbase/sso' Used by applications running from the “/opt/iknowbase/sso”-directory
hostname == 'tango' && contextPath == '/CustomContextRoot' Used by an application deployed to /CustomContextRoot, when running on a host named “tango”
hostname == 'tango' && contextPath matches '/Custom.*' Used by all “/Custom” prefixed applications, when running on a host named “tango” (/CustomContextRoot, /CustomOtherContextRoot, ...)