XPages Configuration Framework

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).

configuration-framework

 

 

Description

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:

App

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..

ConfigController

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.

Configuration

This is a typical configuration item with label and value attributes. It implements the “IConfiguration” Interface.

Room

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..

FacesConfig

As mentioned above, the ConfigController sits in the application scope..

<managed-bean>
   <managed-bean-name>
    configController
   </managed-bean-name>
   <managed-bean-class>ch.belsoft.config.ConfigController
   </managed-bean-class>
   <managed-bean-scope>application</managed-bean-scope>
   <managed-property>
      <property-name>app</property-name>
      <value>#{app}</value>
   </managed-property>
</managed-bean>
<managed-bean>
   <managed-bean-name>app</managed-bean-name>
   <managed-bean-class>ch.belsoft.App
   </managed-bean-class>
   <managed-bean-scope>application</managed-bean-scope>
</managed-bean>

Advantage:

  • Only 1 Object in the server’s memory (low server load, good performance)

Disadvantage(s):

  • 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..

Instructions

  • 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

Download

Download Lotus Notes nsf File

 

PS: I will post this to OpenNTF as well as soon i got the paperwork done 🙂

Leave a Reply

comment-avatar

*