org.globus.mds.webmds
Class WebmdsServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.globus.mds.webmds.WebmdsServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class WebmdsServlet
extends javax.servlet.http.HttpServlet

Webmds servlet -- acquires some XML and applies some XSL to it. Several servlet configuration parameters control where the XML and XSL come from.

xmlSources
a space-separated list of sourceNames -- short names of sources of XML. These names will appear in other configuration parameters.
info
A sourceName specifying where the information to be displayed should come from.
xsl
A sourceName specifying where the xml transform (that will be applied to the information) will come from.
xmlSource.sourceName.class
the name a class that implements the WebmdsXmlSource interface. This class will be to be used to acquire XML if sourceName is specified as an info or xsl parameter
xmlSource.sourceName.param.class_specific_params
additional parameters to be passed to the xmlSource.sourceName.class. When these parameters are passed, the class_specific_params names will be used (i.e., the "xmlSource.sourceName.param." prefix will be stripped off).

See Also:
WebmdsXmlSource, Serialized Form

Field Summary
static java.lang.String BASE_DIRECTORY_NAME
           
private  WebmdsConfigEntry[] configEntryArray
           
static java.lang.String INFO_SOURCE_ARG_NAME
           
private static java.lang.String INFO_SOURCE_INFO_XSL_PARAM
           
private  ParameterMap initParameters
           
static java.lang.String REQUEST_XSL_PARAM_PREFIX
           
private static java.lang.String URI_XSL_PARAM
           
private  WebmdsUtil webmdsUtil
           
private static java.lang.String XML_CONFIG_DIRECTORY_NAME
           
static java.lang.String XSL_SOURCE_ARG_NAME
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
WebmdsServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Respond to a GET request for the content produced by this servlet.
private  WebmdsConfigEntry findConfigEntry(java.lang.String sourceName)
           
private  ParameterMap getRequestParameters(javax.servlet.http.HttpServletRequest request)
           
private  javax.xml.transform.Source getSource(java.lang.String sourceName, WebmdsXmlSource webmdsXmlSource, ParameterMap requestParams)
           
private  WebmdsXmlSource getXmlSource(java.lang.String sourceName, boolean checkXSL)
           
 void init(javax.servlet.ServletConfig config)
          Initialize the servlet (read configuration).
private  WebmdsConfigEntry initWebmdsConfigEntry(java.io.File configFile)
           
private  java.lang.String nonXslURIString(javax.servlet.http.HttpServletRequest request, ParameterMap paramMap)
          nonXslURIString -- returns a URI that consists of the base URI without the xsl-specific parameters ("xsl", "xslParam", etc.);
private  void setXslParameters(javax.xml.transform.Transformer transformer, ParameterMap paramMap)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_CONFIG_DIRECTORY_NAME

private static final java.lang.String XML_CONFIG_DIRECTORY_NAME
See Also:
Constant Field Values

INFO_SOURCE_ARG_NAME

public static final java.lang.String INFO_SOURCE_ARG_NAME
See Also:
Constant Field Values

XSL_SOURCE_ARG_NAME

public static final java.lang.String XSL_SOURCE_ARG_NAME
See Also:
Constant Field Values

REQUEST_XSL_PARAM_PREFIX

public static final java.lang.String REQUEST_XSL_PARAM_PREFIX
See Also:
Constant Field Values

URI_XSL_PARAM

private static final java.lang.String URI_XSL_PARAM
See Also:
Constant Field Values

INFO_SOURCE_INFO_XSL_PARAM

private static final java.lang.String INFO_SOURCE_INFO_XSL_PARAM
See Also:
Constant Field Values

BASE_DIRECTORY_NAME

public static final java.lang.String BASE_DIRECTORY_NAME
See Also:
Constant Field Values

initParameters

private ParameterMap initParameters

configEntryArray

private WebmdsConfigEntry[] configEntryArray

webmdsUtil

private WebmdsUtil webmdsUtil
Constructor Detail

WebmdsServlet

public WebmdsServlet()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Respond to a GET request for the content produced by this servlet.

Parameters:
request - The servlet request we are processing
response - The servlet response we are producing
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs

init

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

Throws:
javax.servlet.ServletException

initWebmdsConfigEntry

private WebmdsConfigEntry initWebmdsConfigEntry(java.io.File configFile)
                                         throws javax.servlet.ServletException,
                                                java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getXmlSource

private WebmdsXmlSource getXmlSource(java.lang.String sourceName,
                                     boolean checkXSL)
                              throws WebmdsException
Throws:
WebmdsException

getSource

private javax.xml.transform.Source getSource(java.lang.String sourceName,
                                             WebmdsXmlSource webmdsXmlSource,
                                             ParameterMap requestParams)
                                      throws javax.servlet.ServletException,
                                             java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

findConfigEntry

private WebmdsConfigEntry findConfigEntry(java.lang.String sourceName)

getRequestParameters

private ParameterMap getRequestParameters(javax.servlet.http.HttpServletRequest request)
                                   throws ParameterMapException
Throws:
ParameterMapException

setXslParameters

private void setXslParameters(javax.xml.transform.Transformer transformer,
                              ParameterMap paramMap)
                       throws WebmdsException
Throws:
WebmdsException

nonXslURIString

private java.lang.String nonXslURIString(javax.servlet.http.HttpServletRequest request,
                                         ParameterMap paramMap)
nonXslURIString -- returns a URI that consists of the base URI without the xsl-specific parameters ("xsl", "xslParam", etc.);