0
votes

I am building an application that will run solely on the Domino Server. It will not be bound specifically to any application and there is no designer library associated with it. I still need to access configuration values in order to get it to run correctly.

My first thought is to use the server xsp.properties file. Because this does not exist at first I will copy the sample and put my own properties into it. How can I access those values when I am only using the OSGi servlet?

I do have an ODA (openNTF Domino API) dependency, albeit an older version from September 2014.

1
xsp.properties are imho bound to a database. If you are looking for a place for static values, add a method to your activator and let it read either a resource (if the value is determined at bundle packaging time or notes.ini. If it is a lot: provide a config database - stwissel

1 Answers

0
votes

With OpenNTF Domino API, you can use ODAPlatform.getXspPropertyAsString(). This goes through Platform.getProperty() (I believe this one uses xsp.properties of the application / server), System.getProperty(), then OS.OSGetEnvironmentString() (i.e. notes.ini). This is what the OpenLog functionality uses, as does a lot of code for getting org.openntf.domino xsp.property settings.

Alternative, you can have a look at the XPages OpenLog Logger code, which is where I originally wrote the code. The com.paulwithers.openLog.OpenLogUtil class has a getXspProperty(String, String) method, which uses com.ibm.xsp.application.ApplicationEx.getInstance().getApplicationProperty(String propertyName, String defaultValue)).