com.raritantechnologies.searchApp.database
Class DatabaseOutputProcessor

java.lang.Object
  extended bycom.raritantechnologies.searchApp.database.DatabaseOutputProcessor
All Implemented Interfaces:
IConfigurable, IGatewayOutputProcessor, IResultSetProcessor

public class DatabaseOutputProcessor
extends java.lang.Object
implements IGatewayOutputProcessor, IResultSetProcessor

Stores RTI ResultSets in a RDBMS using the RTI adhoc table schema developed for the RTI eCommerce framework.

XML Configuration Template:
  <GatewayOutputProcessor 
         class="com.raritantechnologies.searchApp.database.DatabaseOutputProcessor"
         connectionManager="[Database connection manager SystemObject name]"
         queryManager="[query manager SystemObject name]"
         itemIDField="[ name of IResult field with item ID (key) ]"
         userNameField="[IResult field to get userName]"
         defaultUserName"[userName if result userName field is empty]"
         resultNameField="[IResult field to get result name]"
         defaultResultName="[name if result name field is empty]"
         descriptionField="[IResult field to get description]"
         defaultDescription="[description to use if result desc field is empty]"
         sourceNameField="[field name to store source name]" >

   <!-- Use Columns for RTI Adhoc table structure: -->
   <Columns sub_type="[subtype value or $parameter ]">
     <Column ID="[field to save]" />
     <Column ID="[another field]" />
   </Columns>

   <!-- Alternatively: use SQLTemplates to store result data in a set of DB tables             -->
   <!-- Set of SQL Templates that are used to store data in tables. Placeholders are           -->
   <!-- Used to map result fields to table columns (e.g. {FIELDNAME} maps the 'FIELDNAME' field -->
   <!-- in the result to the first column in the INSERT statement                              -->
   <SQLTemplates>

      <CheckTable>
        <DescribeTable>

        </DescribeTable>

        <CreateTable>

        </CreateTable>
      </CheckTable>

      <SQLTemplate>INSERT INTO TABLE_NAME VALUES ( {FiELDNAME}, {FIELDNAME2}, {FIELDNAME3} )

      <ChoiceTemplate>
        <Test>select * from TABLE_NAME where FIELDNAME = {FIELDNAME}</Test>

        <NullTemplates>
          <SQLTemplate>[ SQL Statement to run if test is NULL ]
        </NullTemplates>

        <UpdateTemplates>
          <SQLTemplate>[ SQL Statement to run it test is NOT NULL ]</SQLTemplate>
        </UpdateTemplates>

      </ChoiceTemplate>

   <SQLTemplates>

 </GatewayOutputProcessor>
 


Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
static java.lang.String ITEM_TABLE
           
static java.lang.String PROP_TABLE
           
static java.lang.String RESULT_TYPE
           
 
Constructor Summary
DatabaseOutputProcessor()
           
 
Method Summary
 void dataComplete()
          Data feed is complete.
 java.lang.String getConfigurationXML()
           
 void initialize(org.w3c.dom.Element elem)
          Initialize the from XML Element.
 void initialize(org.w3c.dom.Element outputProcElem, ISearchFieldMap sfMap)
          Initialize the GatewayOutputProcessor from XML Configuration Element.
 void initialize(java.util.Map initParams)
          Used for dynamic initialization (connection, collection name, file name, etc.)
 java.lang.String processData(IResultSet data)
          returns name of XML File created/appended.
 void processResultSet(java.lang.String sessionID, IResultSet data)
          processes the IResultSet (somehow)
 void setConnectionManagerName(java.lang.String connectionManagerName)
           
 void setItemIDField(java.lang.String itemIDField)
           
 void setQueryManagerName(java.lang.String queryManagerName)
           
 void setSQLTemplates(java.util.List SQLTemplates)
           
 void storeResult(IResult res)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULT_TYPE

public static final java.lang.String RESULT_TYPE
See Also:
Constant Field Values

ITEM_TABLE

public static java.lang.String ITEM_TABLE

PROP_TABLE

public static java.lang.String PROP_TABLE
Constructor Detail

DatabaseOutputProcessor

public DatabaseOutputProcessor()
Method Detail

processResultSet

public void processResultSet(java.lang.String sessionID,
                             IResultSet data)
Description copied from interface: IResultSetProcessor
processes the IResultSet (somehow)

Specified by:
processResultSet in interface IResultSetProcessor

processData

public java.lang.String processData(IResultSet data)
Description copied from interface: IGatewayOutputProcessor
returns name of XML File created/appended.

Specified by:
processData in interface IGatewayOutputProcessor

storeResult

public void storeResult(IResult res)

dataComplete

public void dataComplete()
Data feed is complete.

Specified by:
dataComplete in interface IGatewayOutputProcessor

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultSetProcessor
Initialize the from XML Element.

Specified by:
initialize in interface IResultSetProcessor

initialize

public void initialize(org.w3c.dom.Element outputProcElem,
                       ISearchFieldMap sfMap)
Description copied from interface: IGatewayOutputProcessor
Initialize the GatewayOutputProcessor from XML Configuration Element.

Specified by:
initialize in interface IGatewayOutputProcessor

initialize

public void initialize(java.util.Map initParams)
Description copied from interface: IGatewayOutputProcessor
Used for dynamic initialization (connection, collection name, file name, etc.)

Specified by:
initialize in interface IGatewayOutputProcessor

getConfigurationXML

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

setConnectionManagerName

public void setConnectionManagerName(java.lang.String connectionManagerName)

setQueryManagerName

public void setQueryManagerName(java.lang.String queryManagerName)

setItemIDField

public void setItemIDField(java.lang.String itemIDField)

setSQLTemplates

public void setSQLTemplates(java.util.List SQLTemplates)