This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 14, 2012, 2:35 AM
32 Posts

Design Advice - use of admin db in XPages apps

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: Best Practice,Development
  • Replies: 2
Hi,
 
I am in the process of building an xPages application, and am looking for other views on how to best use the central admin database concept traditionally used in std notes applications in xPages.  Essentially, removing any hardcoding of database and server location, whilst ensuring that there is not too much overhead when creating the code to determine the location of the database you want to open.
 
There are a few options, including:
  • setting custom sessionScope variables which do the lookup
  • doing the lookup for each view when the view is called

I'm interested in knowing what people think is the best approach.  I have not come across any xPages sample apps which address this yet.

Cheers,
 
A
 
 
Mar 14, 2012, 12:37 PM
13 Posts
Re: Design Advice - use of admin db in XPages apps
hi.
 
We load up config that is applicable to all user of the app into applicationScope variables.
 
It's a bean called AppController, which has methods like getPathFinance(), setPathFinance(), getPathOrders(), setPathOrders(), which all get set in the constructor of AppController.   The bean class has properties like: m_path_fininace, m_path_orders.  In the constructor, we have a method that goes out to our config doc, gets values and sets them to these properties, the getPathOrders() returns value from the property m_path_orders.
 
We also load up other "static" config, e.g. so some keyword lists are never normally going to change, we load those up into the AppController.
 
Then in your SSJS or client side js you can get to via:  AppController.pathOrders    If bean has not bean initialised, it will call constructor, and set the values to bean, if bean already initialised, it will get them effectively from cache, since your bean is applicationScope.
 
...but you shouldn't store any Notes elements: views, documents etc., in cache, as they get flushed periodically, so you still have to perform the db.getView("someviewname")  bit.
Mar 14, 2012, 10:31 PM
32 Posts
Re: Design Advice - use of admin db in XPages apps
Thanks Nick - appreciate your feedback and advice.
 
Does anyone have a good sample app to see something like this working? 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal