Index

DKSearchCriteria

Purpose:

This class is used to specify a search criteria in a template query. A template query may have more than one search criteria.

Class summary:

 class DKSearchCriteria
 {
   public:
      DKSearchCriteria();
      DKSearchCriteria(const char* entityName, const char* attrName);
      virtual   ~DKSearchCriteria();
      DKString  getName();
      void      setName(const char* newName);
      DKString  getDisplayName();
      void      setDisplayName(const char* dispName);
      short     getId();
      void      setId(short id);
      DKString  getEntityName();
      void      setEntityName(const char* newName);
      DKString  getAttrName();
      void      setAttrName(const char* newName);
  
      short     getDefaultOperator();
      void      setDefaultOperator(short defOperator);
      short*    getValidOperators(long& arraySize);
      void      setValidOperators(short* validOps, long arraySize);
      DKString* getDefaultValues(long& arraySize);
      void      setDefaultValues(const DKString* values, long arraySize);
      dkCollection* getPredefinedValues(); 
      void      addPredefinedValues(DKPredefinedValuesFed* pdefValues);
      short     getOperator();
      void      setOperator(short newOp);
  
      DKString  getValue();
      void      setValue(const char* newVal);
  
      short     getDisplayPosition();
      void      setDisplayPosition(short order);
      short     getDisplayWidth();
      void      setDisplayWidth(short width);
      short     getCriteriaPosition();
      void      setCriteriaPosition(short order);
  
      void      setDisplayable(boolean displayable);
      boolean   isDisplayable();
      void      setQueryable(boolean queryable);
      boolean   isQueryable();
  
      short     getType();
      void      setType(short aType); 
 } 

Members:

Constructors and destructor
DKSearchCriteria();
DKSearchCriteria(const char* entityName, const char* attrName);
virtual   ~DKSearchCriteria();

DKSearchCriteria has two constructors: one creates a new instance with default values, the other creates a new instance of search criteria with associated federated entity and attribute names.

Member functions

getName
Gets search criteria name.
DKString getName();

setName
Sets the search criteria name.

Parameters
newName -- The name of this search criteria.

void setName(const char* newName);

getDisplayName
Gets the search criteria display name.
DKString getDisplayName();

setDisplayName
Sets display name in the result list for the search criteria.

Parameters
dispName -- The search criteria display name.

void setDisplayName(const char* dispName);

getId
Gets the search criteria ID.
short getId(); 

setId
Sets the search criteria ID.
void setId(short id);

setEntityName
Sets the associated (mapped) entity name of this search criteria.
void setEntityName(const char* newName);

getEntityName
Gets the associated (mapped) entity name of this search criteria.
DKString getEntityName();

getAttrName
Gets the associated (mapped) attribute name of this search criteria.
DKString getAttrName();

setAttrName
Sets the associated (mapped) attribute name of this search criteria.
void setAttrName(const char* newName);

getDefaultOperator
Gets the default operator previously defined for this search criteria.
short getDefaultOperator();

setDefaultOperator
Sets the default operator for this search criteria. Refer to the DKOpCode class for the valid operators.
void setDefaultOperator(short defOperator);

getVaildOperators
Gets the list of valid query operators for this search criteria. Returns an array of short integers.
short* getValidOperators(long& arraySize);

setValidOperators
Sets the list of valid operators for this search criteria. Refer to the DKOpCode class for the valid operators.
void setValidOperators(short* validOps, long arraySize);

getDefaultValues
Gets the default search values for the parametric search criteria. Returns an array of values.
DKString* getDefaultValues(long& arraySize);

setDefaultValues
Sets the default search values for the parametric search criteria.
void setDefaultValues(const DKString* values, long arraySize);

getPredefinedValues
Gets the list of predefined search values for this criteria. This list is intended to be used by GUI based application to display these values as valid choices for this criteria. It return a collection of DKPredefinedValuesFed objects, each object will hold the mapping of mapped attribute value with map-to attribute value for each content server.
dkCollection* getPredefinedValues();

addPredefinedValues
Adds the predefined value pairs to this search criteria. See getPredefinedValues for the description of DKPredefinedValuesFed object.
void addPredefinedValues(DKPredefinedValuesFed* pdefValues);

getOperator
Gets the operator in this search criteria.
short getOperator();

setOperator
Sets the operator in this search criteria.
void setOperator(short newOp);

getValues
Gets the search values for this criteria. More than one values are required for operators requiring more than one values, such as IN and BETWEEN. Returns an array of values.
 DKString* getValues(long& arraySize);

setValues
Sets the search value for this criteria.
void setValues(const DKString* values, long arraySize);

getValue
Gets the search value for this criteria.
DKString getValue();

setValue
Sets the search value for this criteria.
void setValue(const char* value);

getDisplayPosition
Gets the column display order within the search results.
short getDisplayPosition();

setDisplayPosition
Sets the column display order within the search results.
void setDisplayPosition(short order);

getDisplayWidth
Gets the column display width within the search results.
short getDisplayWidth();

setDisplayWidth
Sets the column display width within the search results.
void setDisplayWidth(short width);

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.
short getCriteriaPosition();

setCriteriaPosition
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.
void setCriteriaPosition(short order);

setDisplayable
Sets whether this criterion is displayable in the result set. Sets to TRUE if is for display.
void setDisplayable(DKBoolean displayable);

isDisplayable
Checks whether this criterion is displayable in the result set and returns TRUE if this criterion will be displayed as a column in result set.
DKBoolean isDisplayable();

setQueryable
Sets whether this criterion is queryable, TRUE if this criterion can participate in the formulation of the query.
void setQueryable(DKBoolean queryable);

isQueryable
Checks whether this criterion is queryable. It returns TRUE if this criterion can participate in the formulation of the query.
DKBoolean isQueryable();

getType
Sets the search criteria type.
short getType();

setType
Sets the search criteria type.
void setType(short aType);

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