com.raritantechnologies.searchApp.sourceMap
Class DynamicSourceMap

java.lang.Object
  extended bycom.raritantechnologies.searchApp.sourceMap.BasicSourceMap
      extended bycom.raritantechnologies.searchApp.sourceMap.DynamicSourceMap
All Implemented Interfaces:
IConfigurable, ISourceMap

public class DynamicSourceMap
extends BasicSourceMap

Provides a two-stage search source map. An initial set of search parameters is used to generate a search result which is then used by a subsequent SourceMap. The initial search source can be any RTI SearchSource ( or QueryProcessorFilter ).

Examples: Choose sources based on user identity by using an LDAPSearchSource for the initial search.

XML Configuration Template:
  <Object type="DynamicSourceMap" name="[ SourceMap Name ]" sourceName="[ SearchSource name ]"
             userParamsOnly="true|false"
             proxySourceFirst="true|false(default) - if true check proxy source first ]" >

    <!-- Describes how to translate the initial source map query for use by
            the lookup SearchSource -->
    <QueryInputMap userNameParam="user name field in search source"
                      passwordParam="password field in search source" >

       <!-- ======================================================================================  -->
       <!-- One or more QueryParam Elements: The input attribute describes what parameter to use to -->
       <!-- extract a value from the input source, the 'output' parameter describes the parameter   -->
       <!-- to use at the lookup source.                                                            -->
       <!-- ======================================================================================  -->

       <QueryParam input="input param"         output="query param" />
       <QueryParam input="another input param" output="another query param" />

    </QueryInputMap>


    <UserInputMap>

       <!-- ======================================================================================  -->
       <!-- One or more UserParam Elements: The input attribute describes what parameter to use to  -->
       <!-- extract a value from the user attribute list, the 'output' parameter describes the      -->
       <!-- parameter name to use at the lookup source.                                             -->
       <!-- ======================================================================================  -->

       <UserParam input="input param"         output="query param" />
       <UserParam input="another input param" output="another query param" />

    </UserInputMap>

    <!-- Used to translate search result to source map input parameter set. 
            If not present, result fields are used directly -->
    <SearchResultMap>

      <!-- One or more ResultParam elements:  -->
      <ResultParam input="result param" output="source map param" />

      <!-- Can have a StringFilter associated with it: -->
      <ResultParam input="result param" output="source map param" >

        <StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >

        </StringFilter>

      </ResultParam>
    </SearchResultMap>

    <!-- Default sources to return if no inputs returned -->
    <DefaultSources>
      <!-- One or more Source elements -->
      <Source>
        <!-- See SourceInput configuration -->
      </Source>
    </DefaultSources>

    <!-- Proxy source map -->
    <ProxySourceMap class="[ class of com.raritantechnologies.searchApp.sourceMap.ISourceMap ]" params="..." >
          <!-- Initialization parameters for proxy source map -->
    </ProxySourceMap>

  </Object>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
DynamicSourceMap()
           
 
Method Summary
 java.lang.String[] getAllSourceKeys(ILoginInfo userInfo, boolean checkSecurity, java.util.Map searchParams)
          returns a list of all of the source names - links to SearchSource in the ISearchFieldMap
 java.lang.String[] getAllSourceNames()
          returns a list of all of the source names - links to SearchSource in the ISearchFieldMap
 java.lang.String getObjectType()
          Returns the type of Source that the source map supports.
 SourceInput[] getSourceInputs(ILoginInfo userInfo, IResult result)
          Finds a set of source inputs based on a search result.
 SourceInput[] getSourceInputs(ILoginInfo userInfo, java.util.Map searchParams)
          Looks up the set of federated sources that are appropriate for the parameter set chosen by the user.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 
Methods inherited from class com.raritantechnologies.searchApp.sourceMap.BasicSourceMap
addSourceInputs, getDescription, getDisplayName, getPageCacheStyle, getSourceInputs, getSourceInputs, setPageCacheStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicSourceMap

public DynamicSourceMap()
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 IConfigurable
Overrides:
initialize in class BasicSourceMap

getObjectType

public java.lang.String getObjectType()
Description copied from interface: ISourceMap
Returns the type of Source that the source map supports.

Specified by:
getObjectType in interface ISourceMap
Overrides:
getObjectType in class BasicSourceMap

getAllSourceNames

public java.lang.String[] getAllSourceNames()
returns a list of all of the source names - links to SearchSource in the ISearchFieldMap


getAllSourceKeys

public java.lang.String[] getAllSourceKeys(ILoginInfo userInfo,
                                           boolean checkSecurity,
                                           java.util.Map searchParams)
Description copied from class: BasicSourceMap
returns a list of all of the source names - links to SearchSource in the ISearchFieldMap

Specified by:
getAllSourceKeys in interface ISourceMap
Overrides:
getAllSourceKeys in class BasicSourceMap

getSourceInputs

public SourceInput[] getSourceInputs(ILoginInfo userInfo,
                                     java.util.Map searchParams)
Description copied from interface: ISourceMap
Looks up the set of federated sources that are appropriate for the parameter set chosen by the user. SourceInput objects map a source name to a set of preset parameters that need to be loaded into the queryParams - this method effectively maps a set of browse selections to a set of federated sources which match the selections and then provides the configuration information needed to direct the source to the proper result type. That it, this method translates a set of browse parameters to specific input parameters needed for each site. This information is obtained from the SourceMap XML used to construct this ISourceMap object.

Specified by:
getSourceInputs in interface ISourceMap
Overrides:
getSourceInputs in class BasicSourceMap

getSourceInputs

public SourceInput[] getSourceInputs(ILoginInfo userInfo,
                                     IResult result)
Description copied from class: BasicSourceMap
Finds a set of source inputs based on a search result.

Specified by:
getSourceInputs in interface ISourceMap
Overrides:
getSourceInputs in class BasicSourceMap