atg.repository.search.indexing.config
Class SearchUpdateXMLGenerator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.search.indexing.config.SearchUpdateXMLGenerator
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SearchUpdateXMLGenerator
extends GenericService

The SearchUpdateXMLGenerator is a Nucleus service that takes a list of SearchUpdateOutputProperty item and creates XML for the search engine. This XML uses the schema defined by ATG Search. The generator creates a W3C DOM object and uses Java's built in XML classes to create the XML stream from DOM Document. This can also be changed by setting the "transformer" property, or subclassing and extending the "transformToXML" method.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SearchUpdateXMLGenerator()
           
 
Method Summary
protected  org.w3c.dom.Document createDocument()
          Create a new DOM document, using the document builder.
protected  void createPropertyElement(SearchUpdateOutputProperty pProperty, org.w3c.dom.Element pPropertyReportType, org.w3c.dom.Document pDocument)
          Creates property element
protected  void createPropertyReportElement(java.util.List pProperties, org.w3c.dom.Element pQueryReport, org.w3c.dom.Document pDocument)
          creates property report element
protected  void createQueryReportElement(java.util.List pProperties, org.w3c.dom.Document pDocument)
          creates query report element
 void generateXMLForProperties(java.lang.String pId, java.util.List pProperties, java.io.OutputStream pOut)
          Generates query report XML into the output stream.
 java.io.File getDestinationDirectory()
           
 javax.xml.parsers.DocumentBuilder getDocumentBuilder()
           
 javax.xml.transform.Transformer getTransformer()
          Gets the XML Transformer that will generate the XML stream from a DOM tree.
 void setDestinationDirectory(java.io.File pDestinationDirectory)
           
 void setDocumentBuilder(javax.xml.parsers.DocumentBuilder pDocumentBuilder)
          Sets the document builder that will be used to create DOM documents.
 void setTransformer(javax.xml.transform.Transformer pTransformer)
          Sets the XML Transformer that will generate the XML stream from a DOM tree.
protected  void transformToXML(org.w3c.dom.Document pDocument, java.io.OutputStream pOut)
          Transform a DOM Document object to an XML output stream.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

SearchUpdateXMLGenerator

public SearchUpdateXMLGenerator()
Method Detail

getDestinationDirectory

public java.io.File getDestinationDirectory()

setDestinationDirectory

public void setDestinationDirectory(java.io.File pDestinationDirectory)

getTransformer

public javax.xml.transform.Transformer getTransformer()
Gets the XML Transformer that will generate the XML stream from a DOM tree. If no transformer is set, this method will provide a default.


setTransformer

public void setTransformer(javax.xml.transform.Transformer pTransformer)
Sets the XML Transformer that will generate the XML stream from a DOM tree.


setDocumentBuilder

public void setDocumentBuilder(javax.xml.parsers.DocumentBuilder pDocumentBuilder)
Sets the document builder that will be used to create DOM documents.


getDocumentBuilder

public javax.xml.parsers.DocumentBuilder getDocumentBuilder()

createDocument

protected org.w3c.dom.Document createDocument()
Create a new DOM document, using the document builder.


createPropertyElement

protected void createPropertyElement(SearchUpdateOutputProperty pProperty,
                                     org.w3c.dom.Element pPropertyReportType,
                                     org.w3c.dom.Document pDocument)
Creates property element


createPropertyReportElement

protected void createPropertyReportElement(java.util.List pProperties,
                                           org.w3c.dom.Element pQueryReport,
                                           org.w3c.dom.Document pDocument)
creates property report element


createQueryReportElement

protected void createQueryReportElement(java.util.List pProperties,
                                        org.w3c.dom.Document pDocument)
creates query report element


transformToXML

protected void transformToXML(org.w3c.dom.Document pDocument,
                              java.io.OutputStream pOut)
Transform a DOM Document object to an XML output stream.


generateXMLForProperties

public void generateXMLForProperties(java.lang.String pId,
                                     java.util.List pProperties,
                                     java.io.OutputStream pOut)
                              throws SearchUpdateException
Generates query report XML into the output stream.

Parameters:
pId - String identifier for this xml - used for logging/debug
pProperties - List of SearchUpdateOutputProperty objects to use to generate XML.
pOut - output stream
Throws:
SearchUpdateException