0
votes

I have an XPages Library database where all my XPages are created. From there users will access other databases to do their work.

I need to put the names of those databases in variables so they can be found on any server (development, test, production, etc.) since the names are always the same. I think that those variables should be applicationScope variables but I am not sure.

If applicationScope in the variable that I need, can you tell me where is the best place to create them.

If it is not the right variable, which kind of variable will be the best and where do I define them.

4
How are the users accessing the xpage applications? Is the library database acting like portal ? Like the following? : user logs in to this library and clicks on a link / gets redirected to the correct application?jjtbsomhorst
Yes, this is like a portal. That is why I want the different names of applications to be in variablesuser1969815

4 Answers

4
votes

An easy way to deploy some static references is the xsp.properties file. This file allows to add variables which are accessable on all XPages applications on the server

For example this variable...

myproperty.test=Hello World

... can be accessed in any XPage this way:

context.getProperty("myproperty.test")

These properties can be set by a theme too.

But the property has to be added to any server manually.

Another way is to use configuration documents: These can easily deployed by the replication mechanism to any database on any server. The value of these documents can be cached in applicationScope variables for a better performance.

EDIT:

You should alter the XSP.properties file on the server, not the database specific One. This does not require a Designer, only a text Editor is required.

2
votes

applicationScope variables stay in memory about 10-15 minutes and are discarded after that. If I understood your need correctly, you should store the database names or URLs permanently and Notes documents would be the best fit for that.

0
votes

The disadvantage of putting the values into a.properties file is that you need a designer Client to make changes. I would suggest to use a global configuration document for your application that can be edited either in the client or using an XPage. Take a look into the xhelp application by Paul Withers. Dig into the code to see how you can use a configuration document in your application. XHelp can be donloaded from here http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&documentId=426CB81230B6F94A8625789000830762

0
votes

I think because you are talking about a portal like application that it would be best to have a settings document implementation. You have to create an admin xpage which will check if there will be a document of a certain type in the lookupsettingsview ( you have to create this yourself ofcourse ). If there is none create the document. If there is one use the document as the datasource.

On this document you can store the replication id's and server information about the applications you want to display. This can be a simple form with a multiline text field on it. The data could be stored in a format like "Description$repid$server". On the web you have to check for this document, read the entries in the document using a repeat. For each iteration you can just use a xp:link tag. Ofcourse you first need to compute the url of the applications but that's not the biggest issue here.