Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  IBM Sametime Forum

IBM Sametime Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

RE: Sametime Development
Steven G Cannon 12.Mar.12 02:22 PM a Web browser
Applications development 8.5 Windows


Carl,

Thanks for the direction. Have put all the code in the agent from that chapter so I can see it in action and I am getting 2 errors plus it wanted me to add blank implementations for 5 methods. I am pasting in my code here since I most likely made some weird typo that I am not seeing. If you have a moment to look at it that would be great. I am putting the errors in there as well. They are in the NotesMain.

Thanks in advance,

Steven

***************
import lotus.domino.*;
import com.lotus.sametime.announcement.*;
import com.lotus.sametime.awareness.*;
import com.lotus.sametime.community.*;
import com.lotus.sametime.core.comparch.*;
import com.lotus.sametime.core.constants.*;
import com.lotus.sametime.core.types.*;
import com.lotus.sametime.lookup.*;

public class JavaAgent extends AgentBase implements LoginListener, ResolveListener, StatusListener{
private STSession m_session;
private CommunityService m_communityService;
private LookupService m_lookupService;
private AnnouncementService m_announcementService;
private AwarenessService m_awarenessService;
private Resolver m_resolver;
private WatchList m_watchList;
private STUser m_requestedUser;
private String m_strUserName;
private String m_strAnnouncement;
private short m_shAnnouncementStatus;
private boolean m_bSetup;
private boolean m_bResolved;
private boolean m_bFinished;
public void NotesMain(){
try {
//###Designer is saying Type Session is ambiguous
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
//###sendAmmouncement method is undefined short shAnnouncementStatus = sendAnnouncement("Steven Cannon", "Hello World");
System.out.println("Status of announcement for user John Barrow: " + shAnnouncementStatus);
} catch(Exception e) {
e.printStackTrace();
}//end try
}//end NotesMain

public void loggedIn(LoginEvent event){
System.out.println("loggedIn()");
m_resolver = m_lookupService.createResolver(false, false, true, false);
m_awarenessService = (AwarenessService) m_session.getCompApi(AwarenessService.COMP_NAME);
m_watchList = m_awarenessService.createWatchList();
m_watchList.addStatusListener(this);
m_announcementService = (AnnouncementService) m_session.getCompApi(AnnouncementService.COMP_NAME);
m_bSetup = true;
}//end loggedIn

public void userStatusChanged(StatusEvent event){
System.out.println("userStatusChanged()");
STWatchedUser[] watchedUser = event.getWatchedUsers();
short userStatus = watchedUser[0].getStatus().getStatusType();
if(userStatus == 32){
STObject stObject[] = {m_requestedUser};
System.out.println("sendAnnouncement");
m_announcementService.sendAnnouncement(stObject, false, m_strAnnouncement);
m_shAnnouncementStatus = 0;
m_bFinished = true;
} else {
m_shAnnouncementStatus = -1;
m_bFinished = true;
}//end if userStatus == 32
}//end userStatusChanged

//####These are the methods that JavaAgent wanted me to implement.
public void loggedOut(LoginEvent arg0) {}
public void resolveConflict(ResolveEvent arg0) {}
public void resolveFailed(ResolveEvent arg0) {}
public void resolved(ResolveEvent arg0) {}
public void groupCleared(StatusEvent arg0) {}
}




Sametime Development (Steven G Cannon... 12.Mar.12)
. . RE: Sametime Development (Carl Tyler 12.Mar.12)
. . . . RE: Sametime Development (Steven G Cannon... 12.Mar.12)
. . . . . . you can get the actual code from th... (Carl Tyler 12.Mar.12)
. . . . . . . . RE: you can get the actual code fro... (Steven G Cannon... 19.Mar.12)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow