com.raritantechnologies.verity.collection
Class QueryProcessorXMLGateway

java.lang.Object
  extended bycom.raritantechnologies.verity.collection.QueryProcessorXMLGateway
All Implemented Interfaces:
ICollectionGateway, java.lang.Runnable

public class QueryProcessorXMLGateway
extends java.lang.Object
implements ICollectionGateway

Builds XML records from a search source or sources. Uses a set of queries to generate results which are then formatted into XML records. Can create XML with multiple levels, possibly from multiple search sources.

XML Configuration Template:
 <CollectionGateway name="QProc_1" class="com.raritantechnologies.verity.collection.QueryProcessorXMLGateway"
                       useCDataWrapper="true|false(default)"
                       maxDocs="[ maximum  number of documents to process ]"
                       pageSize="[ size of result sets ]" >

   <QueryList>
     <Query>KY=hypertension|foo=bar</Query>
   </QueryList>

   <RecordSchema rootElement="Records" >
     <Element tagname="Record" sourceName="filteredMedline" >
        <!-- '+' character = concatenate field values -->
        <Element tagname="VdkVgwKey" fieldID="ISSUE+PAGES" />

        <Element tagname="Title" fieldID="title" />

        <!-- uses field value as name of tag -->
        <Element tagField="Score" prepend="" append="_score" spaceChar="_" />

        <!-- Nested element: -->
        <Element tagname="Nested" sourceName="somethingElse" queryParams="KY=$KY|AU=$AU" 
                      groupBy="[ result field to group nested elements by ]" >
            <Element tagname="Author" fieldID="AU" />
        </Element>

        <!-- This result field is an XML field: added as nested XML to output -->
        <Element tagname="docXML" fieldID="docXML" isXMLField="true" />

        <!-- ============= -->
        <!-- Full Text URL -->
        <!-- ============= -->
        <Element tagname="FullText" isFullTextField="true" >

          <!-- This uses a Result Field ID as the URL value -->
          <URLType type="direct" >
            <URLParam fieldID="URL" />
          </URLType>

          <!-- This type looks up a URL from another source -->
          <URLType="lookup" >
            <URLParam sourceName="LocationLookup"
                         queryParams="item_id=$item_id"
                         urlField="location" />

            <Params>
              <Param fieldID="sourceType" matchValues="source=ExternalURL"
                        sourceName="SourceTypeLookup"
                        queryParams="item_id=$item_id" 
                        resultFields="source"  matchOnly="true" />
            </Params>
          </URLType>

          <!-- This type builds a URL from a base url and a set of parameters -->
          <URLType type="documentum" >
            <Params>
              <!-- Matching field types -->
              <Param fieldID="[some field]"  matchOnly="true" />  <!-- matches on existence of field -->
              <Param fieldID="[match field]" matchValue="[matchValue]" />

              <Param fieldID="[match field]" matchValues="[resultFieldA=valA|resultFieldB=|valB]"
                        sourceName="[A nested search source]"
                        queryParams="someparam=$fieldID|otherParam=$otherFieldID" 
                        resultFields="resultFieldA|resultFieldB" matchOnly="false" /> <-- Also output this one -->

              <Param fieldID="[abstract field ID]" urlField="[name in url]" />
              <Param fieldID="object_id" sourceName="[A nested search source]"
                        queryParams="someparam=$fieldID|otherParam=$otherFieldID" 
                        resultFields="resultFieldA|resultFieldB" />
            </Params>
            <FixedParam name="contentType" value="DCTM" />
            <Servlet href="http://someHost/someServlet.jsp" />
          </URLType>

        </Element>

     </Element>
   </RecordSchema>

  <!-- informs the XMLResult on how to respond to getValue( ) or getValues( ) -->
  <XMLResultMap>
    <!-- One or more fields -->
    <Param fieldID="[ result field ID ]" xPath="[ xPath within initial XML ]" multiple="[true|false(default) ]" />

    <!-- One or more nested results -->
    <NestedResult fieldID="[ name nested Result field ]" xPath="[ path to nested tag ]" />
  </XMLResultMap>

 </CollectionGateway>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
QueryProcessorXMLGateway()
           
 
Method Summary
 java.lang.String getConfigurationXML()
           
 void initialize(org.w3c.dom.Element gatewayElem, ISearchFieldMap sfMap)
          Initialize the ICollectionGateway from a Configuration XML element.
 boolean isPaused()
           
 void pause()
           
 void resume()
           
 void run()
           
 void run(ILoginInfo userInfo)
          Need to have loginInfo for sources which require login/pw access.
 void setGatewayListener(IGatewayListener listener)
          Sets the IGatewayListener interface.
 void setInputParameters(OrderedMap inputParams)
          set input parameters...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryProcessorXMLGateway

public QueryProcessorXMLGateway()
Method Detail

setInputParameters

public void setInputParameters(OrderedMap inputParams)
Description copied from interface: ICollectionGateway
set input parameters...

Specified by:
setInputParameters in interface ICollectionGateway

run

public void run()
Specified by:
run in interface ICollectionGateway

run

public void run(ILoginInfo userInfo)
Description copied from interface: ICollectionGateway
Need to have loginInfo for sources which require login/pw access.

Specified by:
run in interface ICollectionGateway

setGatewayListener

public void setGatewayListener(IGatewayListener listener)
Description copied from interface: ICollectionGateway
Sets the IGatewayListener interface.

Specified by:
setGatewayListener in interface ICollectionGateway

initialize

public void initialize(org.w3c.dom.Element gatewayElem,
                       ISearchFieldMap sfMap)
Description copied from interface: ICollectionGateway
Initialize the ICollectionGateway from a Configuration XML element.

Specified by:
initialize in interface ICollectionGateway

pause

public void pause()
Specified by:
pause in interface ICollectionGateway

resume

public void resume()
Specified by:
resume in interface ICollectionGateway

isPaused

public boolean isPaused()
Specified by:
isPaused in interface ICollectionGateway

getConfigurationXML

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