com.mkdoc.servlet
Class HttpQuery

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.mkdoc.servlet.AbstractMKDocServlet
                    |
                    +--com.mkdoc.servlet.AbstractStoreQueryServlet
                          |
                          +--com.mkdoc.servlet.HttpQuery
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class HttpQuery
extends AbstractStoreQueryServlet

A working draft query results servlet.

Version:
1.6 2005-11-22
Author:
Philip Shaw
See Also:
Serialized Form
To do:
Get result and cache it before rendering or dispatching.

Field Summary
 
Fields inherited from class com.mkdoc.servlet.AbstractStoreQueryServlet
manager
 
Constructor Summary
HttpQuery()
           
 
Method Summary
protected  void dispatchQuery(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Dispatch the query to the relevant results page.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Dispatch the query to the relevant results page.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get a query result from a post submission.
protected  void echoQuery(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Echo the query parameters as an SeRQL query statement.
protected  void handleDataQuery(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle a "pure data" type query.
 void init(javax.servlet.ServletConfig config)
          Get the servlet configuration.
 
Methods inherited from class com.mkdoc.servlet.AbstractStoreQueryServlet
configureStoreManager
 
Methods inherited from class com.mkdoc.servlet.AbstractMKDocServlet
filter, getApplicationContext, getFirstParam
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, 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
 

Constructor Detail

HttpQuery

public HttpQuery()
Method Detail

init

public final void init(javax.servlet.ServletConfig config)
                throws javax.servlet.ServletException
Get the servlet configuration.

The servlet configuration must include the following result page parameters:

The respective results pages should include a QueryResultTag to handle the query and result.

The servlet context must include the path of a Sesame repository and a StoreManager type with the parameter name manager.

Set a parameter named extended to true to activate extended bNode queries.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - The servlet configuration object.
Throws:
javax.servlet.ServletException - If critical configuration parameters are not set or invalid.
Since:
Version 0.1 2005-01-21
See Also:
QueryResultTag

doGet

public final void doGet(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws java.io.IOException,
                        javax.servlet.ServletException
Dispatch the query to the relevant results page.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP servlet request object.
response - The HTTP servlet response object.
Throws:
java.io.IOException - If there is a problem writing to the output stream or issuing an error response.
javax.servlet.ServletException - If there is a problem forwarding to the relevant result page.
Since:
Version 0.1 2005-01-20

handleDataQuery

protected final void handleDataQuery(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
                              throws java.io.IOException
Handle a "pure data" type query.

Parameters:
request - The servlet request object.
response - The servlet response object.
Throws:
java.io.IOException - If there is a problem rendering the results to the output stream.
Since:
Version 1.3 2005-09-12

dispatchQuery

protected final void dispatchQuery(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws java.io.IOException,
                                   javax.servlet.ServletException
Dispatch the query to the relevant results page.

Parameters:
request - The servlet request object.
response - The servlet response object.
Throws:
java.io.IOException - If there is a problem forwarding the query.
javax.servlet.ServletException - If there is a problem with the servlet to which the query is dispatched.
Since:
Version 0.9 2005-07-22

echoQuery

protected final void echoQuery(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws java.io.IOException
Echo the query parameters as an SeRQL query statement.

Parameters:
request - The servlet request object.
response - The servlet response object.
Throws:
java.io.IOException - If there is a problem handling a bad request or internal server error responses.
Since:
Version 0.9 2005-07-22

doPost

public final void doPost(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException,
                         javax.servlet.ServletException
Get a query result from a post submission.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP servlet request object.
response - The HTTP servlet response object.
Throws:
java.io.IOException - If there is a problem writing to the output stream or issuing an error response.
javax.servlet.ServletException - If there is a problem forwarding to the relevant result page.
Since:
Version 0.1 2005-01-20