Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class DKSearchCriteria

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.DKSearchCriteria
All Implemented Interfaces:
DKConstant, DKMessageId, java.io.Serializable

public class DKSearchCriteria
extends java.lang.Object
implements java.io.Serializable, DKConstant, DKMessageId

See Also:
Serialized Form

Field Summary
static short DK_CRIT_DISPLAY_ONLY
           
static short DK_CRIT_QUERY_DISPLAY
           
static short DK_CRIT_QUERY_ONLY
           
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKSearchCriteria()
          Creates a new instance with default values.
DKSearchCriteria(java.lang.String entityName, java.lang.String attrName)
          Creates a new instance of search criteria with associated federated entity and attribute names.
 
Method Summary
 void addPredefinedValues(DKPredefinedValues pdefValues)
          Adds the predefined value pairs of one native entity/attr for this search criteria.
 void addSearchEngine(dkSearchEngineInfo searchEngineInfo)
          Adds search engine information object
 void addSearchEngine(java.lang.String serverName, java.lang.String indexName)
          Deprecated. Replace by addSearchEngine
 void clearSearchData()
          Clears out search values and reset the search operator to undefined.
 java.lang.String getAssociatedEntityName()
          Gets the associated entity name associated with this query This entity will support text and parametric query
 short getAttrId()
           
 java.lang.String getAttrName()
          Gets the associated federated attribute name of this search criteria
 short getCriteriaPosition()
          Gets the order of this search criterion to be displayed in the search template.
 short getDataType()
          Gets data type of the attribute of parametric criteria
 short getDefaultOperator()
          Gets the default operator for this search criteria previously defined
 java.lang.String[] getDefaultValues()
          Gets the default search value
 java.lang.String getDisplayName()
          Gets the search criteria display name
 short getDisplayPosition()
          Gets the column display order within the search results.
 short getDisplayWidth()
          Gets the column display width within the search results.
 short getEntityId()
           
 java.lang.String getEntityName()
          Gets associated federated entity name of this search criteria
 short getId()
          Gets search criteria id
 java.lang.String getName()
          Gets search criteria name.
 short getOperator()
          Gets the query operator
 dkCollection getPredefinedValues()
          Gets the list of predefined search values for this criteria.
 dkSearchEngineInfo getSearchEngine(int index)
          Gets search engine from the index position of search engine list (base 1)
 int getSearchEngineCount()
          Gets the number of search engines
 short getType()
          Gets the search criteria type.
 short[] getValidOperators()
          Gets the list of valid query operators for this search criteria
 java.lang.String getValue()
          Gets the text search value for this criteria
 java.lang.String[] getValues()
          Gets the list of search values for this criteria
 boolean hasMultiValues()
          Check if this search criteria has multi-values.
 boolean isDisplayable()
          Checks whether this criterion is displayable in the result set
 boolean isQueryable()
          Checks whether this criterion is queryable
 boolean isQuoteNeeded()
          Returns true if the search criteria value need to be enclosed in single quotes when used to create a query term.
 boolean isSet()
          Returns true if the search criteria value and operator are set.
 dkCollection listSearchEngines()
          Gets a list of search criteria in this query
 void setAssociatedEntityName(java.lang.String assocEntityName)
          Sets the associated entity name associated with this query This entity will support text and parametric query
 void setAttrId(short id)
           
 void setAttrName(java.lang.String attrName)
          Sets the associated federated attribute name of this search criteria
 void setCriteriaPosition(short order)
          Sets the order of this search criterion to be displayed in the search template.
 void setDataType(short attrType)
          Sets data type of the attribute of parametric criteria.
 void setDefaultOperator(short defOp)
          Sets default operator for this search criteria
 void setDefaultValues(java.lang.String[] values)
          Sets the default search value for this criteria
 void setDisplayable(boolean displayable)
          Sets whether this criterion is displayable in the result set
 void setDisplayName(java.lang.String dispName)
          Sets display name in result list for this search criteria
 void setDisplayPosition(short order)
          Sets the column display order within the search results.
 void setDisplayWidth(short width)
          Sets the column display width within the search results.
 void setEntityId(short id)
           
 void setEntityName(java.lang.String entityName)
          Sets the associated federated entity name of this search criteria
 void setName(java.lang.String newName)
          Sets the search criteria name
 void setOperator(short newOp)
          Sets the search operator
 void setQueryable(boolean queryable)
          Sets whether this criterion is queryable
 void setType(short aType)
          Sets the search criteria type.
 void setValidOperators(short[] validOps)
          Sets the valid operators for this search criteria
 void setValue(java.lang.String newVal)
          Sets the text search value for this criteria
 void setValues(java.lang.String[] newValues)
          Sets a new list of search values for this criteria
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DK_CRIT_DISPLAY_ONLY

public static final short DK_CRIT_DISPLAY_ONLY

DK_CRIT_QUERY_ONLY

public static final short DK_CRIT_QUERY_ONLY

DK_CRIT_QUERY_DISPLAY

public static final short DK_CRIT_QUERY_DISPLAY
Constructor Detail

DKSearchCriteria

public DKSearchCriteria()
Creates a new instance with default values.

DKSearchCriteria

public DKSearchCriteria(java.lang.String entityName,
                        java.lang.String attrName)
                 throws DKException
Creates a new instance of search criteria with associated federated entity and attribute names.
Parameters:
entityName - name of the associated federated entity
attrName - name of the associated federated attribute
Method Detail

getName

public java.lang.String getName()
Gets search criteria name.
Returns:
name of this search criteria

setName

public void setName(java.lang.String newName)
Sets the search criteria name
Parameters:
newName - name of this search criteria

getDisplayName

public java.lang.String getDisplayName()
Gets the search criteria display name
Returns:
column display name in result list

setDisplayName

public void setDisplayName(java.lang.String dispName)
                    throws DKUsageError
Sets display name in result list for this search criteria
Parameters:
dispName - search criteria display name

getId

public short getId()
Gets search criteria id
Returns:
search criteria id

getEntityName

public java.lang.String getEntityName()
Gets associated federated entity name of this search criteria
Returns:
federated entity name

setEntityName

public void setEntityName(java.lang.String entityName)
Sets the associated federated entity name of this search criteria
Parameters:
entityName - associated entity name

getAttrName

public java.lang.String getAttrName()
Gets the associated federated attribute name of this search criteria
Returns:
federated attribute name

setAttrName

public void setAttrName(java.lang.String attrName)
Sets the associated federated attribute name of this search criteria
Parameters:
attrName - name of the associated federated attribute

getDefaultOperator

public short getDefaultOperator()
Gets the default operator for this search criteria previously defined
Returns:
default operator

setDefaultOperator

public void setDefaultOperator(short defOp)
Sets default operator for this search criteria
Parameters:
defOp - default operator value

getValidOperators

public short[] getValidOperators()
Gets the list of valid query operators for this search criteria
Returns:
an array of valid operators

setValidOperators

public void setValidOperators(short[] validOps)
                       throws DKException
Sets the valid operators for this search criteria
Parameters:
validOps - an array of valid operators

getDefaultValues

public java.lang.String[] getDefaultValues()
Gets the default search value
Returns:
default value for this search criteria

setDefaultValues

public void setDefaultValues(java.lang.String[] values)
                      throws DKException
Sets the default search value for this criteria
Parameters:
value - new default search value
Throws:
if - new value is null or invalid

getPredefinedValues

public dkCollection getPredefinedValues()
                                 throws DKException,
                                        java.lang.Exception
Gets the list of predefined search values for this criteria. This list of values will help the GUI to display these values as valid choices for this criteria.
Returns:
a collection of DKPredefinedValues object, each object will hold all the fedAttrValue/nativeAttrValue pairs of one native entity/attr.

addPredefinedValues

public void addPredefinedValues(DKPredefinedValues pdefValues)
                         throws DKException
Adds the predefined value pairs of one native entity/attr for this search criteria.
Parameters:
pdefValues - a DKPredefinedValues that hold all value pairs for one native entity/attr.
Throws:
DKException - if value pairs is empty.

getOperator

public short getOperator()
Gets the query operator
Returns:
search operator

setOperator

public void setOperator(short newOp)
Sets the search operator
Parameters:
newOp - new search operator for this criteria

getValue

public java.lang.String getValue()
Gets the text search value for this criteria
Returns:
search value

getValues

public java.lang.String[] getValues()
Gets the list of search values for this criteria
Returns:
an array of search values

setValue

public void setValue(java.lang.String newVal)
              throws DKException
Sets the text search value for this criteria
Parameters:
newValue - new search value

setValues

public void setValues(java.lang.String[] newValues)
               throws DKException
Sets a new list of search values for this criteria
Parameters:
newValues - an array of new search values
Throws:
DKException - if newValues is null or invalid

hasMultiValues

public boolean hasMultiValues()
Check if this search criteria has multi-values.
Returns:
true if this search criteria has multi values

getDisplayPosition

public short getDisplayPosition()
Gets the column display order within the search results.
Returns:
order display order, 0 based

setDisplayPosition

public void setDisplayPosition(short order)
Sets the column display order within the search results.
Parameters:
order - display order, 0 based

getDisplayWidth

public short getDisplayWidth()
Gets the column display width within the search results.
Returns:
width display width

setDisplayWidth

public void setDisplayWidth(short width)
Sets the column display width within the search results.
Parameters:
width - display width

getCriteriaPosition

public short getCriteriaPosition()
Gets the order of this search criterion to be displayed in the search template. This display order also will be used to formulate the query order of this criterion.
Returns:
display order within search template

setCriteriaPosition

public void setCriteriaPosition(short order)
Sets the order of this search criterion to be displayed in the search template. This display order also will be used to formulate the query order of this criterion.
Parameters:
order - display order within search template

setDisplayable

public void setDisplayable(boolean displayable)
Sets whether this criterion is displayable in the result set
Parameters:
displayable - true if column for display, false otherwise

isDisplayable

public boolean isDisplayable()
Checks whether this criterion is displayable in the result set
Returns:
true if this criterion will be displayed as column in result set, false otherwise.

setQueryable

public void setQueryable(boolean queryable)
Sets whether this criterion is queryable
Parameters:
queryable - true if this criterion will be participate in the formulation of the query, false otherwise

isQueryable

public boolean isQueryable()
Checks whether this criterion is queryable
Returns:
true if this criterion will be participate in the formulation of the query, false otherwise

setType

public void setType(short aType)
Sets the search criteria type. For example: DK_FED_MAPPED_ENTITY (for parametric search) DK_FED_MAPPED_TEXT_ENTITY (for text search) DK_FED_MAPPED_IMAGE_ENTITY (for QBIC )
Parameters:
aType - a type indicates parametric, text or qbic search

getType

public short getType()
Gets the search criteria type. For example: DK_FED_MAPPED_ENTITY (for parametric search) DK_FED_MAPPED_TEXT_ENTITY (for text search) DK_FED_MAPPED_IMAGE_ENTITY (for QBIC )
Returns:
a type indicates parametric, text or qbic search

addSearchEngine

public void addSearchEngine(dkSearchEngineInfo searchEngineInfo)
                     throws DKException
Adds search engine information object
Parameters:
searchEngineInfo - a search engine info object

addSearchEngine

public void addSearchEngine(java.lang.String serverName,
                            java.lang.String indexName)
                     throws DKException
Deprecated. Replace by addSearchEngine

Adds search server and search index of the search magine to the search engine list
Parameters:
serverName - a search server name ie. TM
indexName - a search index name ie. TMINDEX
See Also:
addSearchEngine(com.ibm.mm.sdk.common.dkSearchEngineInfo)

getSearchEngine

public dkSearchEngineInfo getSearchEngine(int index)
                                   throws DKException
Gets search engine from the index position of search engine list (base 1)
Parameters:
index - a position index, the first one is 1
Returns:
a dkSearchEngineInfo object

getSearchEngineCount

public int getSearchEngineCount()
Gets the number of search engines
Returns:
the number of search engines

listSearchEngines

public dkCollection listSearchEngines()
                               throws DKException,
                                      java.lang.Exception
Gets a list of search criteria in this query
Returns:
a collection of search criteria

isSet

public boolean isSet()
Returns true if the search criteria value and operator are set.

getDataType

public short getDataType()
Gets data type of the attribute of parametric criteria
Returns:
attribute data type of this criteria

setDataType

public void setDataType(short attrType)
Sets data type of the attribute of parametric criteria. This is in-memory function only, the data type will not be made persistent. When this search criterion is retrieved from persistent store the data type value is taken from the attribute type. The default type is DK_CM_VSTRING. This method is required when to allow the creation of a search criterion in memory and use it to do search without saving it first to the persistent store.
Parameters:
attrType - attribute data type

isQuoteNeeded

public boolean isQuoteNeeded()
Returns true if the search criteria value need to be enclosed in single quotes when used to create a query term. If the value is of type string, date, time, or timestamp, then it needs to be enclosed in (single) quotes.

clearSearchData

public void clearSearchData()
Clears out search values and reset the search operator to undefined.

getAssociatedEntityName

public java.lang.String getAssociatedEntityName()
Gets the associated entity name associated with this query This entity will support text and parametric query
Returns:
name of associated entity name

setAssociatedEntityName

public void setAssociatedEntityName(java.lang.String assocEntityName)
Sets the associated entity name associated with this query This entity will support text and parametric query
Parameters:
assocEntityName - associated entity name

setAttrId

public void setAttrId(short id)

getAttrId

public short getAttrId()

setEntityId

public void setEntityId(short id)

getEntityId

public short getEntityId()

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.