Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class 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)

    Inheritance
    object
    QueryTemplateManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.QueryParsers.Xml
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public class QueryTemplateManager

    Constructors

    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)

    Declaration
    public QueryTemplateManager()

    QueryTemplateManager(Stream)

    This class makes a virtual AddDefaultQueryTemplate call. If you need to subclass it and make this call at a time when it suits you, use QueryTemplateManager() instead

    Declaration
    public QueryTemplateManager(Stream xslIs)
    Parameters
    Type Name Description
    Stream xslIs

    Methods

    AddDefaultQueryTemplate(Stream)

    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)

    Declaration
    public virtual void AddDefaultQueryTemplate(Stream xslIs)
    Parameters
    Type Name Description
    Stream xslIs

    AddQueryTemplate(string, Stream)

    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)

    Declaration
    public virtual void AddQueryTemplate(string name, Stream xslIs)
    Parameters
    Type Name Description
    string name
    Stream xslIs

    GetQueryAsDOM(IDictionary<string, string>)

    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)

    Declaration
    public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    Returns
    Type Description
    XmlDocument

    GetQueryAsDOM(IDictionary<string, string>, Stream)

    Slow means of constructing query - parses stylesheet from input stream

    Declaration
    public static XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, Stream xslIs)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    Stream xslIs
    Returns
    Type Description
    XmlDocument

    GetQueryAsDOM(IDictionary<string, string>, string)

    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)

    Declaration
    public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, string queryTemplateName)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    string queryTemplateName
    Returns
    Type Description
    XmlDocument

    GetQueryAsDOM(IDictionary<string, string>, XslCompiledTransform)

    Fast means of constructing query using a cached,precompiled stylesheet

    Declaration
    public static XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, XslCompiledTransform template)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    XslCompiledTransform template
    Returns
    Type Description
    XmlDocument

    GetQueryAsXmlString(IDictionary<string, string>)

    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)

    Declaration
    public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    Returns
    Type Description
    string

    GetQueryAsXmlString(IDictionary<string, string>, Stream)

    Slow means of constructing query parsing a stylesheet from an input stream

    Declaration
    public static string GetQueryAsXmlString(IDictionary<string, string> formProperties, Stream xslIs)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    Stream xslIs
    Returns
    Type Description
    string

    GetQueryAsXmlString(IDictionary<string, string>, string)

    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)

    Declaration
    public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties, string queryTemplateName)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    string queryTemplateName
    Returns
    Type Description
    string

    GetQueryAsXmlString(IDictionary<string, string>, XslCompiledTransform)

    Fast means of constructing query using a precompiled stylesheet

    Declaration
    public static string GetQueryAsXmlString(IDictionary<string, string> formProperties, XslCompiledTransform template)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    XslCompiledTransform template
    Returns
    Type Description
    string

    GetTemplates(Stream)

    Parses a query stylesheet for repeated use

    Declaration
    public static XslCompiledTransform GetTemplates(Stream xslIs)
    Parameters
    Type Name Description
    Stream xslIs
    Returns
    Type Description
    XslCompiledTransform

    TransformCriteria(IDictionary<string, string>, Stream, Stream)

    Slower transformation using an uncompiled stylesheet (suitable for development environment)

    Declaration
    public static void TransformCriteria(IDictionary<string, string> formProperties, Stream xslIs, Stream result)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    Stream xslIs
    Stream result

    TransformCriteria(IDictionary<string, string>, XslCompiledTransform, Stream)

    Fast transformation using a pre-compiled stylesheet (suitable for production environments)

    Declaration
    public static void TransformCriteria(IDictionary<string, string> formProperties, XslCompiledTransform transformer, Stream result)
    Parameters
    Type Name Description
    IDictionary<string, string> formProperties
    XslCompiledTransform transformer
    Stream result
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.