I recently had the opportunity to work on a team performing an integration of Lotus Sametime 8.0.2 and SharePoint 2010 to allow for presence integration within SharePoint.
While presence integration with SharePoint and Sametime is documented fairly well on the IBM Information Center, there are not yet any dedicated resources for implementation with SharePoint 2010. The methods used below avoid many of the pain points in the IBM documentation, including bypassing the need for direct modifications to files stored in the 14 hive.
It is important to note that for the presence integration to function, the Sametime Connect client must be running and authenticated to the Sametime server environment. Utilizing just the Sametime plug-in/sidebar within the Notes client is not enough to gain SharePoint/Sametime presence integration.
Instructions
Download Support Files
All of the necessary support files can be found within the Sametime Connect toolkit. The toolkit can be obtained through the Passport Advantage site and will contain the following:
- JavaScript references
- EnsureIMNControl.js
- IMNGetStatusImage_SharePoint2003.js
- IMNGetStatusImage_SharePoint2007.js
- SharePointImages.zip (images for /_layouts/ deployment)
The Script (Sametime.js)
//EnsureIMNControl from EnsureIMNControl.js
function EnsureIMNControl() {
if (!bIMNControlInited) {
if (browseris.ie5up && browseris.win32) {
//@cc_on
//@if (@_jscript_version >=5)
//@ try
//@ {
//@
//@ IMNControlObj=new ActiveXObject("STNameLib.STNameCtrl");
//@ } catch(e)
//@ {
//@
//@ };
//@else
//@end
}
bIMNControlInited=true;
if (IMNControlObj) {
IMNControlObj.OnStatusChange=IMNOnStatusChange;
}
}
return IMNControlObj;
}
//from IMNGetStatusImage_SharePoint2007.js
function IMNGetStatusImage(state,showoffline) {
var img="blank.gif";
var alt="";
switch (state) {
case 0:
if (showoffline) {
img="Sametime_Awns_Offline.png";
alt=L_IMNOffline_Text;
}
else {
// blank.gif is the default "blank" image if we don't want to show an image
// for offline names.
img="blank.gif";
}
break;
case 1:
img="Sametime_Active_12x12.png";
alt=L_IMNOnline_Text;
break;
case 2:
img="Sametime_Away_12x12.png";
alt=L_IMNAway_Text;
break;
case 3:
img="Sametime_DND_12x12.png";
alt=L_IMNBusy_Text;
break;
case 4:
img="Sametime_Away_12x12.png";
alt=L_IMNAway_Text;
break;
case 5:
img="Sametime_Meeting_12x12.png";
alt=L_IMNBusy_Text;
break;
}
var imnInfo=new IMNImageInfo();
imnInfo.img=img;
imnInfo.alt=alt;
return imnInfo;
}
//from Init.js
function IMNRC(e,g) {
ULSA13:;
if(e==null||e=="")
return;
if(typeof g_presenceEnabled=="undefined"||!g_presenceEnabled)
return;
if(browseris.ie5up||IsSupportedMacBrowser()) {
var b=g?g:window.event.srcElement,c=b,a=b.id;
if(!IMNDictionaryObj) {
IMNDictionaryObj={};
IMNNameDictionaryObj={};
IMNSortableObj={};
IMNShowOfflineObj={};
if(!IMNOrigScrollFunc) {
IMNOrigScrollFunc=window.onscroll;
window.onscroll=IMNScroll
}
}
if(IMNDictionaryObj) {
if(!IMNNameDictionaryObj[a])IMNNameDictionaryObj[a]=e;
if(typeof IMNDictionaryObj[a]=="undefined")
//IMNDictionaryObj[a]=1;
IMNDictionaryObj[a]=0; //mod to support sametime
if(!IMNSortableObj[a]&&typeof b.Sortable!="undefined") {
IMNSortableObj[a]=b.Sortable;
if(!bIMNOnloadAttached) {
EnsureIMNControl()&&IMNControlObj.PresenceEnabled&&AttachEvent("load",IMNSortTable,window);
bIMNOnloadAttached=true
}
}
if(!IMNShowOfflineObj[a]&&typeof b.ShowOfflinePawn!="undefined")IMNShowOfflineObj[a]=b.ShowOfflinePawn;
if(EnsureIMNControl()&&IMNControlObj.PresenceEnabled) {
var d=1,h;
d=IMNControlObj.GetStatus(e,a);
if(IMNIsOnlineState(d)||IMNSortableObj[a]||IMNShowOfflineObj[a]) {
h=IMNGetStatusImage(d,IMNSortableObj[a]||IMNShowOfflineObj[a]);
IMNUpdateImage(a,h);
IMNDictionaryObj[a]=d
}
}
}
var f=IMNGetOOUILocation(b);
SetImnOnClickHandler(f.objOOUI);
c=f.objSpan;
if(c) {
c.onmouseover=IMNShowOOUIMouse;
c.onfocusin=IMNShowOOUIKyb;
c.onmouseout=IMNHideOOUI;
c.onfocusout=IMNHideOOUI
//mod to support sametime
c.tabIndex = 0;
}
}
}
//from ows.js
function IMNIsOnlineState(a) {
ULSw7Q:;
//if(a==1)
if(a==0) //mod for sametime
return false;
return true
}
A Note On Name Resolution
In the Sametime environment this was developed for, user resolution could not occur by email address with the way Sametime was configured (SIP Address resolution). Modifications were required on the Sametime Server to allow for user resolution through the SharePoint user’s SIP address (email address). This is discussed in the Troubleshooting Office SharePoint integration documentation on the IBM support portal under the heading Ensuring that Lotus Sametime can resolve an Office SharePoint server phrase.
The Package
Create a solution package (farm solution) which will deploy the JavaScript referenced above to the /_layouts/ directory and the images found in the SameTime client kit to the /images/ directory.
How the JavaScript reference is added to the required pages in your farm is an exercise for you, the reader. You could:
- Create a custom master page and reference the script
- Brownie points if you add the master page to your solution package!
- Create a HttpModule to inject the JavaScript include on all pages in a given web application, regardless of master page
Hint: I went with the HttpModule.
It is important to note that for the override to work, the script must be the last script reference on the page (or at least after ows.js and init.js).
Putting It All Together
After deploying your solution (and verifying the JavaScript has been injected on the page), you should see something close to the following:

Mousing over the control will allow you to perform any available actions against the resolved user, including chat.

Reference
- Installing Sametime Integration for Microsoft Office
- Setting up Office SharePoint integration
- Troubleshooting Office SharePoint integration
- Plan presence integration (Office SharePoint Server)
- Walkthrough: Creating and Registering a Custom HTTP Module
- ActiveX Control API Reference – NameCtrl Control

0 Comments.