|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGenericServlet
HttpServlet
TextServlet
CrossQuery
public class CrossQuery
The crossQuery servlet coordinates the process of parsing a URL query, activating the textEngine to find all occurrences, and finally formatting the results.
Field Summary | |
---|---|
protected CrossQueryConfig |
config
Holds global servlet configuration info |
protected static DecimalFormat |
decimalFormat
Used to format decimal numbers |
protected TimeProfilingListener |
profListener
Used for stylesheet profiling, if enabled |
Fields inherited from class TextServlet |
---|
stylesheetCache |
Constructor Summary | |
---|---|
CrossQuery()
|
Method Summary | |
---|---|
protected void |
apply(AttribList attribs,
HttpServletRequest req,
HttpServletResponse res)
Creates the query request, processes it, and formats the results. |
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Handles the HTTP 'get' method. |
protected void |
formatHits(String mainTagName,
HttpServletRequest req,
HttpServletResponse res,
AttribList attribs,
QueryRequest queryRequest,
QueryResult queryResult,
long startTime)
Formats a list of hits using the resultFormatter stylesheet. |
TextConfig |
getConfig()
Retrieves the current configuration information (that was read in by readConfig()). |
String |
getConfigName()
Called by the superclass to find out the name of our specific config file. |
String |
getServletInfo()
Informational method required by Servlet interface. |
protected TextConfig |
readConfig(String configPath)
Loads the specific configuration file for crossQuery. |
protected QueryRequest |
runQueryParser(HttpServletRequest req,
HttpServletResponse res,
QueryRoute route,
AttribList attribs)
Creates a query request using the queryParser stylesheet and the given attributes. |
protected QueryRoute |
runQueryRouter(HttpServletRequest req,
HttpServletResponse res,
AttribList attribs)
Creates a query request using the queryParser stylesheet and the given attributes. |
protected boolean |
shuntQueryReq(HttpServletRequest req,
HttpServletResponse res,
Source queryReqDoc)
Called right after the raw query request has been generated, but before it is parsed. |
protected String |
stepSetup(HttpServletRequest req,
HttpServletResponse res)
Checks if step mode is active and in the setup phase. |
Methods inherited from class HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service |
Methods inherited from class GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CrossQueryConfig config
protected static DecimalFormat decimalFormat
protected TimeProfilingListener profListener
Constructor Detail |
---|
public CrossQuery()
Method Detail |
---|
public String getConfigName()
getConfigName
in class TextServlet
protected TextConfig readConfig(String configPath)
readConfig
in class TextServlet
configPath
- Path to the configuration file
public TextConfig getConfig()
getConfig
in class TextServlet
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
doGet
in class TextServlet
req
- The HTTP request (in)res
- The HTTP response (out)
IOException
- If unable to read an index or data file, or
if unable to write the output stream.public String getServletInfo()
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
protected void apply(AttribList attribs, HttpServletRequest req, HttpServletResponse res) throws Exception
attribs
- Attributes to pass to the stylesheets.req
- The original HTTP requestres
- Where to send the response
Exception
- Passes on various errors that might occur.protected QueryRoute runQueryRouter(HttpServletRequest req, HttpServletResponse res, AttribList attribs) throws Exception
req
- The original HTTP requestres
- The HTTP response (used for step mode only)attribs
- Attributes to pass to the stylesheet.
Exception
protected QueryRequest runQueryParser(HttpServletRequest req, HttpServletResponse res, QueryRoute route, AttribList attribs) throws Exception
req
- The original HTTP requestres
- The HTTP response (used for step mode only)route
- Route to the query parserattribs
- Attributes to pass to the stylesheet.
Exception
protected boolean shuntQueryReq(HttpServletRequest req, HttpServletResponse res, Source queryReqDoc) throws IOException
IOException
protected void formatHits(String mainTagName, HttpServletRequest req, HttpServletResponse res, AttribList attribs, QueryRequest queryRequest, QueryResult queryResult, long startTime) throws Exception
mainTagName
- Name of the top-level tag to generate (e.g.
"crossQueryResult", etc.)req
- The original HTTP requestres
- Where to send the HTML responseattribs
- Parameters to pass to the stylesheetqueryRequest
- Query request that produced the hitsqueryResult
- Hits resulting from the query requeststartTime
- Time (in milliseconds) request began
Exception
protected String stepSetup(HttpServletRequest req, HttpServletResponse res) throws IOException
req
- The HTTP request (in)res
- The HTTP response (out)
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |