com.raritantechnologies.searchApp.sourceMap
Class LookupSearchSource

java.lang.Object
  extended bycom.raritantechnologies.searchApp.SearchSource
      extended bycom.raritantechnologies.searchApp.sourceMap.LookupSearchSource

public class LookupSearchSource
extends SearchSource

Provides a lookup service enabling search inputs to a search source to be expanded by an "input" search source prior to executing the search on the output or "target" SearchSource.

Can be used for:

Depending on how the LookupSearchSource is used, configurable options for copying parameters and result values, paging settings, etc. must be properly chosen.


XML Configuration Template:
  <SourceType name="[ search source name ]" 
              type="LookupSearchSource" 
              displayName="[ human readable name ]"
              sourceFactoryClass="com.raritantechnologies.searchApp.sourceMap.LookupSearchSourceFactory"
              queryProcessor="com.raritantechnologies.searchApp.sourceMap.LookupQueryProcessor"
              addAllRequestParams="true(default)|false - if false don't add all initial query parameters to secondary search"
              addAllInputResults="[true|false(default) - set to 'true' for metadata field enhancement ]"
              excludeOutputHits="[true|false(default)  - set to 'true' for metadata field enhancement ]"
              addAllInputFields="true|false - if true add input result metadata to output result"
              nestedResultField="[ field name to use to add the entire input result as a nested result ]"
              inputSourcePaging="true|false(default)"
              outputSourcePaging="true(default)|false"
              inputPageSize="[ page size of input result set ]"
              outputPageSize="[ page size of output result set ]" >

   <!-- =================================================================== -->
   <!-- Fields section defines how the results of the first query processor -->
   <!-- are to be used to generate a query to the second query processor    -->
   <!-- and to define fields that are to be combined in the final output.   -->
   <!--                                                                     -->
   <!-- AddToQuery Fields: These are parameters that are to be copied from  -->
   <!-- the initial result to the query used for the second order search.   -->
   <!--                                                                     -->
   <!-- AddToOutput Fields: These are parameters that are to be copied      -->
   <!-- from the initial result to the final output result.                 -->
   <!-- =================================================================== -->
   <Fields>
     <AddToQuery ID="[ input result field ID ]" required="true" />
     <AddToQuery ID="[ output query param ]"    value="[ its fixed value ]" />
     <AddToQuery ID="[ input result field ID ]" mapTo="[ field name in output source ]" />

     <AddToOutput ID="[ field ID ]" />
     <AddToOutput ID="[ another field ID ]" />
     <AddToOutput ID="STATIC_FIELD" value="ITS VALUE" />
   </Fields>

   <!-- =================================================================== --> 
   <!--     Defines the initial search source used.                         -->
   <!-- =================================================================== --> 
   <InputSource>[ name of initial Search Source ]</InputSource>

   <!-- =================================================================== -->
   <!-- Optional formatting / filtering elements that can be used to modify -->
   <!-- results of the initial search before using these to generate a      -->
   <!-- query to the second source.                                         -->
   <!-- =================================================================== -->
   <InputFormatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >
     <!-- configuration parameters for IFieldFormatter -->
   </InputFormatter>

   <!-- Filters the query map generated by the primary search prior to its  -->
   <!-- use in the secondary search.                                        -->
   <MapFilter class="[class of com.raritantechnologies.utils.filter.IMapFilter ]" >
     <!-- configuration parameters for MapFilter -->
   </MapFilter>

   <!-- Filters the query map generated by the primary search prior to its  -->
   <!-- use in the secondary search.                                        -->
   <QueryParser class="[class of com.raritantechnologies.searchApp.IQueryParser ]" >
     <!-- configuration parameters for QueryParser -->
   </QueryParser>

   <!-- =================================================================== --> 
   <!--     Defines the final or output search source use                   -->
   <!-- =================================================================== -->
   <OutputSource>[ name of second Search Source ]</OutputSource>

   <!-- Alternatively - outputSource name is a field value of               -->
   <!-- the initial search result.                                          -->
   <OutputSource isFieldName="true">sourceFieldName</OutputSource>

  </SourceType>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.SearchSource
ID_FIELD, IS_FEDERATED, NUMBER_OF_FIELDS, SECURE, SOURCE_NAME, SOURCE_TYPE, TITLE_FIELD, URL_FIELD
 
Constructor Summary
LookupSearchSource()
           
LookupSearchSource(SearchSource inputSource, java.lang.String[] theOutputFields)
           
LookupSearchSource(java.lang.String inputSearchSourceName, ISourceMap sourceMap, java.lang.String[] theOutputFields)
           
LookupSearchSource(java.lang.String inputSearchSourceName, java.lang.String[] outputSearchSourceNames, java.lang.String[] theOutputFields)
           
LookupSearchSource(java.lang.String inputSearchSourceName, java.lang.String outputSearchSourceName, java.lang.String[] theOutputFields)
           
 
Method Summary
 boolean addAllInputFields()
           
 boolean addAllInputResults()
           
 boolean addAllRequestParams()
           
 void addInputFilter(java.lang.String inputField, IStringFilter filter)
           
 void addRequiredProperty(java.lang.String property)
           
 void addToInputMap(java.lang.String inputField, java.lang.String outputField)
           
 void addToValueMap(java.lang.String inputField, java.lang.String value)
           
 boolean excludeOutputHits()
           
 java.util.Map getFixedFields()
           
 java.lang.String[] getInputFields()
           
 IStringFilter getInputFilter(java.lang.String inputField)
           
 IFieldFormatter[] getInputFormatters()
           
 IMapFilter getInputMapFilter()
           
 java.lang.Integer getInputPageSize()
           
 SearchSource getInputSource()
           
 boolean getInputSourcePaging()
           
 java.lang.String getInputValue(java.lang.String inputField)
           
 java.lang.String getNestedResultField()
           
 java.lang.String[] getOutputFields()
           
 java.lang.Integer getOutputPageSize()
           
 java.lang.Integer getOutputPageSize(int requestedPageSize)
           
 SearchSource getOutputSource(ILoginInfo userInfo, IResult res, java.util.Map searchParams)
           
 boolean getOutputSourcePaging()
           
 java.lang.Object getProperty(java.lang.String property)
          returns a Source Property.
 java.util.List getQueryFields()
           
 IQueryParser getQueryParser()
           
 IQueryProcessor getQueryProcessor()
          returns the type of QueryProcessor that can access this SearchSource.
 java.lang.String[] getSourcePropertyNames()
          Returns a list of Source type specific property names.
 boolean isRequired(java.lang.String property)
           
 java.lang.String[] mapInputField(java.lang.String inputField)
           
 void setAddAllInputFields(boolean addAllInputFields)
           
 void setAddAllInputResults(boolean addAllInputResults)
           
 void setAddAllRequestParams(boolean addAllRequestParams)
           
 void setExcludeOutputHits(boolean excludeOutputHits)
           
 void setFixedFields(java.util.Map fixedFields)
           
 void setInputFields(java.lang.String[] inputFields)
           
 void setInputFormatters(IFieldFormatter[] fieldFormatters)
           
 void setInputMapFilter(IMapFilter mapFilter)
          Adds an IMapFilter that can modify the query map to the secondary search source.
 void setInputPageSize(int inputPageSize)
           
 void setInputSource(SearchSource inputSource)
           
 void setInputSourcePaging(boolean inputSourcePaging)
           
 void setNestedResultField(java.lang.String nestedResultField)
          Sets the field name to use as a nested result field - use this to build composite Result objects from multiple level searches.
 void setOutputFields(java.lang.String[] outputFields)
           
 void setOutputPageSize(int outputPageSize)
           
 void setOutputSource(SearchSource outputSource)
           
 void setOutputSourceIsField(boolean isField)
           
 void setOutputSourceName(java.lang.String outputSourceName)
           
 void setOutputSourcePaging(boolean outputSourcePaging)
           
 void setOutputSources(java.lang.String[] outputSourceNames)
           
 void setQueryFields(java.util.List queryFields)
          Sets set of fields that will be passed on from query to output result.
 void setQueryParser(IQueryParser queryParser)
           
 void setSourceMap(java.lang.String sourceMapType, java.lang.String sourceMapName)
           
 
Methods inherited from class com.raritantechnologies.searchApp.SearchSource
addFieldFormatter, addSearchField, addSourceAttributes, addStaticField, addStaticFields, addUserSearchField, canAccess, canConsolidateSources, consolidateSources, delSearchField, formatResult, formatResult, formatResultField, formatResultField, formatResults, formatResults, getAccessableFields, getAttributes, getBasePath, getConfigPath, getDisplayName, getFieldFormatters, getIDField, getName, getSearchField, getSearchFieldID, getSearchFields, getSearchFields, getSecondarySortSpec, getSecurityManager, getSecurityManagerName, getSecurityModel, getSortSpec, getSourceCredentials, getTitleField, getType, getURLField, getUserSearchFields, isMultiThreaded, setConfigPath, setDisplayName, setIDField, setMultiThreaded, setName, setSecurityManagerName, setSecurityModel, setSortMap, setSourcePropertyInfoSource, setTitleField, setType, setURLField, shouldFormatResults, supportsBackgroundSort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupSearchSource

public LookupSearchSource()

LookupSearchSource

public LookupSearchSource(SearchSource inputSource,
                          java.lang.String[] theOutputFields)

LookupSearchSource

public LookupSearchSource(java.lang.String inputSearchSourceName,
                          java.lang.String outputSearchSourceName,
                          java.lang.String[] theOutputFields)

LookupSearchSource

public LookupSearchSource(java.lang.String inputSearchSourceName,
                          java.lang.String[] outputSearchSourceNames,
                          java.lang.String[] theOutputFields)

LookupSearchSource

public LookupSearchSource(java.lang.String inputSearchSourceName,
                          ISourceMap sourceMap,
                          java.lang.String[] theOutputFields)
Method Detail

getQueryProcessor

public IQueryProcessor getQueryProcessor()
Description copied from class: SearchSource
returns the type of QueryProcessor that can access this SearchSource.

Specified by:
getQueryProcessor in class SearchSource

setInputSource

public void setInputSource(SearchSource inputSource)

getInputSource

public SearchSource getInputSource()

setOutputSource

public void setOutputSource(SearchSource outputSource)

getOutputSource

public SearchSource getOutputSource(ILoginInfo userInfo,
                                    IResult res,
                                    java.util.Map searchParams)

setOutputSourceName

public void setOutputSourceName(java.lang.String outputSourceName)

setOutputSources

public void setOutputSources(java.lang.String[] outputSourceNames)

setSourceMap

public void setSourceMap(java.lang.String sourceMapType,
                         java.lang.String sourceMapName)

getOutputFields

public java.lang.String[] getOutputFields()

setOutputFields

public void setOutputFields(java.lang.String[] outputFields)

setInputFields

public void setInputFields(java.lang.String[] inputFields)

getInputFields

public java.lang.String[] getInputFields()

setNestedResultField

public void setNestedResultField(java.lang.String nestedResultField)
Sets the field name to use as a nested result field - use this to build composite Result objects from multiple level searches.


getNestedResultField

public java.lang.String getNestedResultField()

setAddAllInputResults

public void setAddAllInputResults(boolean addAllInputResults)

addAllInputResults

public boolean addAllInputResults()

setAddAllInputFields

public void setAddAllInputFields(boolean addAllInputFields)

addAllInputFields

public boolean addAllInputFields()

setAddAllRequestParams

public void setAddAllRequestParams(boolean addAllRequestParams)

addAllRequestParams

public boolean addAllRequestParams()

setExcludeOutputHits

public void setExcludeOutputHits(boolean excludeOutputHits)

excludeOutputHits

public boolean excludeOutputHits()

getSourcePropertyNames

public java.lang.String[] getSourcePropertyNames()
Description copied from class: SearchSource
Returns a list of Source type specific property names.

Overrides:
getSourcePropertyNames in class SearchSource

getProperty

public java.lang.Object getProperty(java.lang.String property)
Description copied from class: SearchSource
returns a Source Property. The standard pattern is to return a String or Object if a property has a single value and a String or Object Array if the property has multiple values.

Overrides:
getProperty in class SearchSource

isRequired

public boolean isRequired(java.lang.String property)

addRequiredProperty

public void addRequiredProperty(java.lang.String property)

setOutputSourceIsField

public void setOutputSourceIsField(boolean isField)

addToInputMap

public void addToInputMap(java.lang.String inputField,
                          java.lang.String outputField)

mapInputField

public java.lang.String[] mapInputField(java.lang.String inputField)

addInputFilter

public void addInputFilter(java.lang.String inputField,
                           IStringFilter filter)

getInputFilter

public IStringFilter getInputFilter(java.lang.String inputField)

setInputMapFilter

public void setInputMapFilter(IMapFilter mapFilter)
Adds an IMapFilter that can modify the query map to the secondary search source. (If you need to modify the map to the primary source, use a QueryMapFilter - QueryProcessorFilter)


getInputMapFilter

public IMapFilter getInputMapFilter()

setQueryParser

public void setQueryParser(IQueryParser queryParser)

getQueryParser

public IQueryParser getQueryParser()

setInputPageSize

public void setInputPageSize(int inputPageSize)

getInputPageSize

public java.lang.Integer getInputPageSize()

setOutputPageSize

public void setOutputPageSize(int outputPageSize)

getOutputPageSize

public java.lang.Integer getOutputPageSize()

getOutputPageSize

public java.lang.Integer getOutputPageSize(int requestedPageSize)

addToValueMap

public void addToValueMap(java.lang.String inputField,
                          java.lang.String value)

getInputValue

public java.lang.String getInputValue(java.lang.String inputField)

setFixedFields

public void setFixedFields(java.util.Map fixedFields)

getFixedFields

public java.util.Map getFixedFields()

setQueryFields

public void setQueryFields(java.util.List queryFields)
Sets set of fields that will be passed on from query to output result.


getQueryFields

public java.util.List getQueryFields()

setInputFormatters

public void setInputFormatters(IFieldFormatter[] fieldFormatters)

getInputFormatters

public IFieldFormatter[] getInputFormatters()

setInputSourcePaging

public void setInputSourcePaging(boolean inputSourcePaging)

getInputSourcePaging

public boolean getInputSourcePaging()

setOutputSourcePaging

public void setOutputSourcePaging(boolean outputSourcePaging)

getOutputSourcePaging

public boolean getOutputSourcePaging()