Skip to main content

Discover location awareness in IBM Lotus Sametime V7.5

Shruti Gandhi, Sametime developer, IBM, Software Group
Shruti Gandhi is the lead architect for location-based services for real-time collaboration. She is also a developer on the IBM Lotus Sametime Connect V7.5 client. She is in the process of finishing her Masters of Science in Computer Science at Columbia University.

Summary:  No matter where you are IBM Lotus Sametime V7.5 can find you with its new location awareness feature. Learn about the server-side and client-side mechanisms for location awareness and get a peak at a plug-in that uses location data to bring you local attractions.

Date:  12 Sep 2006 (Published 05 Sep 2006)
Level:  Introductory
Activity:  2328 views

IBM Lotus Sametime V7.5 is a major upgrade in real-time collaboration. It is the next generation client with an upgraded instant messaging user experience that delivers an extensible plug-in model built on the Eclipse framework. This makes it not just a tool, but a platform for innovation.

Among all the new features, such as quickfind, mini-apps, business card, audio integration, and many others, one of the highlighted features of the client is location awareness. This article introduces you to the location awareness feature, describing how it works and how you can take advantage of it. It also shows you some code behind the Concierge plug-in, which uses location data to bring you local attractions.

This article is intended for both new and experienced Lotus Sametime users and for application developers interested in extending Lotus Sametime's capabilities.

What is location awareness?

The concept of location awareness is similar to a user's I am Available status. Essentially, users notify each other that they are online, but location awareness expands upon this concept. With location awareness, you share your location presence (that is your geographic information) with other users to help them determine where you are located at the current time. In addition, you can use location information to receive location-based services.

In Lotus Sametime V7.5, your current location information is displayed in the top right corner of the Contacts list. Figure 1 lists Cambridge, MA, US, as the current location for the user.


Figure 1. Location information
Location information

If you share your location information with other users, then other users can see that information in two places in Lotus Sametime Connect:


How does location awareness work?

Lotus Sametime V7.5 uses a client-based profiling mechanism for location awareness. Currently, we are testing a server-based auto-profiling mechanism that will expand our location awareness capability. This article explores both of detecting location presence.

Client-based location awareness

Client-based location awareness uses an IP-based profiling mechanism. IP-based location awareness uses the user's network information, including subnet, net mask, and the Mac address of the router. This mechanism requires each user to manually populate his geographic details for each new location. The data is stored in profiles on the user's machine, so each time the user enters a previously visited location, his location information is automatically pre-populated based on what the user entered earlier. Otherwise, he is prompted to enter information for that area with an alert similar to figure 4.


Figure 4. Location alert
Location alert

You can click the alert to enter location details in the Preferences dialog box Location Settings (see figure 5). You are prompted for city, state, country, zip code, time zone, and phone number.


Figure 5. Preferences dialog box Location Settings
Preferences dialog box Location Settings

Server-side location awareness

Within IBM, we have implemented a server-side solution that auto-detects your location. This solution may be available as an offering in a future release. Upon availability, the server-side mechanism will work in conjunction with the client-side mechanism.

Server-side location awareness also uses an IP-based detection mechanism. IP-based location awareness uses the user’s network information, including the subnet, net mask, and the Mac address of the router. This information is coupled with geographic details stored in a central database with other network-to-location mappings. To differentiate virtual private networks (VPNs), the Mac address of the first router the client connects to is used as a distinguishing factor.

The first time you visit a location without network details in the database, the Lotus Sametime Connect client prompts you to enter information in the Preferences dialog box Location Settings (see figure 5). You are prompted for city, state, country, zip code, time zone, and phone information.

When you enter location settings data, Lotus Sametime creates an entry for the location in a central database. That entry is coupled with your network information, which is automatically detected by the Lotus Sametime Connect client. The next time any other user enters the same location (subnet and router), location information is automatically pushed to the other user because an entry for his subnet already exists in the database. A simple query enables push-based location detection for every user in that area (see figure 6).


Figure 6. Location detection
Location detection

For example, if User 1 on the network enters the location details for the subnet 129.1.1.0 and Mac address 00:06:2A:CE:F4:A9 as Cambridge, MA, US, then all other users who log onto that network are automatically assigned Cambridge, MA, US, as their location as illustrated in figure 7. This data is then visible to everyone trying to locate that user.


Figure 7. Network-to-location mapping
Network-to-location mapping

This server-side mechanism uses a self-learning model based on a voting system. Each time a user enters the geographic details for a particular network to create the network-to-location mapping in the central database, it counts as a vote. The voting system validates that data. The validation process is automated, based on the history of votes that were cast for that location. A user can opt to change his vote. For example, if 23 users validate a particular location as Cambridge, MA, US, while 24 other users try to rename that location Poughkeepsie, NY, US, then the results of the voting system change the entry for that network location to Poughkeepsie, NY, US. This enables a self-learning robust system that can push the most accurate data to new users who log into that location.

With this technique, even though it requires a repository of data, the system is autonomous unlike other repository-based solutions. The user updates the location information with minimal requirements for user interaction or for system administration. The entire process is transparent to the users and very trustworthy. This model can help reduce false network-to-location mappings, thus making the location data reliable.

The server-based mechanism is the fruit of the Grapevine project from IBM Research. If this mechanism is available, then you can easily incorporate it into Lotus Sametime V7.5. On Lotus Sametime V7.5, both mechanisms work in collaboration with each other. If a client has a local profile for a particular location, then the local profile is used; otherwise, the server-based mechanism (if it exists) is queried for location information.

The user interface is also shared between both mechanisms. If you enter or edit your location settings in the Preferences dialog box, Lotus Sametime can update both the server entry and client profile.

Regardless of whether you use the client-based mechanism or the server-based mechanism, you can opt to share the location information with other users or applications or opt out of sharing. Similarly, you can also choose not to be alerted when a new location is detected. All these preferences can be set in the Preferences dialog box Location Settings.


Sametime location server

The Lotus Sametime server stores the location derived from either the client or server mechanism as a location object. A location object consists of attributes such as city, state, country, postal code, user-defined location name, and time zone. When a user's geographic location is updated from one of the mechanisms described earlier, that information is passed to the Lotus Sametime server.

The Lotus Sametime server temporarily stores this information as an attribute for the duration that you remain online. It also makes your location known to other users and applications if you choose to share your location.

You can access the location information that is aggregated from the client or server mechanism through the Lotus Sametime Software Development Kit (SDK) for your plug-ins. After you go offline, the location information on the Lotus Sametime server is lost unlike the client/server mechanism.


Location awareness for Sametime plug-ins

The location information gathered by the client is also available to any plug-ins that you create. This data is exposed through the Lotus Sametime SDK. Each plug-in has access to information about a person’s current location whereabouts. The location information includes:

  • City name
  • State name
  • Country name
  • Postal code
  • User-defined personal location name
  • Time zone

You can use this information to write location-based services. Location-based services are services that use location data to provide local information for that geography. For example, you can provide a service for nearby restaurants, gas stations, movie theatres, and so on.

The Concierge plug-in

Before you continue, you may want to familiarize yourself with Lotus Sametime plug-in development to better understand the following Concierge plug-in explanation. Refer to the Resources section for previous Lotus Sametime V7.5 articles covering plug-in development and the Lotus Sametime SDK. For this portion of the article, we assume that you are familiar with extension points and have some knowledge of the Eclipse SDK/platform.

In the following example in figure 8, you can see how location data is used to provide concierge services in Lotus Sametime V7.5 for a user in Poughkeepsie, NY, US, including local weather information.


Figure 8. Location-related information for Poughkeepsie, NY
Location-related information for Poughkeepsie, NY

The Concierge plug-in detected that the user is located in Poughkeepsie, NY, US, and that information is then provided to all the plug-ins. The plug-in uses that location information to find the local weather and to locate local restaurants, printers, and cafeterias for that user.

The weather information is fetched from the National Oceanic and Atmospheric Administration Web site. We use Google Maps to find local restaurants and IBM services to find local printers and site cafeterias. When we detect a user’s personal location, we make a call to the National Oceanic and Atmospheric Administration Web site with that location information to receive weather information in XML format. That XML data is then translated into a pictorial format and displayed in the Lotus Sametime V7.5 mini-app area.

In the case of local restaurants, we use Google Maps to prefill the URL with the location information we have. In the URL below, we replace #city# and #state# with the city and state information we have.

http://local.google.com/local?f=l&hl=en&q=restaurant&near=#city#,+#state# &ie=UTF8&z=13&om=1


Similarly, we point to the appropriate URLs for the IBM printers and cafeterias.

The Concierge plug-in uses the extension point for the mini-app area to display location-based plug-ins. The mini-app area is the area at the bottom of the Contacts list, which is extensible for plug-ins. Sample plug-ins, such as the BuddyNote in the Lotus Sametime SDK, take advantage of the mini-app area to display data.

Lotus Sametime plug-ins can use the com.ibm.collaboration.realtime.imhub.miniApps extension point in their plugin.xml as follows:

<extension point="com.ibm.collaboration.realtime.imhub.miniApps">
      <miniApp
            category="shelf.applications"
            class="com.ibm.collaboration.realtime.concierge.Concierge"
            displayName="WeatherHead"
            icon="images/ST_Weather.png"
            id="com.ibm.collaboration.realtime.concierge.Concierge"
            maxHeight="105"/>
   </extension>


The Concierge plug-in uses the isInitiallyVisible() method from AbstractMiniApp class with an initial value of false. The isInitiallyVisible() method value of false means that the plug-in is not displayed initially. It waits for a Lotus Sametime V7.5 message event to notify it when a user's location changes, and then it is triggered to appear.

public boolean isInitiallyVisible() {
	if (URLvalid) {
		return true;
}
	return false;
}


At that point, the createControl(Composite parent) method from AbstractMiniApp class is called. The createControl method passes a parent Composite for the Concierge class to use to display data in the mini-app area. The Concierge plug-in uses a Web browser widget to display the weather from a URL.

public Control createControl(Composite parent) {
		Composite composite = new Composite(parent,SWT.NULL);	
		composite.setLayout(new FillLayout());		
		final Browser browser = new Browser(composite, SWT.NONE);	
		browser.setURL(“www.abc.com”);			
		browser.setData("refresh", "false");		
		composite.setEnabled(true);
		composite.layout();
		return composite;
	}


Conclusion

This article gives you an in-depth description of how location awareness works in IBM Lotus Sametime V7.5. It points out the different ways in which location information can be gathered and shared. We briefly talk about how to use the location object from the Lotus Sametime SDK to display the object in the mini-app area. A follow-up article, "Developing a location awareness plug-in for IBM Lotus Sametime Connect V7.5," discusses in detail how to use location data to create a location-based weather plug-in. We walk you through the steps of getting location information for a person and using it to determine local weather.


Resources

Learn

Get products and technologies

Discuss

About the author

Shruti Gandhi is the lead architect for location-based services for real-time collaboration. She is also a developer on the IBM Lotus Sametime Connect V7.5 client. She is in the process of finishing her Masters of Science in Computer Science at Columbia University.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=156642
ArticleTitle=Discover location awareness in IBM Lotus Sametime V7.5
publish-date=09122006
author1-email=
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers