Tony Palmer: SnTT : Unit Testing In Domino
I’m on holiday… :-)
I’m now on holiday and I wont be back in the office until 3 January 2008. How nice is that! I really feel I need a couple of days off. The last 3 months after my switch to IntraVision has been eventful and even more full with work. A couple of days of will do me good I think.
When I’m back in the office I’m only there for 8 days before leaving for Orlando.
Happy holidays to you all… 🙂
Lotus Connections Profiles – using JavaScript to translate data for TDI
I have been working with Lotus Connections lately and wanted to share a tidbit of code for the profiles database population step.
During the population of the profiles database from Domino LDAP using TDI (Tivoli Directory Integrator) I needed to translate country names to the matching ISO country code as this is what is used in Lotus Connections. To do this you can write a Javascript function in profiles_functions.js and map it in map_dbrepos_from_source.properties. The documentation on this is very lacking but through some trial-and-error and with a little help from Mac i cracked it.
Below is the function I wrote (with only a few countries) to show how to write the function which isn’t apparent at all. The error output from TDI simply indicates a “parse error” if your Javascript is wrong for whatever reason.
I hope this can save someone some time…
The tricks:
- Define “fieldname” as a parameter to the function. I don’t use it but at least one parameter is required.
- Use the available “work” variable to get data from the backend LDAP directory using the getAttribute method.
- Use the available “system” variable to create a new attribute to replace the one we find.
- Return the constructed attribute to have it show up in the profiles database.
- The Javascript is actually accessing Java objects in the backend. Keep this in mind when comparing Strings – remember to use String.equals!
map_dbrepos_from_source.properties
PROF_ISO_COUNTRY_CODE={func_xlate_country}
profiles_functions.js
function func_xlate_country(fieldname) {
// init arrays for translation
var iso_codes = new Array("DK", "IE", "DE");
var iso_ctry = new Array("Denmark", "Ireland", "Germany");
// get attribute
var ctry = work.getAttribute("c");
if (null != c) {
// get value from attribute
var val = ctry.getValue(0);
// loop array
for (var i=0; i<iso_ctry.length; i++) {
// match country name from attribute against current
// array position
if (val.equalsIgnoreCase(iso_ctry[i])) {
// found one - create new attribute to hold
// our translated value and set it
ctry = system.newAttribute("c");
ctry.addValue(iso_codes[i].toLowerCase());
}
}
}
// return attribute to TDI
return ctry;
}
Lotusphere 2008: BALD
If you’re going to Lotusphere 2008, and
- you’re blogging,
- or want to be but aren’t yet,
- or are at the hotel early,
- or don’t have anything else to do on Saturday before Lotusphere
be sure to stop by the Big River Brewery (on the boardwalk) on Saturday at 3.30PM for the annual BALD (Blogger Annual Lotusphere Dinner). And for the record – it isn’t as much a dinner as just an excuse for drinking beer…
Article draft of to THE VIEW
Just shot of an e-mail with a draft of my next article for THE VIEW. The working title is “Into the blackbox – a tour of the Sametime Business Card system” and will discuss and describe the business card system, a.k.a. UserInfo, of Sametime and how to configure, mix and match blackboxes and how to write your own blackbox implementations. The article is a little less development focused than I’m used to but I still managed to sneak in some Java code… 😉
No word yet on when it’s gonna be out but I’m guessing the March/April 2008 issue.
Sametime 7.5.1 install on Domino with custom data directory
Hmmm… Installing Sametime 7.5.1 on Domino 7.0.3 still exhibits the previously discussed behavior with a little twist (directories still created but no files are copied to them). The install still works though.
Sametime 8 article
Get up to speed on Sametime 8 Entry, Standard, Advanced, Unyte and “Unified Telephony”: The IBM Lotus Sametime V8 family: Extending the IBM unified communications and collaboration strategy
Discovering Notes 8: More default browser woes?

As blogged previously there are more than one way to set the default browser for your Notes 8 Standard installation. For some reason the preferences didn’t take effect on my Microsoft Vista install so web links continued to open in IE much to my dismay. I finally found the solution to the issue with a little help from the trusted Notes 8 forum on developerWorks. Below is an excerpt from the solution.
“Hit windows button (start button), select “Default programs”, “Set program access and computer defaults”. Expand the “Custom” section, and set Firefox as default web browser and Lotus Notes as default e-mail program. If you reopen it, it will seem like your changes was not saved, but apparently they are.”
Thanks to Stein Sebak for posting the solution.
New Sametime 8.0 Toolkit
The Sametime 8 SDK ships with a new toolkit called the Helper toolkit. The following is from the Sametime 8 SDK overview (Sametime_SDK_Overview.pdf).
“The Sametime Helper Toolkit is an API that provides an external interface to basic functionality of the Lotus Sametime Client. The Sametime Helper Toolkit is not intended to directly extend the capabilities of the Sametime Client. This toolkit differs from other Sametime client toolkits by providing an external interface to basic functionality exposed in the locally running desktop Lotus Sametime Client application. Applications that integrate the Sametime Helper API are essentially able to proxy the functionality of the locally running Sametime Client (Managing contacts, Starting chats, Alert notifications).”
Highlights of the Sametime Helper Toolkit
The Sametime Helper Toolkit exposes the following basic functionality of the Sametime Client:
- Contact Management, Query, and Notification
- Chat session initiation
- Instant Share initiation
Deprecations
Be sure to review the API_Changes.txt file in the client/connect/doc directory of the SDK for changes in the public API.