Home » lucene-3.0.1-src » org.apache » lucene » xmlparser » [javadoc | source]
org.apache.lucene.xmlparser
public class: QueryTemplateManager [javadoc | source]
java.lang.Object
   org.apache.lucene.xmlparser.QueryTemplateManager
Provides utilities for turning query form input (such as from a web page or Swing gui) into Lucene XML queries by using XSL templates. This approach offers a convenient way of externalizing and changing how user input is turned into Lucene queries. Database applications often adopt similar practices by externalizing SQL in template files that can be easily changed/optimized by a DBA. The static methods can be used on their own or by creating an instance of this class you can store and re-use compiled stylesheets for fast use (e.g. in a server environment)
Field Summary
static  DocumentBuilderFactory dbf     
static  TransformerFactory tFactory     
 HashMap<String, Templates> compiledTemplatesCache     
 Templates defaultCompiledTemplates     
Constructor:
 public QueryTemplateManager() 
 public QueryTemplateManager(InputStream xslIs) throws TransformerConfigurationException, ParserConfigurationException, SAXException, IOException 
Method from org.apache.lucene.xmlparser.QueryTemplateManager Summary:
addDefaultQueryTemplate,   addQueryTemplate,   getQueryAsDOM,   getQueryAsDOM,   getQueryAsDOM,   getQueryAsDOM,   getQueryAsXmlString,   getQueryAsXmlString,   getQueryAsXmlString,   getQueryAsXmlString,   getTemplates,   transformCriteria,   transformCriteria,   transformCriteria
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.xmlparser.QueryTemplateManager Detail:
 public  void addDefaultQueryTemplate(InputStream xslIs) throws TransformerConfigurationException, ParserConfigurationException, SAXException, IOException 
 public  void addQueryTemplate(String name,
    InputStream xslIs) throws TransformerConfigurationException, ParserConfigurationException, SAXException, IOException 
 public Document getQueryAsDOM(Properties formProperties) throws SAXException, IOException, ParserConfigurationException, TransformerException 
 public Document getQueryAsDOM(Properties formProperties,
    String queryTemplateName) throws SAXException, IOException, ParserConfigurationException, TransformerException 
 public static Document getQueryAsDOM(Properties formProperties,
    Templates template) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Fast means of constructing query using a cached,precompiled stylesheet
 public static Document getQueryAsDOM(Properties formProperties,
    InputStream xslIs) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Slow means of constructing query - parses stylesheet from input stream
 public String getQueryAsXmlString(Properties formProperties) throws SAXException, IOException, ParserConfigurationException, TransformerException 
 public String getQueryAsXmlString(Properties formProperties,
    String queryTemplateName) throws SAXException, IOException, ParserConfigurationException, TransformerException 
 public static String getQueryAsXmlString(Properties formProperties,
    Templates template) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Fast means of constructing query using a precompiled stylesheet
 public static String getQueryAsXmlString(Properties formProperties,
    InputStream xslIs) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Slow means of constructing query parsing a stylesheet from an input stream
 public static Templates getTemplates(InputStream xslIs) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException 
    Parses a query stylesheet for repeated use
 public static  void transformCriteria(Properties formProperties,
    InputStream xslIs,
    Result result) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Slower transformation using an uncompiled stylesheet (suitable for development environment)
 public static  void transformCriteria(Properties formProperties,
    Templates template,
    Result result) throws SAXException, IOException, ParserConfigurationException, TransformerException 
    Fast transformation using a pre-compiled stylesheet (suitable for production environments)
 public static  void transformCriteria(Properties formProperties,
    Transformer transformer,
    Result result) throws SAXException, IOException, ParserConfigurationException, TransformerException