com.raritantechnologies.searchApp
Class SearchField

java.lang.Object
  extended bycom.raritantechnologies.searchApp.SearchField
All Implemented Interfaces:
java.util.Comparator
Direct Known Subclasses:
AutonomySearchField, DieselpointSearchField, DQLSearchField, EndecaSearchField, ExaleadSearchField, FastSearchField, HTMLSearchField, LDAPSearchField, LuceneSearchField, MarkLogicSearchField, OmniFindSearchField, SevSearchField, SOAPSearchField, SOLRSearchField, SQLSearchField, VeritySearchField, VWebServicesSearchField, Z3950SearchField

public abstract class SearchField
extends java.lang.Object
implements java.util.Comparator

Represents a field in a SearchSource. Provides a mapping of an AbstractSearchField (which provide global or source-independent field descriptions) to a specific field within a search source. SearchFields are owned by a SearchSource instance.

Attributes:

Each type of SearchSource is required to subclass this class. Subclasses of SearchField can add extra parameters for query or result management. For example, the VeritySearchField adds attributes for "field" vs. "zone", "thesaurus" etc.


Developed by Raritan Technologies .

Author:
Ted Sullivan, Glenn Robitaille

Field Summary
static java.lang.String ALPHANUMERIC
           
static java.lang.String BOOLEANCOMBO
           
static java.lang.String BOOLEANFIELD
           
static java.lang.String DATE
           
static java.lang.String NUMERIC
           
 
Constructor Summary
SearchField()
           
 
Method Summary
 void addFieldData(org.w3c.dom.Element fieldElement)
          Adds field data from XML - SearchField maps the values defined in the AbstractSearchField data list to the field values used by the SearchSource owner of this SearchField.
 void addFieldData(java.lang.String pAbstract_value, java.lang.String pData_field_value)
          SearchField maps the abstract value of the data field to the value expected in its searchSource.
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 boolean equals(java.lang.Object another)
           
 AbstractSearchField getAbstractSearchField()
           
 java.lang.String getAssociatedField()
           
 OrderedMap getFieldData()
           
 java.lang.String getFieldDataValue(java.lang.String abstractFieldValue)
           
 java.lang.String getFieldDataValue(java.lang.String abstractFieldValue, java.util.Map queryParams)
           
 java.lang.String getFieldFormat()
           
 java.lang.String getFieldID()
           
 FieldLookupMap getFieldLookupMap()
           
 java.lang.String getFieldName()
           
 java.lang.String getFieldType()
           
 java.lang.String getSearchField()
           
 java.lang.String getSearchType()
           
 SearchSource getSource()
          returns the SearchSource that this field belongs to.
 void setAbstractSearchField(AbstractSearchField asf)
           
 void setFieldData(OrderedMap pField_data)
          field data is used mostly for dropdown lists, although other uses may arise.
 void setFieldFormat(java.lang.String pField_format)
          field format is used for special formatting requriements such as date or numeric formats.
 void setFieldID(java.lang.String pField_id)
          sets the field_id.
 void setFieldLookupMap(FieldLookupMap fieldLookupMap)
          provides a local lookup map for this field enables source-dependent values for the field to be stored.
 void setFieldName(java.lang.String pField_name)
          field name is the name that the user sees on a search or result form.
 void setFieldType(java.lang.String pField_type)
          field type is used to determine the input type - Text Date List - dropdown list Boolean
 void setSearchField(java.lang.String pSearch_field)
          Sets the name of the search field as it exists in the source
 void setSearchType(java.lang.String searchType)
          Search type is a Source specific operator that can be used to determine how the query is translated to a query directed at a particular source.
 void setSource(SearchSource pSource)
          set the SearchSource which this field belongs to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALPHANUMERIC

public static final java.lang.String ALPHANUMERIC
See Also:
Constant Field Values

NUMERIC

public static final java.lang.String NUMERIC
See Also:
Constant Field Values

DATE

public static final java.lang.String DATE
See Also:
Constant Field Values

BOOLEANCOMBO

public static final java.lang.String BOOLEANCOMBO
See Also:
Constant Field Values

BOOLEANFIELD

public static final java.lang.String BOOLEANFIELD
See Also:
Constant Field Values
Constructor Detail

SearchField

public SearchField()
Method Detail

equals

public boolean equals(java.lang.Object another)
Specified by:
equals in interface java.util.Comparator

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

setSource

public void setSource(SearchSource pSource)
set the SearchSource which this field belongs to.


getSource

public SearchSource getSource()
returns the SearchSource that this field belongs to.


setFieldID

public void setFieldID(java.lang.String pField_id)
sets the field_id. field_id is the key field for cross search source mapping. If two different search sources have the same field_id, their values have the same meaning (e.g. 'Title').


getFieldID

public java.lang.String getFieldID()

setFieldName

public void setFieldName(java.lang.String pField_name)
field name is the name that the user sees on a search or result form.


getFieldName

public java.lang.String getFieldName()

setSearchField

public void setSearchField(java.lang.String pSearch_field)
Sets the name of the search field as it exists in the source


getSearchField

public java.lang.String getSearchField()

setFieldType

public void setFieldType(java.lang.String pField_type)
field type is used to determine the input type -


getFieldType

public java.lang.String getFieldType()

setFieldFormat

public void setFieldFormat(java.lang.String pField_format)
field format is used for special formatting requriements such as date or numeric formats. The format represents the format used by the source.


getFieldFormat

public java.lang.String getFieldFormat()

setFieldData

public void setFieldData(OrderedMap pField_data)
field data is used mostly for dropdown lists, although other uses may arise.


addFieldData

public void addFieldData(org.w3c.dom.Element fieldElement)
Adds field data from XML - SearchField maps the values defined in the AbstractSearchField data list to the field values used by the SearchSource owner of this SearchField.
  <Data>
     <Choice abstractVal="ABST" sourceVal="local value" />
     <Choice abstractVal="..."  sourceVal="loc.." />
  </Data>
 


addFieldData

public void addFieldData(java.lang.String pAbstract_value,
                         java.lang.String pData_field_value)
SearchField maps the abstract value of the data field to the value expected in its searchSource.


getFieldData

public OrderedMap getFieldData()

getFieldDataValue

public java.lang.String getFieldDataValue(java.lang.String abstractFieldValue)

getFieldDataValue

public java.lang.String getFieldDataValue(java.lang.String abstractFieldValue,
                                          java.util.Map queryParams)

getAssociatedField

public java.lang.String getAssociatedField()

setSearchType

public void setSearchType(java.lang.String searchType)

Search type is a Source specific operator that can be used to determine how the query is translated to a query directed at a particular source.

For example, for a Verity source, this can be used to designate Field, Zone, Thesaurus Matching or some combination of these.


getSearchType

public java.lang.String getSearchType()

setAbstractSearchField

public void setAbstractSearchField(AbstractSearchField asf)

getAbstractSearchField

public AbstractSearchField getAbstractSearchField()

setFieldLookupMap

public void setFieldLookupMap(FieldLookupMap fieldLookupMap)
provides a local lookup map for this field enables source-dependent values for the field to be stored.


getFieldLookupMap

public FieldLookupMap getFieldLookupMap()

toString

public java.lang.String toString()