Resolving user names for Sametime presence awareness

Mainsoft SharePoint Integrator supplies IBM Lotus Sametime® presence awareness in the integrated SharePoint® sidebar panel for Lotus Notes 8.0.1 and greater.

Columns which have values that include name information (Created by, Modified by, or Checked Out to) are designated with Sametime presence status. From the Sametime label, the user can start a Sametime instant messaging chat with other SharePoint users.

The SharePoint Integrator maps SharePoint users to Sametime users in the order below:

  • By internet e-mail address: if the SharePoint user's e-mail value is equal to a Sametime user's Internet address, a match is made.
  • By user name: if the SharePoint user name (without domain) is equal to a Sametime user's Short name/UserID, a match is made.


If no match is found, the user name is displayed as regular text.

Customize user names resolution

Mainsoft offers an Eclipse extension point for providing a custom Java implementation for mapping SharePoint users to Domino users. If the mapping described above does not match your company requirements, you may implement this custom interface to create your own resolving algorithm. To implement the interface, do the following:

  1. Add a personResolver extension node to plugin.xml. Here is a code snippet showing how this is done:
     <?xml version="1.0" encoding="UTF-8"?>
     <?eclipse version="3.2"?>
     
      
       
      
     
    
  2. Implement the resolve method of the IPersonResolver interface. Below is sample Java code for a custom implementation of the IPersonResolver interface that maps a SharePoint user to a Sametime user, and also ensures that the user's SharePoint domain and Sametime organization match:
     package com.company.sharepointintegrator;
      
     import com.ibm.collaboration.realtime.people.PeopleService;
     import com.ibm.collaboration.realtime.people.Person;
     import com.ibm.collaboration.realtime.servicehub.ServiceException;
     import com.ibm.collaboration.realtime.servicehub.ServiceHub;
     import com.mainsoft.contentlibrary.UserInfo;
     import com.mainsoft.sharepoint.sametimeintegration.IPersonResolver; 
     
     public class PersonResolverSamplePlugin implements IPersonResolver {  
     
       public Person resolve(UserInfo userInfo) {
          try {
             PeopleService _peopleService = 
               (PeopleService)ServiceHub.getService(PeopleService.SERVICE_TYPE);
             return _peopleService.getPersonById(getDominoUsername(userInfo));
          } catch (ServiceException e) {
             e.printStackTrace();
          }
          return null;
       }
     
       private String getDominoUsername(UserInfo userInfo) {
          String dominoUsername = userInfo.getDepartment();
          if (userInfo.getDepartment().length() > 0)
             dominoUsername += "/";
     
          dominoUsername += userInfo.getUsername(false);
          return dominoUsername;
       }
     }