Access Resource Bundle in XPages from JAVA

Today, I tried to figure out how to access a resource bundle and return a value for a given key. I have the extensionLibrary installed and so I’m using some of the methods that are provided by the ExtLibUtils class.

To make the class available in your application, add the following line to your JAVA code.

import static com.ibm.xsp.extlib.util.ExtLibUtil.*;

The next lines of code gives you access to a global variable. When you make use of a resource bundle, a global variable is returned and you can access the bundle via this variable.

public Object getGlobalObject(String obj) throws Exception {
   return resolveVariable(FacesContext.getCurrentInstance(),obj);
}

And here is the funktion that extracts the value from the key/value pair in the resource:

public String getLangString(String bundle,String key) throws Exception {
  try{
     ResourceBundle rb = (ResourceBundle)this.getGlobalObject(bundle);
     return rb.getString(key);
  }catch (Exception e) {
     e.printStackTrace();
     return "##NOT FOUND##";
  }
}

You now can use the method to return a value for a given key from a specific resoure bundle

getLangString('myButtonLabels','CANCEL');

If there is an alternative way, pls. let me know. I’m sure there is. …


PACKT Publishing: IBM Sametime 8.5.2 Administration Guide

It took me a while to go thru all of the content, but inally I made it and here is my review.
“IBM Sametime 8.5.2 Administration Guide” was written by Gabriella Davis, Marie L. Scott and Thomas “Duffbert” Duff.

I have attended sessions by Gabriella Davis and Thomas Duff at several conferences and while reading the book, I sometimes felt like sitting in the audience and hear Gabriella and Tom talking. I never had the chance to meet Marie L. Scott but I’m sure that she is as enthusiastic as the other authors.

All of them have a deep knowledge and so is the content of the book.
Every detail of the installation and administration is covered and one should be able to setup a Sametime environment following the description in the book step by step. If I only had this book a year ago, it would have saved me a lot of time then.
My first installation took me more than a week. One week with reading documentation, hanging around in forums and chatting with IBMer Frank Altenburg. And a lot of try and error.

Be asured that, following the book, you can do the installation in less time.
Also, if you are new to Websphere, this book is for you. IBM Sametime is not as easy to setup as double-click a setup.exe and wait. There are many places to look into and numerous properties that can be set or eaven been set wrong.

You can do it the hard way and find out on your own, or invest some money buying this book. There will be an immediate ROI.

The book may also help planning the resources by finding out, what exactly is needed, both hardware and soft skills.

I recommend “IBM Sametime 8.5.2 Administration Guide” to everyone who is new to Sametime, wants to upgrade from an older version and even to those, who already have a Sametime 8.5.x environment running. You will for sure find something in the book that is new to you.