org.sakaiproject.tool.portal
Class PresenceTool

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sakaiproject.tool.portal.PresenceTool
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class PresenceTool
extends HttpServlet

Presence is an tool which presents an auto-updating user presence list.

Version:
$Id: PresenceTool.java 5891 2006-02-10 21:22:53Z gsilver@umich.edu $
Author:
University of Michigan, Sakai Software Development Team
See Also:
Serialized Form

Field Summary
protected static String ATTR_CHAT_OBSERVER
          Tool state attribute where the chat observer is stored.
protected static String ATTR_OBSERVER
          Tool state attribute where the observer is stored.
protected static String CHAT_COMMON_ID
          Common Tool ID for the Sakai Chat Tool
 
Constructor Summary
PresenceTool()
           
 
Method Summary
 void destroy()
          Shutdown the servlet.
protected  void doGet(HttpServletRequest req, HttpServletResponse res)
          Respond to access requests.
protected  void endResponse(PrintWriter out)
          End the response
 String getServletInfo()
          Access the Servlet's information display.
 void init(ServletConfig config)
          Initialize the servlet.
protected  void sendAutoUpdate(PrintWriter out, HttpServletRequest req, String placementId, String context)
          Send the HTML / Javascript to invoke an automatic update
protected  void sendPresence(PrintWriter out, List users, List chatUsers)
          Format the list of users
protected  PrintWriter startResponse(HttpServletRequest req, HttpServletResponse res, String title)
          Start the response.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_OBSERVER

protected static final String ATTR_OBSERVER
Tool state attribute where the observer is stored.

See Also:
Constant Field Values

CHAT_COMMON_ID

protected static final String CHAT_COMMON_ID
Common Tool ID for the Sakai Chat Tool

See Also:
Constant Field Values

ATTR_CHAT_OBSERVER

protected static final String ATTR_CHAT_OBSERVER
Tool state attribute where the chat observer is stored.

See Also:
Constant Field Values
Constructor Detail

PresenceTool

public PresenceTool()
Method Detail

destroy

public void destroy()
Shutdown the servlet.


doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse res)
              throws ServletException,
                     IOException
Respond to access requests.

Parameters:
req - The servlet request.
res - The servlet response.
Throws:
ServletException.
IOException.
ServletException
IOException

endResponse

protected void endResponse(PrintWriter out)
                    throws IOException
End the response

Parameters:
out -
Throws:
IOException

getServletInfo

public String getServletInfo()
Access the Servlet's information display.

Returns:
servlet information.

init

public void init(ServletConfig config)
          throws ServletException
Initialize the servlet.

Parameters:
config - The servlet config.
Throws:
ServletException

sendAutoUpdate

protected void sendAutoUpdate(PrintWriter out,
                              HttpServletRequest req,
                              String placementId,
                              String context)
Send the HTML / Javascript to invoke an automatic update

Parameters:
out -
req -
placementId -
context -

sendPresence

protected void sendPresence(PrintWriter out,
                            List users,
                            List chatUsers)
Format the list of users

Parameters:
out -
users -

startResponse

protected PrintWriter startResponse(HttpServletRequest req,
                                    HttpServletResponse res,
                                    String title)
                             throws IOException
Start the response.

Parameters:
req -
res -
title -
Returns:
Throws:
IOException