edu.mssm.crover.webservices.rbde
Class ShowDiagram

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--edu.mssm.crover.webservices.rbde.ShowDiagram
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ShowDiagram
extends javax.servlet.http.HttpServlet

Servlet to build a diagram in one GET connection. ShowDiagram is the front-end to call when one needs to render a diagram using only one GET connection. The diagram is returned as an image on this connection. An HTML client file would look like:

   <_img
   SRC="http://transport.physbio.mssm.edu:8080/fabien/show-diagram?TM=10-20,30-40&helices=10-20,30-40&betas=25-27&sequence=ASDFGHKLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW">
   
"_img" is to be read "img". ShowDiagram parses its arguments, creates a guest session, configures the CustomizedDiagram in the session according to the arguments, redirects the browser to the SequenceDiagramGif diagram rendering servlet. For the encoding of the parameters, sequence intervals are defined by two integers separated by '-'. The first integer gives the position of the first residue of the sequence interval, the second integer gives the position of the last residue of the interval. Positions start at zero. The following parameters are supported:

See Also:
Serialized Form

Constructor Summary
ShowDiagram()
           
 
Method Summary
 boolean cleanup(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
           
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Does whatever the parameter request to do, return an image that encodes the success or failure of the operation.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void fails(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream dest)
           
 java.awt.Image getFailureImage()
           
 java.awt.image.BufferedImage getImage(java.awt.Color color)
           
 long getLastModified(javax.servlet.http.HttpServletRequest request)
           
 javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest request)
          Returns a guest session.
 java.awt.Image getSuccessImage()
           
 void log(int level, java.lang.String msg)
           
 void log(int level, java.lang.String msg, java.lang.Exception e)
           
 boolean parseBetas(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
           
 boolean parseHelices(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
           
 boolean parseMutations(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
          Parses the mutation server out of the parameters, if provided.
 boolean parseSequence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
          Parses the residue codes out of the parameters.
 boolean parseSSE(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us, int start, int end, int type)
           
 boolean parseTM(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us, int start, int end)
           
 boolean parseTMs(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, DS_UserSession us)
           
 void succeeds(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream dest)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShowDiagram

public ShowDiagram()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Does whatever the parameter request to do, return an image that encodes the success or failure of the operation.

Overrides:
doGet in class javax.servlet.http.HttpServlet
java.io.IOException
javax.servlet.ServletException

parseMutations

public boolean parseMutations(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              DS_UserSession us)
Parses the mutation server out of the parameters, if provided.

Returns:
True for success, False for failure.

parseSequence

public boolean parseSequence(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             DS_UserSession us)
Parses the residue codes out of the parameters. Updates the session's CustomizedDiagram with the residue codes when appropriate (ie residues specified are different).

Returns:
True for success, False for failure.

parseTMs

public boolean parseTMs(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        DS_UserSession us)

parseHelices

public boolean parseHelices(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            DS_UserSession us)

parseBetas

public boolean parseBetas(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          DS_UserSession us)

parseTM

public boolean parseTM(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       DS_UserSession us,
                       int start,
                       int end)

parseSSE

public boolean parseSSE(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        DS_UserSession us,
                        int start,
                        int end,
                        int type)

cleanup

public boolean cleanup(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       DS_UserSession us)

log

public void log(int level,
                java.lang.String msg,
                java.lang.Exception e)

log

public void log(int level,
                java.lang.String msg)

fails

public void fails(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response,
                  java.io.OutputStream dest)
           throws java.io.IOException
java.io.IOException

succeeds

public void succeeds(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     java.io.OutputStream dest)
              throws java.io.IOException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Overrides:
doPost in class javax.servlet.http.HttpServlet
java.io.IOException
javax.servlet.ServletException

getLastModified

public long getLastModified(javax.servlet.http.HttpServletRequest request)
Overrides:
getLastModified in class javax.servlet.http.HttpServlet

getSession

public javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest request)
Returns a guest session.


getImage

public java.awt.image.BufferedImage getImage(java.awt.Color color)

getSuccessImage

public java.awt.Image getSuccessImage()

getFailureImage

public java.awt.Image getFailureImage()


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