org.cdlib.xtf.dynaXML
Interface DocLocator

All Known Implementing Classes:
DefaultDocLocator

public interface DocLocator

Iterface that locates lazy or normal data streams for dynaXML document requests. The default implementation, DefaultDocLocator, implements local file access, but other implementations can be imagined that read/write files over the network.

Author:
Martin Haye

Method Summary
 InputSource getInputSource(String sourcePath, boolean removeDoctypeDecl)
          Retrieve the data stream for an XML source document.
 StructuredStore getLazyStore(String indexConfigPath, String indexName, String sourcePath, Templates preFilter, boolean removeDoctypeDecl)
          Search for a StructuredStore containing the "lazy" or persistent representation of a given document.
 void setServlet(TextServlet servlet)
          Attach this locator to a specific servlet, which can be used to provide, among other thigns, path mapping services.
 

Method Detail

setServlet

void setServlet(TextServlet servlet)
Attach this locator to a specific servlet, which can be used to provide, among other thigns, path mapping services.

Parameters:
servlet - Servlet to attach to

getLazyStore

StructuredStore getLazyStore(String indexConfigPath,
                             String indexName,
                             String sourcePath,
                             Templates preFilter,
                             boolean removeDoctypeDecl)
                             throws IOException
Search for a StructuredStore containing the "lazy" or persistent representation of a given document. Index parameters are specified, since often the lazy file is stored along with the index. This method is called first, and if it returns null, then getInputSource(String, boolean) will be called as a fall-back.

Parameters:
sourcePath - Path to the source document
indexConfigPath - Path to the index configuration file
indexName - Name of the index being searched
preFilter - Stylesheet to filter the document with
removeDoctypeDecl - Set to true to remove DOCTYPE declaration from the XML document.
Returns:
Store containing the tree, or null if none could be found.
Throws:
IOException

getInputSource

InputSource getInputSource(String sourcePath,
                           boolean removeDoctypeDecl)
                           throws IOException
Retrieve the data stream for an XML source document.

Parameters:
sourcePath - Path to the source document
removeDoctypeDecl - Set to true to remove DOCTYPE declaration from the XML document.
Returns:
Data stream for the document.
Throws:
IOException