In my Xpages app I would like to compute a value in the faces-config.xml by reading a value from a Notes document. Since it is an application configuration type of document and therefor the only document I think a @DBLookup function would do e.g.:
@DbLookup(@DbName(),"Profile View","Profile Document","debug","[FAILSILENT]");
However since I have placed all references to view design elements in a properties file so I can update them in 1 location instead of hard-coded references across my application I would also would avoid using a hard-coded reference in the @DbLookup function.
Normally I would get the view by collecting the value with a key (vw_ProfileDoc) as followed:
var viewName = datasources["vw_ProfileDoc"];
The datasources resource is defined on my XPage level by declaring it as a variable to a resources bundle e.g.:
<xp:bundle src="/datasources.properties" var="datasources"></xp:bundle>
So it becomes available when loading the XPage.
If I would try in the faces-config.xml something like:
<managed-property>
<property-name>debug</property-name>
<value>#{javascript:var vw = datasources["vw_ProfileDoc"];@DbLookup(@DbName(),vw,"ProfileDoc","debug","[FAILSILENT]");}</value>
<property-class>java.lang.Boolean</property-class>
</managed-property>
I will get a 404 error most likely because the datasource variable is not set.
Is there anyway to read the datasources.properties file from the faces-config.xml file?
I use database's
Resources/Filesfor such use cases. Create a file "settings.properties" with settings likeYou can access the values easily from Java code with