Update Server Runtime Properties
From DOC
There are several ways to update properties used by the server. See Category:Runtime Properties.
Contents |
Using the Configuration Manager
The Configuration Manager can be used to update these properties without having to bounce the server.
Update the database directly
You can also edit the properties table in the database directly, however, the changes will not be visible to the running application server until either the application server is bounced. Be careful. You can wipe out server properties with SQL.
This example creates a Web Resource Override property:
insert into core.property (property_name,property_value) values ('tolven.web.resources','file:///usr/local/tolven-config/web/');
Or, you can update a property using the update syntax. In this example, the demoUser property described in Activation Properties is changed to false.
update core.property set property_value = 'tolven.login.create.demoUser' where property_name='false';
If you use branded properties, the brand should be included in the property name (there is no separate column for the brand). For example, to add a separate Web Resource Override for user's accessing your server on IP 1.2.3.4:
insert into core.property (property_name,property_value)
values ('tolven.web.resources.1.2.3.4','file:///usr/local/tolven-config/biguser/web/');
Using TPF to maintain Server Runtime properties
You will need to make a decision about how server runtime properties are maintained by your site. The previous methods maintain properties in the database. If you use TPF, the "official" properties list will be in a properties file. Running the command described in this section will replace properties already in the database. You can mix and match methods, but that approach is likely to lead to confusion. For example, you can use the TPF method described here to add/maintain a single property and then maintain other properties in separate files or use the database alone, but you would have to keep track of which is which and which file had been loaded to the database and which not.
The following three steps will configure TPF to update server properties and update them in the database and the running application server.
Create an XML file based on the tolven-config/server-default-config.properties.xml file. This example only shows a few properties:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="mail.debug">false</entry>
<entry key="mail.smtp.auth">true</entry>
<entry key="tolven.repository.oid">1.2</entry>
<entry key="tolven.login.create.demoUser">true</entry>
</properties>
Then, edit the tolven-config/plugins.xml file as follows (the example uses Windows syntax). The name of the file is unimportant, but the file name be absolute which alerts TPF to not look in the plugin for the file:
<plugin id="org.tolven.config.appserverproperties">
<root />
<property name="appserver.default.propertiesFile" value="c:/tolven-config/myProperties.xml" />
</plugin>
Finally, execute the following from the command line:
tpf -plugin org.tolven.config.appserverproperties
The properties are now available in the server (and stored in the database).
See Plugin:org.tolven.appserverproperties for more options.
Via API
Server property values must be strings. (Account Properties can be more complex.)
@EJB TolvenPropertiesLocal propertyBean; propertyBean.setProperty( String name, String value );

