org.LexGrid.LexBIG.caCore.web.util
Class LexEVSHTTPQuery

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.LexGrid.LexBIG.caCore.web.util.LexEVSHTTPQuery
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class LexEVSHTTPQuery
extends javax.servlet.http.HttpServlet

The HTTPQuery servlet interpretes a query request and makes appropriate calls to the Application Service interface. The results are sent back to the user as an XML or HTML document based on the type of request made. XQuery like syntax is used to generate the query. Syntax: http://server:port/servlet/queryType?query=targetClassName&criteriaClassName[@attribute=value][association[@attribute=value]] Please refer to the cacore documentation for more information on generating a query request.

See Also:
Serialized Form

Field Summary
private  String cacoreStyleSheet
           
(package private)  javax.servlet.ServletContext context
           
private static org.apache.log4j.Logger log
           
private  int pageSize
           
private static long serialVersionUID
           
 
Constructor Summary
LexEVSHTTPQuery()
           
 
Method Summary
 void destroy()
          Unload servlet
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles Get requests
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handls Post requests
 org.jdom.Document getHTMLDocument(org.jdom.Document doc, String styleSheet)
          Generates an HTML Document for a given XML document with the given stylesheet specification
private  String getQuerySyntax()
          Returns the query syntax
 void init(javax.servlet.ServletConfig config)
          Initialize the servlet
private  boolean validateQuery(String query)
          This method returns true if the query syntax is valid
 org.jdom.Document XSLTTransformer(org.jdom.Document xmlDoc, InputStream styleIn)
          Generates an XML or HTML document based on a given stylesheet
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

private static org.apache.log4j.Logger log

cacoreStyleSheet

private String cacoreStyleSheet

pageSize

private int pageSize

context

javax.servlet.ServletContext context
Constructor Detail

LexEVSHTTPQuery

public LexEVSHTTPQuery()
Method Detail

init

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

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

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   IOException
Handls Post requests

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

destroy

public void destroy()
Unload servlet

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  IOException
Handles Get requests

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

getHTMLDocument

public org.jdom.Document getHTMLDocument(org.jdom.Document doc,
                                         String styleSheet)
                                  throws Exception
Generates an HTML Document for a given XML document with the given stylesheet specification

Parameters:
doc - Specifies the XML document
styleSheet - Specifies the stylesheet
Returns:
Throws:
Exception

XSLTTransformer

public org.jdom.Document XSLTTransformer(org.jdom.Document xmlDoc,
                                         InputStream styleIn)
                                  throws Exception
Generates an XML or HTML document based on a given stylesheet

Parameters:
xmlDoc - Specifies the xml document
styleIn - specifies the stylesheet
Returns:
Throws:
Exception

validateQuery

private boolean validateQuery(String query)
                       throws Exception
This method returns true if the query syntax is valid

Parameters:
query - Specifies the http query
Returns:
return
Throws:
Exception

getQuerySyntax

private String getQuerySyntax()
Returns the query syntax

Returns: