RE: Sametime Development Posted by Steven G Cannon on 12.Mar.12 at 02:22 PM using a Web browser Category: Applications development Release: 8.5 Platform: 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
Search this forum
Sign In or Register
Member Tools
RSS Feeds
Resources
Lotus Support
Wikis
Lotus Forums