Class DiagramService

All Implemented Interfaces:, WebService

public class DiagramService
extends java.lang.Object
implements WebService

Global data and services to help build the Residue-based Diagram web server. * In contrast to ServletCentral which is general to the whole server, this class provides specialized services that are dependant on the nature of the Diagram web service.

See Also:
Serialized Form

Method Summary
static void appendFooter(ServletCentral sc, UserSession us, org.apache.ecs.html.Body body)
          Appends the diagram footer to the page.
static WebService getInstance(ServletCentral sc)
          Returns the unique instance of DiagramService.
 PersistenceScheme getPersistenceScheme()
          Returns the persistence scheme used by the web service.
static void goStart(ServletCentral sc, javax.servlet.http.HttpServletResponse response)
          Redirects the user browser to the start page of this service.
static void needsData(ServletCentral sc, javax.servlet.http.HttpServletResponse response, java.lang.String need)
          Redirects the browser to the needsData servlet.
static javax.servlet.http.HttpSession obtainSession(ServletCentral sc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Obtains a valid session or redirects to a login URL.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static javax.servlet.http.HttpSession obtainSession(ServletCentral sc,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
Obtains a valid session or redirects to a login URL. The session is returned if it is available. When there is no existing session, the browser is redirected to a login screen that handles session allocations. The parameter dest is set in the redirection so that SessionLogin knows to which URL to redirect the browser upon succesful login connection. Put the service value in the session so that ServletCentral can find it.


public static void appendFooter(ServletCentral sc,
                                UserSession us,
                                org.apache.ecs.html.Body body)
Appends the diagram footer to the page. Gives the names of the authors and show the current login id.


public static void needsData(ServletCentral sc,
                             javax.servlet.http.HttpServletResponse response,
                             java.lang.String need)
Redirects the browser to the needsData servlet. When a servlet discovers that it does not find in the session a data that it requires to do its job, it calls this method that redirect the browser to the needsData servlet. This servlet presents to the user a list of servlet from where to start that allow to prepare the missing information. The user can make a choice, and click on the link to the appropriate servlet.
See Also:


public static void goStart(ServletCentral sc,
                           javax.servlet.http.HttpServletResponse response)
Redirects the user browser to the start page of this service.


public PersistenceScheme getPersistenceScheme()
Returns the persistence scheme used by the web service. The persistence scheme manages the allocation of session instances and objects. As such it acts as a factory for a given service.

Specified by:
getPersistenceScheme in interface WebService


public static WebService getInstance(ServletCentral sc)
Returns the unique instance of DiagramService.

Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.