Open SiteSearch 4.1.1
Final

ORG.oclc.fmts.rules
Class SaveTermFinderResults

java.lang.Object
  |
  +--ORG.oclc.fmts.rules.RuleUtil
        |
        +--ORG.oclc.fmts.rules.SaveTermFinderResults

public class SaveTermFinderResults
extends RuleUtil
implements DisplayRule

The SaveTermFinderResults class is a record formatting rule that constructs a Map (under 1.1 a Hashtable) that contains values as specified in the value* statements in the rule and based on the input DataDir. The rule specifies what to pull out of the DataDir and the value* specifications tell how to store it in the Map/Hashtable.

The parameters this rule requires are:

name
The name of the Map/Hashtable in the UserStateObject. This should correspond to the name used by the display gadget to look for the values.

field*
Where to look in the record for the data

value*
How to store the data in the hashtable

Currently valid parameters to the value* specifications and what they do:

text
The term that was looked for

hotTASTerm
This is a specialized specification which builds a hotlink that references a Thesaurus database query.

usedfor
This contains an HTML string which is composed of data in the UsedFor field.

NOTE:field*
The last 2 are specific to Thesaurus databases

See Also:
RuleSpec, FormatBerUtil, DisplayUserData, DisplayRule

Constructor Summary
SaveTermFinderResults()
           
 
Method Summary
 void doRule(DataDir dir, int recno, RuleSpec ruleSpec, FormatBerUtil fmtUtil, DisplayUserData userData)
          Adds a set of DataPairs to a Map/Hashtable within the user state object.
protected  String filterKey(String inkey)
          Filters the key of punctuation and makes it lower case.
protected  int insertLocation(Vector data, String inkey)
          Determines location to insert the key data into the vector collecting data
protected  String makeUsedFor(RuleSpec ruleSpec, Vector terms, String before, String after, String between, String trailer)
          Returns a String that contains all the used for terms formated based on values set in the userData
protected  DataPairs makeValue(String key, RuleSpec ruleSpec, DisplayUserData userData, String before, String after, String between, String trailer)
          This method constructs the DataPairs that will be added to the Map with a key
 
Methods inherited from class ORG.oclc.fmts.rules.RuleUtil
appendEntityData, getData, getData, getWrapperData, getWrapperData, getWrapperDataFromRuleParm, labelMaker, saveDataInEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveTermFinderResults

public SaveTermFinderResults()
Method Detail

doRule

public void doRule(DataDir dir,
                   int recno,
                   RuleSpec ruleSpec,
                   FormatBerUtil fmtUtil,
                   DisplayUserData userData)
Adds a set of DataPairs to a Map/Hashtable within the user state object. The name for this Map is found in the ruleSpec parms as "name".
Specified by:
doRule in interface DisplayRule
Parameters:
dir - the DataDir object containing the data record
recordNumber - the record number of the item within the list - NOTE: This parm is ignored by this rule.
ruleSpec - the field specification for locating the data
fmtUtil - the FormatBerUtil object containing the current formatted data buffer and the formatting utilities.
userData - the DisplayUserData object containing the user's context for formatting the data records.

filterKey

protected String filterKey(String inkey)
Filters the key of punctuation and makes it lower case.

insertLocation

protected int insertLocation(Vector data,
                             String inkey)
Determines location to insert the key data into the vector collecting data

makeValue

protected DataPairs makeValue(String key,
                              RuleSpec ruleSpec,
                              DisplayUserData userData,
                              String before,
                              String after,
                              String between,
                              String trailer)
This method constructs the DataPairs that will be added to the Map with a key
Parameters:
key - the term that was pulled out of the record
ruleSpec - the field specification for locating the data
userData - the DisplayUserData object containing the user's data buffer and the formatting utilities.

makeUsedFor

protected String makeUsedFor(RuleSpec ruleSpec,
                             Vector terms,
                             String before,
                             String after,
                             String between,
                             String trailer)
Returns a String that contains all the used for terms formated based on values set in the userData
Parameters:
ruleSpec - the field specification for locating the data
terms - the Vector containing the terms within the used for field
userData - the DisplayUserData object containing the user's

Open SiteSearch 4.1.1
Final