org.eclipse.ohf.stem.ui.ge.servlet
Class SlideShowServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.eclipse.ohf.stem.ui.ge.servlet.SlideShowServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SlideShowServlet
extends javax.servlet.http.HttpServlet

SlideShowServlet sends back a valid KML file for a GET or POST action

 The way that it works is this:
  
    A KML file is launched to GoogleEarth that 
    has a networklink with the following URL
    http://localhost:8080/SlideShow/slideshow?id=&folder=
    where  is a unique id
           is the directory containing the 
            kml files generated by STEM.
    
     GoogleEarth will then issue http GET requests with 
     the specified URL which will cause this servlet's 
     doGet() method to be invoked.  
     
     It retrieves the corect file in one of 2 ways:
     
     The servlet keeps a map of info keyed by the  that
     has a list of files that was found in the folder 
     and a counter that is used to send back the Nth file.
     and increment N.
     
     If a filename was specified in the URL 
       http://localhost:8080/STEM/slideshow?...file=
     then that file will be read and returned to GE.
     This file will always be the most recently generated 
     KML file.  This will help ensure that GE does not fall
     behind the STEM simulation.  
 

See Also:
Serialized Form

Field Summary
static java.lang.String CONTEXT
          Servlet context.
static boolean DEBUG
          Used by this and other servlets to control debug output
 
Constructor Summary
SlideShowServlet()
           
 
Method Summary
static void debug(java.lang.String msg)
          print debug messages to the server log.
static void error(java.lang.String msg, java.lang.Throwable e)
          debug output for exceptions
 java.io.File[] getFiles(SlideShowInfo info)
          Get the list of files in the folder
static SlideShowInfo getInfo(java.lang.String key)
          return the info instance associated with the specified key
 void init(javax.servlet.ServletConfig config)
          Handle the initial setup
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Used by this and other servlets to control debug output


CONTEXT

public static final java.lang.String CONTEXT
Servlet context.

See Also:
Constant Field Values
Constructor Detail

SlideShowServlet

public SlideShowServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Handle the initial setup

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

getFiles

public java.io.File[] getFiles(SlideShowInfo info)
Get the list of files in the folder

Parameters:
info - instance that holds misc info about session
Returns:
array of Files in the specified folder

getInfo

public static SlideShowInfo getInfo(java.lang.String key)
return the info instance associated with the specified key

Parameters:
key -
Returns:
instance of SlideShowInfo

debug

public static void debug(java.lang.String msg)
print debug messages to the server log.

Parameters:
msg -

error

public static void error(java.lang.String msg,
                         java.lang.Throwable e)
debug output for exceptions

Parameters:
msg -
e -