com.raritantechnologies.searchApp.reporting
Class TopQueryReporter

java.lang.Object
  extended bycom.raritantechnologies.searchApp.reporting.TopQueryReporter
All Implemented Interfaces:
IConfigurable, IJobProcess, IReportingProcess

public class TopQueryReporter
extends java.lang.Object
implements IReportingProcess

Reporting process that builds a sorted list of the "top" queries based on Date, number of hits, number of tries, etc.

Reporter uses a IQueryResultSetReader to read a set of queries from a persistent store (Database or file).

Reporter can use an IQueryFormatter to format each individual query or an IQueryResultSetFormatter ( for example a QueryResultSetChartFormatter) to format a set of queries.

An optional DateTimePeriod can be used to restrict the report to a set time period.

XML Configuration Template:
    <JobProcess processClass="com.raritantechnologies.searchApp.reporting.TopQueryReporter"
                   numberOfRows="10" 
                   sortBy="DATE|RESULTS|QUERIES|CURRENT_RESULTS|TIME"
                   sortDir="asc|desc"
                   appendCounts="true|false"
                   outputFileLocation="[ some path to put file ]"
                   outputFileFormat="HTML_PAGE/HTML_TABLE/TEXT/XML"
                   searchSources="optional search sources to use" >

       <QueryResultSetReader class="[some IQueryResultSetReader class]" >
         <!-- QueryResultSetReader params . . . -->
       </QueryResultSetReader>

       <RowHeader></RowHeader>
       <RowTrailer></RowTrailer>

       <QueryFormatter class="com.raritantechnologies.searchApp.query.HyperlinkQueryFormatter"
                          host="/" action="somePage.jsp" label="some label" >

       </QueryFormatter>

       <!-- OR - use an IQueryResultSetFormatter -->

       <QuerySetFormatter class="[implementation of IQueryResultSetFormatter]" >

       </QuerySetFormatter>

       <!-- Optional time series: will get results for set of specified days. -->
       <TimeSeries>
          <DateTimePeriod period="last 1 day" />
          <DateTimePeriod period="1 to 7 days ago" />
          <DateTimePeriod period="1 to 4 weeks ago" />
          <DateTimePeriod period="1 to 12 months ago" />

          <DateSearchField name="from" dateFieldID="" dateOpField="MOD_" greaterThanOp="GTE" />

       </TimeSeries>
   </JobProcess>
  

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
TopQueryReporter()
           
TopQueryReporter(java.lang.String outputFormat, IReporter reporter)
           
 
Method Summary
 void executeJob(RaritanPageContext rpc)
           
 void executeJob(java.lang.String[] args)
          Runs the Top Query reporting process.
 void executeJob(java.lang.String sessionID, IReporter reporter, SourceLoginInfo[] sources, OrderedMap searchParams, java.lang.String[] args)
           
 java.lang.String getConfigurationXML()
           
 IReporter getReporter()
          returns the IReporter used by this reporting process.
protected  java.lang.String getRowHeader()
           
protected  java.lang.String getRowTrailer()
           
 SourceLoginInfo[] getSearchSources()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setReporter(IReporter reporter)
          sets the Reporter to use for data output handling.
 void setSearchParams(OrderedMap searchParams)
           
 void setSearchSources(SourceLoginInfo[] sources)
           
 void setSessionID(java.lang.String sessionID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopQueryReporter

public TopQueryReporter()

TopQueryReporter

public TopQueryReporter(java.lang.String outputFormat,
                        IReporter reporter)
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IJobProcess

executeJob

public void executeJob(RaritanPageContext rpc)
Specified by:
executeJob in interface IJobProcess

executeJob

public void executeJob(java.lang.String[] args)
Runs the Top Query reporting process. If time periods are set, executes getTimedResultSets on the QueryResultBeanSet.

Specified by:
executeJob in interface IJobProcess

executeJob

public void executeJob(java.lang.String sessionID,
                       IReporter reporter,
                       SourceLoginInfo[] sources,
                       OrderedMap searchParams,
                       java.lang.String[] args)
Specified by:
executeJob in interface IReportingProcess

getRowHeader

protected java.lang.String getRowHeader()

getRowTrailer

protected java.lang.String getRowTrailer()

setReporter

public void setReporter(IReporter reporter)
Description copied from interface: IReportingProcess
sets the Reporter to use for data output handling.

Specified by:
setReporter in interface IReportingProcess
Parameters:
reporter - The IReporter object that will handle data saving etc.

getReporter

public IReporter getReporter()
Description copied from interface: IReportingProcess
returns the IReporter used by this reporting process.

Specified by:
getReporter in interface IReportingProcess

setSearchSources

public void setSearchSources(SourceLoginInfo[] sources)
Specified by:
setSearchSources in interface IReportingProcess

getSearchSources

public SourceLoginInfo[] getSearchSources()
Specified by:
getSearchSources in interface IReportingProcess

setSearchParams

public void setSearchParams(OrderedMap searchParams)
Specified by:
setSearchParams in interface IReportingProcess

setSessionID

public void setSessionID(java.lang.String sessionID)
Specified by:
setSessionID in interface IReportingProcess

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IJobProcess