166 Lotus Instant Messaging/Web Conferencing (Sametime): Building Sametime-Enabled Applications
7.2 Overview of the Extended Live Names sample
In this section, we review the functionality of the Extended Live Names sample.
This sample is used as the basis for further customization, illustrating the
functionality of the BuddyList service.
The objective of showing this sample is to illustrate how the user can add and
remove people within the user list, but once the user logs out or quits the
application, the buddylist content is not saved. Upon logging in again, the user
will get an awareness list which contains only his or her name inside. This
functionality will be enhanced by adding buddylist storage support.
The Extended Live Names sample is a stand-alone application that includes the
Log in to the Sametime community
Add or remove users from the awareness list
Initiate a chat with users who are logged in
Log out from the Sametime community
7.2.1 Accessing the sample
To access the Toolkit pages that include the Toolkit documentation, samples,
and binaries, follow these steps:
1. Navigate to the home page of your Sametime 3.x server
2. Click the SDK link at the bottom of the page. You might need to scroll down
the page to see the link.
3. Click C++ Toolkit on the Toolkits page. You are now at the Sametime 3.1
C++Toolkit home page, as shown in Figure 7-1 on page 167.
Chapter 7. BuddyList service 167
Figure 7-1 The Sametime 3.1 C++ Toolkit home page
7.2.2 Sample functionality overview
The following figures illustrate the functionality provided with the Extended Live
Names sample in the C++ Toolkit.
Logging in to the Sametime community
Users can log into a Sametime community using the login dialog. This dialog
includes three fields:
The Sametime server name to which you wish to connect
The user name
The user password
Figure 7-2 on page 168 illustrates a user logging in.
168 Lotus Instant Messaging/Web Conferencing (Sametime): Building Sametime-Enabled Applications
Figure 7-2 Login dialog
Adding people to my awareness list
Once user is logged in, the user can add people to his awareness list by clicking
the Add button and entering the person’s name. In the case of a name resolution
conflict, this will display the Add Dialog box with a list of people matching the
name criteria entered. The user can then select the desired name from the list,
as shown in Figure 7-3.
Figure 7-3 Add dialog displaying a list of names
Chapter 7. BuddyList service 169
Removing people from the awareness list
Once people have been added to the awareness list, the user can also remove
people from the list by right clicking a name and choosing the Remove menu
Figure 7-4 Remove feature
Instant messaging support
The user can start an instant chat with any online user in his list by performing
any one of the following actions:
Choosing a name and clicking on the Chat button
Right-click on an online name and choosing the Chat menu option
Double-click on an online name
Regardless of the method chosen, you should get a dialog box similar to
Figure 7-5 on page 170 when you start the chat.
170 Lotus Instant Messaging/Web Conferencing (Sametime): Building Sametime-Enabled Applications
Figure 7-5 Chat dialog
Logging out from the Sametime community
Finally, the user can also log off from the community The user only needs to click
on the Logout button, as shown in Figure 7-6.
Figure 7-6 Logout
As illustrated, this sample code provides basic functionality for logging in, adding
and removing people from the awareness list, and conducting basic chats. It is
missing key functionalities, however, since the buddylist content is not saved
when a user logs out or quits the application. Upon logging in again, the user will
get an awareness list with only his name inside. In the next section, we will use
the BuddyList service to modify this previous sample and make it much more