Creating your own parameters
You can take advantage of the application configuration parameters feature to store your own parameters.
To create a new configuration parameter:
- Go to Administration > Utilities > Database query.
- Select the JDBC option from the list at the bottom.
- Write a query like this:
INSERT INTO OKM_CONFIG (CFG_KEY, CFG_TYPE, CFG_VALUE) VALUES ('your.property.name', 'string', 'some value');
- Click the Execute button at the top right.
The type value - CFG_VALUE column - must be written in lowercase!
Sample
You can access it from source code via the properties.
When the property does not exist, it will be initialized with the default value (in the sample code below "initial value").
import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;
ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
// If the parameter not exists, by default is set to "initial value"
String value = configSrv.getString("your.property.name", "initial value");