|XPages Configuration Framework
By now i think every Domino/Notes developer created at least 1 or more XPages applications. Developers who are developing XPages applications on a regular basis probably using their own frameworks (or using others) as a base of all their applications.
In this post i share my own configuration framework, which i use in my recent developed applications.. tweaking it here and there.. i hope it will give some of you a kick start for 2014..
So whats the benefit? Using this framework will let you easily create good performing and sortable selection lists (and other configuration items).
I very rarely use SSJS. Java became my favourite, even compared to Lotusscript.. So in my NSF you find several Java Classes. Don’t worry, there are only some of them which are relevant for this framework:
In this class i use mainly lotus.domino classes. The main functions are returning ViewNavigators, DocumentCollections, etc. I would tag this class as a database connector..
This class builds the list of configuration items. This bean will be placed in the application scope in order to keep it in the memory only once.
The configuration classes in the lists have to implement the IConfiguration interface.
This is a typical configuration item with label and value attributes. It implements the “IConfiguration” Interface.
This is just an example for a variation of the Configuration class. By inheriting from the Configuration class, it implements also the IConfiguration Interface, the other attributes (e.g. Address Object) are totally customizable. Just remember when you add other classes like the Room class: You have to adjust the ConfigController’s init method, in order to fill the object’s values from the custom form..
As mentioned above, the ConfigController sits in the application scope..
- Only 1 Object in the server’s memory (low server load, good performance)
- every user sees the same configuration entries (reader fields won’t work with this framework or have to be implemented in another way)
- on XPiNC the application scope behaves like session scope, so no advantages here with the performance (initial loading)
Although the disadvantages outnumber the advantage, the fact that i have only 1 ConfigController object and that the whole configuration is red from the Database only once, is a huge advantage..
Important: Keep in mind that changes to the configuration has now effect until you press the button “Reset Config”. Making this button visible only for [Administrator] would be a good idea..
- Download the NSF File with the link below
- Sign the NSF File and place it to a server
- Notes Client: Creating and changing of configuration entries
- Web / XPage: open the NSF (default xpage: “start.xsp”) and check out the sample implementation of the configuration entries
PS: I will post this to OpenNTF as well as soon i got the paperwork done
Jan 06, 2014
| Recent Blog Posts
Tipps and Tricks for the Java SE 8 Programmer Exam|
Sun, Dec 11th 2016 4:17p Frederic Dehedin
Recently i studied for the Java SE 8 Programmer I Exam (Java OCA for short) and was glad that i passed it on the first go. Although i’ve been practicing programming in Java several years, i decided to sustain my practical knowledge with some theoretical background and i’m happy to share my experience in this blog […]