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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.6 Using Sametime Links with botsOne request many people have when using Sametime Bots is the ability toaccess them via a <strong>Web</strong> browser. Sametime Links is obviously a great way ofproviding access to Sametime and Sametime Bots on a <strong>Web</strong> page, butSametime Links works differently for traditional Sametime Connect clients whenit initiates a conversation, making bots harder to interact with. In this section, wewill discuss how Sametime Links can be modified to work with Sametime Bots.9.6.1 How does it differ?So how is a Sametime Links conversation different from a conversation initiatedby the Sametime Connect client? With a traditional conversation that is initiatedby the Sametime Connect client, the first thing that happens when the Connectclient initiates a conversation with another Sametime user or bot is that theSametime Connect client opens the IM session. What this means is that thereceiving party receives an imOpened and imReceived event on the imListener,which can then kick off other processes (in the case of bots, often displaying awelcome message). As you can in the 3.3.1, “The Echo Bot” on page 56example, the imReceived event is used to send back a welcome message.Where the Sametime Links client differs is that the Sametime Links client doesnot kick off the imOpened or imReceived event until an actual message is sent.This obviously leads to some issues for bot developers who are expecting thefirst inOpened and imReceived events to just be the opening of the IMconversation rather than being the actual query itself.The easiest way around this problem is to modify the Sametime Links HTML filesslightly so that when the chat window is opened it immediately sends a textmessage to the bot. In Figure 9-33 on page 257, we can see thischatWindow.html has been modified to send the word "HELP" when the bot linkis clicked, thus allowing the bot to send its welcome message and initiate theconversation with the Sametime Links user. We can make this change bymodifying the chatWindow.html file.256 <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!