com.raritantechnologies.searchApp.sourceMap
Class BasicSourceMap

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

public class BasicSourceMap
extends java.lang.Object
implements ISourceMap

Represents a single set of SearchSources. Maps a set of parameter=value pairs to one or more search sources.

Finds a set of search sources from a set of param=value values. The parameters can come from an incoming http request or user query or from user properties.

XML Configuration Template:
  <Object type="BasicSourceMap" paramList="treepath,docType,subject"
             securityManager="[ name of SecurityManager ]" >
   <!-- Describes the context for a set of sources (one or more) -->
   <SourceMap name="[ display name of source ]" >
     <params>
       <param name="treepath" value="Documents/Biology-Medicine/Anatomy/Head Neck" />
       <param name="docType"  value="Book" />
     </params>

   <Sources>
      <Source name="WileyInterscienceBooks" >
        <Field name="WileyBookSUBJECT-FIELD" value="Gray's Anatomy" />
        <Field name="KY" value="neck muscles">
      </Source>
    </Sources>
  </SourceMap>

 <!-- Describes the query context for a second set of sources -->
 <SourceMap name="[ display name of source ]" >
   <!-- as above -->
 </SourceMap>

 <!-- etc... for as many different source types as needed -->

</Object>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
BasicSourceMap()
           
 
Method Summary
 void addSourceInputs(java.lang.String sourceKey, SourceInput[] sourceInputs)
           
 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 getDescription(java.lang.String sourceName)
           
 java.lang.String getDisplayName(java.lang.String sourceKey)
           
 java.lang.String getObjectType()
          Returns the type of Source that the source map supports.
 int getPageCacheStyle(java.lang.String sourceKey)
           
 SourceInput[] getSourceInputs(ILoginInfo userInfo, IResult searchResult)
          Finds a set of source inputs based on a search result.
static SourceInput[] getSourceInputs(ILoginInfo userInfo, IResult searchResult, ISourceMap sourceMapImpl)
           
 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.
 SourceInput[] getSourceInputs(java.lang.String sourceKey)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setPageCacheStyle(java.lang.String sourceKey, int pagingStyle)
          Sets/gets the paging style used by a federated source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSourceMap

public BasicSourceMap()
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

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

getAllSourceKeys

public 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

Specified by:
getAllSourceKeys in interface ISourceMap

addSourceInputs

public void addSourceInputs(java.lang.String sourceKey,
                            SourceInput[] sourceInputs)
Specified by:
addSourceInputs in interface ISourceMap

getSourceInputs

public SourceInput[] getSourceInputs(java.lang.String sourceKey)
Specified by:
getSourceInputs in interface ISourceMap

getDisplayName

public java.lang.String getDisplayName(java.lang.String sourceKey)
Specified by:
getDisplayName in interface ISourceMap

getSourceInputs

public static SourceInput[] getSourceInputs(ILoginInfo userInfo,
                                            IResult searchResult,
                                            ISourceMap sourceMapImpl)

getSourceInputs

public SourceInput[] getSourceInputs(ILoginInfo userInfo,
                                     IResult searchResult)
Finds a set of source inputs based on a search result.

Specified by:
getSourceInputs in interface ISourceMap

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

getDescription

public java.lang.String getDescription(java.lang.String sourceName)
Specified by:
getDescription in interface ISourceMap

setPageCacheStyle

public void setPageCacheStyle(java.lang.String sourceKey,
                              int pagingStyle)
Description copied from interface: ISourceMap
Sets/gets the paging style used by a federated source. Constants defined in IFederatedSearchSource.

Specified by:
setPageCacheStyle in interface ISourceMap

getPageCacheStyle

public int getPageCacheStyle(java.lang.String sourceKey)
Specified by:
getPageCacheStyle in interface ISourceMap