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.

Example 8-11 textReceived eventpublic void textReceived(MessageEvent event) {Enumeration attribs;STAttribute attrib;Enumeration sections;Section section;String senderName = "";String inputText = "";String translatedText = "";String senderLanguage = "EN";String receiverLanguage = "EN";String hashedText = "";Hashtable translatedMsgs = new Hashtable();sections = m_watchedPlace.getSections();// read input dataEnumeration senderAttribs = event.getSender().getAttributes();STAttribute senderAttrib;while (senderAttribs.hasMoreElements()) {senderAttrib = (STAttribute) senderAttribs.nextElement();if (senderAttrib.getKey() ==RedPanelDiscussionConstants.SECTION_LANGUAGES_KEY) {senderLanguage = senderAttrib.getString();} else if (senderAttrib.getKey() ==RedPanelDiscussionConstants.MY_DISPLAY_NAME_KEY) {senderName = senderAttrib.getString();}}inputText = event.getText();// send message to each section in its languagewhile (sections.hasMoreElements()) {section = (Section) sections.nextElement();// add part to get languageattribs = section.getAttributes();while (attribs.hasMoreElements()) {attrib = (STAttribute) attribs.nextElement();if (attrib.getKey() ==RedPanelDiscussionConstants.SECTION_LANGUAGES_KEY) {try {receiverLanguage = (attrib.getString().equals("")) ?receiverLanguage : attrib.getString();214 <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!