|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGenericServlet
HttpServlet
TextServlet
DynaXML
TestableDynaXML
public class TestableDynaXML
Extends the DynaXML servlet to allow switching between two different representations of the same document, to allow verification that the output is the same for both of them. One version will be the SearchTree, the other is annotated using TreeAnnotater. Any exceptions will be thrown upward rather than generating an error page.
Field Summary | |
---|---|
private boolean |
dump
|
private String |
prevAnnotatedPath
|
private DocumentInfo |
prevAnnotatedTree
|
private String |
searchTerm
|
private boolean |
useAnnotated
|
Fields inherited from class DynaXML |
---|
forceLazy |
Fields inherited from class TextServlet |
---|
stylesheetCache |
Constructor Summary | |
---|---|
TestableDynaXML()
|
Method Summary | |
---|---|
protected boolean |
authenticate(DocRequest docReq,
HttpServletRequest req,
HttpServletResponse res)
Performs user authentication for a request, given the authentication info for the document. |
static void |
dumpTree(String fileName,
Source tree)
Writes out a source tree, removing things like score and rank that can reasonably vary between the annotated and SearchTree versions of a document. |
protected void |
genErrorPage(HttpServletRequest req,
HttpServletResponse res,
Exception exc)
Generate an error page based on the given exception. |
DocumentInfo |
getAnnotatedTree(String sourcePath)
Get a version of the source tree with hits marked in context by a stupid but reliable annotater. |
protected Source |
getSourceDoc(DocRequest docReq,
Transformer transformer)
Does the work of locating and loading the source document. |
void |
setDump(boolean flag)
Establishes whether to dump the tree on each iteration |
void |
setSearchTerm(String term)
Sets the term to use in text searches |
void |
useAnnotated(boolean flag)
Tells whether to use the annotated version or the SearchTree version. |
Methods inherited from class DynaXML |
---|
createDocLocator, doGet, getConfig, getConfigName, getServletInfo, readConfig, runDocReqParser, setProfiling |
Methods inherited from class HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service |
Methods inherited from class GenericServlet |
---|
destroy, 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 |
---|
private boolean useAnnotated
private boolean dump
private String prevAnnotatedPath
private DocumentInfo prevAnnotatedTree
private String searchTerm
Constructor Detail |
---|
public TestableDynaXML()
Method Detail |
---|
public void useAnnotated(boolean flag)
flag
- frue for annotated, false for SearchTreepublic void setSearchTerm(String term)
public DocumentInfo getAnnotatedTree(String sourcePath) throws IOException, SAXException, ParserConfigurationException, TransformerException
sourcePath
- Path to the document
IOException
SAXException
ParserConfigurationException
TransformerException
public static void dumpTree(String fileName, Source tree)
fileName
- File to write totree
- The document to dumppublic void setDump(boolean flag)
protected Source getSourceDoc(DocRequest docReq, Transformer transformer) throws IOException, SAXException, ParserConfigurationException
getSourceDoc
in class DynaXML
docReq
- Tells which document to load, the query to
apply, tec.transformer
- The XSLT transformer that will be used on the
document.
IOException
- If a problem is encountered loading a file or URL
SAXException
- If the document cannot be parsed as valid XML
ParserConfigurationException
- Miscellaneous configuration
problemsprotected boolean authenticate(DocRequest docReq, HttpServletRequest req, HttpServletResponse res) throws Exception
authenticate
in class DynaXML
docReq
- Info structure containing authentication parametersreq
- The request being processedres
- Where to send results if authentication fails
Exception
protected void genErrorPage(HttpServletRequest req, HttpServletResponse res, Exception exc)
genErrorPage
in class TextServlet
req
- The HTTP request we're responding tores
- The HTTP result to write toexc
- The exception producing the error. If it's a
DynaXMLException, the attributes will be passed to
the error stylesheet.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |