10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

To implement this client portion of this solution, we use two techniques. The botcomponent is discussed in this redbook. The other technique refers to a portionof the code available in the Client.java file, available in Chapter 3, “OfflineMessages Sample”, in the Sametime 3.1 Community Server Toolkit Tutorial.Important: This section is intended to illustrate bot concepts at a higher level,without providing detailed techniques on bot development andimplementation. We are just showing how previous discussed techniques canbe modified to meet a specific requirement. Accordingly, the code shown hereis for illustrative purposes.For specific technical information on bots, their structure, and how toimplement them, please refer to Chapter 3, “Sametime Bots” on page 49.Basically, we are implementing a regular bot with a hook to a server application.To accomplish this task, we do the following:►As in any bot, we implement a welcome message when the user opens theinstant messaging session with the bot. To accomplish this, we put somecode on the ImReceived event listener, as shown in Example 13-4.Example 13-4 Basic ImReceived event response to users}public void imReceived(ImEvent e) {e.getIm().addImListener(this);e.getIm().sendText(true, "Hello " +e.getIm().getPartner().getName());e.getIm().sendText(true, "Welcome. I am the OfflineMessenger Bot");e.getIm().sendText(true, "Please enter #");The code shown in Example 13-4 gives the user the result shown in Figure 13-13on page 389.388 <strong>Lotus</strong> <strong>Instant</strong> <strong>Messaging</strong>/<strong>Web</strong> <strong>Conferencing</strong> (Sametime): Building Sametime-Enabled Applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!