com.raritantechnologies.searchApp.query
Class DBQueryResultSetWriter
java.lang.Object
com.raritantechnologies.searchApp.query.DBQueryResultSetWriter
- All Implemented Interfaces:
- IConfigurable, IQueryResultSetWriter
- public class DBQueryResultSetWriter
- extends java.lang.Object
- implements IQueryResultSetWriter
Saves queries and result statistics to persistent storage.
XML Configuration Template:
<QueryResultSetWriter class="com.raritantechnologies.searchApp.query.DBQueryResultSetWriter"
name="[its name]"
connectionManager="[name of IDatabaseConnectionManager SystemObject]"
queryManager="[name of the SQLQueryManager]"
applicationName="[ name of application using this reader ]"
readSQL="[ SQL template for reading data ]"
insertSQL="[ SQL template for inserting data ]"
updateSQL="[ SQL template for updating data ]"
deleteSQL="[ SQL template for deleting data ]" >
<!-- Optional QueryParser to format the query before saving -->
<QueryParser class="[ class of com.raritantechnologies.searchApp.IQueryParser ]" >
</QueryParser>
<!-- Matches the columns in the adhoc parameters map with the database -->
<AdhocColumns>
<Column Field="[ field name]" SQL="[ ]" />
<Column ID="SessionID" />
<Column ID="USER_NAME" />
<Column ID="query" />
<Column ID="category" />
<Column ID="QUERY_ID" />
<Column ID="TOTAL_DOCS" />
<Column ID="RESP_TIME" />
<Column ID="SOURCE_NAMES" />
</AdhocColumns>
<!-- Set of SQL query fields to be saved -->
<QueryFields>
</QueryFields>
<DateFormatter outputFormat="MM/dd/yy" />
<WriterSQL SQL="[sql]" />
</QueryResultSetWriter>
Developed by
Raritan Technologies .
- Author:
- Chris Peterson, Alan Connell
|
Field Summary |
static boolean |
DEBUG
|
static java.lang.String |
IS_ALERT
|
| Fields inherited from interface com.raritantechnologies.searchApp.query.IQueryResultSetWriter |
ADHOC, APPLICATION_NAME, DATE, IGNORE_COLUMN, PAGE_SIZE, QUERY_ID, QUERY_NAME, RESP_TIME, ROLE_NAME, SESSION_ID, SOURCE_NAMES, START_REC, TOTAL_DOCS, USER_NAME |
|
Method Summary |
void |
deleteQuery(RaritanPageContext pageContext,
java.lang.Integer queryID)
|
void |
deleteQuery(RaritanPageContext pageContext,
java.util.Map adhocParams)
|
static java.lang.String |
escapeSqlValue(java.lang.String s)
|
java.lang.Integer |
getNextID()
|
java.lang.String[] |
getSavedFields()
|
void |
initialize(org.w3c.dom.Element elem)
Initializes the object from an XML tag or element. |
void |
modifyQuery(RaritanPageContext pageContext,
QueryResultBean queryResultBean)
|
void |
modifyQuery(RaritanPageContext pageContext,
java.lang.String queryID,
java.util.HashMap params)
|
void |
modifyQuery(RaritanPageContext pageContext,
java.lang.String queryID,
java.lang.String paramName,
java.lang.String paramValue,
boolean isAdhocParam)
|
void |
saveQueries(RaritanPageContext pageContext,
QueryResultBeanSet querySet)
|
void |
saveQuery(QueryRunner qr,
QueryResultBean qrb)
|
void |
saveQuery(RaritanPageContext pageContext,
QueryResultBean qrb)
|
void |
setQueryParser(IQueryParser queryParser)
Set the queryParser to be used to transform the query before it is written
to the persistent source. |
void |
setSavedFields(java.lang.String[] savedFields)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
IS_ALERT
public static final java.lang.String IS_ALERT
- See Also:
- Constant Field Values
DBQueryResultSetWriter
public DBQueryResultSetWriter()
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 IQueryResultSetWriter
setQueryParser
public void setQueryParser(IQueryParser queryParser)
- Description copied from interface:
IQueryResultSetWriter
- Set the queryParser to be used to transform the query before it is written
to the persistent source.
- Specified by:
setQueryParser in interface IQueryResultSetWriter
getNextID
public java.lang.Integer getNextID()
- Specified by:
getNextID in interface IQueryResultSetWriter
getSavedFields
public java.lang.String[] getSavedFields()
- Specified by:
getSavedFields in interface IQueryResultSetWriter
setSavedFields
public void setSavedFields(java.lang.String[] savedFields)
- Specified by:
setSavedFields in interface IQueryResultSetWriter
saveQueries
public void saveQueries(RaritanPageContext pageContext,
QueryResultBeanSet querySet)
- Specified by:
saveQueries in interface IQueryResultSetWriter
saveQuery
public void saveQuery(RaritanPageContext pageContext,
QueryResultBean qrb)
- Specified by:
saveQuery in interface IQueryResultSetWriter
deleteQuery
public void deleteQuery(RaritanPageContext pageContext,
java.lang.Integer queryID)
- Specified by:
deleteQuery in interface IQueryResultSetWriter
deleteQuery
public void deleteQuery(RaritanPageContext pageContext,
java.util.Map adhocParams)
- Specified by:
deleteQuery in interface IQueryResultSetWriter
modifyQuery
public void modifyQuery(RaritanPageContext pageContext,
QueryResultBean queryResultBean)
- Specified by:
modifyQuery in interface IQueryResultSetWriter
modifyQuery
public void modifyQuery(RaritanPageContext pageContext,
java.lang.String queryID,
java.lang.String paramName,
java.lang.String paramValue,
boolean isAdhocParam)
- Specified by:
modifyQuery in interface IQueryResultSetWriter
modifyQuery
public void modifyQuery(RaritanPageContext pageContext,
java.lang.String queryID,
java.util.HashMap params)
- Specified by:
modifyQuery in interface IQueryResultSetWriter
saveQuery
public void saveQuery(QueryRunner qr,
QueryResultBean qrb)
escapeSqlValue
public static java.lang.String escapeSqlValue(java.lang.String s)