|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGenericServlet
HttpServlet
TextServlet
DynaXML
public class DynaXML
Main dynaXML servlet. Processes a URL requesting a document, using the docReqParser stylesheet to parse the request and locate the document. Checks permissions based on the book being accessed and the requestor's IP address or other parameters. Performs optional text querying and search hit marking, and finally transforms the annotated document using a display stylesheet to form the final HTML result page.
Field Summary | |
---|---|
(package private) Authenticator |
authenticator
Handles authentication |
private DynaXMLConfig |
config
Holds global servlet configuration info |
private DocLocator |
docLocator
Locator used to find lazy and non-lazy document files |
protected static boolean |
forceLazy
Set to only allow lazy documents (set by TestableDynaXML only) |
Fields inherited from class TextServlet |
---|
stylesheetCache |
Constructor Summary | |
---|---|
DynaXML()
|
Method Summary | |
---|---|
private void |
apply(DocRequest docReq,
HttpServletRequest req,
HttpServletResponse res)
Loads the source document, optionally performs a text search on it, and then runs the document formatter to produce the final HTML result page. |
protected boolean |
authenticate(DocRequest docReq,
HttpServletRequest req,
HttpServletResponse res)
Performs user authentication for a request, given the authentication info for the document. |
DocLocator |
createDocLocator()
Create a DocLocator. |
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Handles the HTTP 'get' method. |
private String |
getClientIP(HttpServletRequest req)
Retrieves the IP address of the client who is requesting a page from this servlet. |
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 Source |
getSourceDoc(DocRequest docReq,
Transformer transformer)
Does the work of locating and loading the source document. |
protected TextConfig |
readConfig(String configPath)
Reads in the configuration file and sets up our helpers (caching, authentication, etc.) |
protected DocRequest |
runDocReqParser(HttpServletRequest req,
AttribList attribs)
Creates a document request by running the docReqParser stylesheet and the given attributes. |
void |
setProfiling(boolean flag)
Tells the servlet whether to perform stylesheet profiling. |
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 |
---|
Authenticator authenticator
private DynaXMLConfig config
private DocLocator docLocator
protected static boolean forceLazy
Constructor Detail |
---|
public DynaXML()
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
private String getClientIP(HttpServletRequest req)
req
- The HTTP request being processed
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
doGet
in class TextServlet
req
- The HTTP requestres
- The HTTP response
IOException
- If unable to write the output stream.protected DocRequest runDocReqParser(HttpServletRequest req, AttribList attribs) throws Exception
req
- The original HTTP requestattribs
- Attributes to pass to the stylesheet.
Exception
protected boolean authenticate(DocRequest docReq, HttpServletRequest req, HttpServletResponse res) throws Exception
docReq
- Info structure containing authentication parametersreq
- The request being processedres
- Where to send results if authentication fails
Exception
public String getServletInfo()
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
private void apply(DocRequest docReq, HttpServletRequest req, HttpServletResponse res) throws Exception
docReq
- Document information (stylesheet, source, etc.)req
- The original HTTP requestres
- Where to send the HTML response
TransformerException
- If there's an error in the stylesheet.
IOException
- If stylesheet or source can't be read.
Exception
protected Source getSourceDoc(DocRequest docReq, Transformer transformer) throws IOException, SAXException, ParserConfigurationException, InvalidDocumentException
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
problems
InvalidDocumentException
public DocLocator createDocLocator()
DefaultDocLocator
is
created.
public void setProfiling(boolean flag)
flag
- If true, subsequent XSLT transformations will be
profiled.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |