Content Manager OnDemand V8.5 WEK APIs

com.ibm.edms.od
Class ODCriteria

java.lang.Object
  extended by com.ibm.edms.od.ODCriteria
All Implemented Interfaces:
java.io.Serializable

public class ODCriteria
extends java.lang.Object
implements java.io.Serializable

A class representing a OnDemand folder criteria. The criteria class contains methods to set a search operator and search values.

(c) Copyright IBM Corp. 1993, 2003. All Rights Reserved

See Also:
Serialized Form

Method Summary
 java.lang.String[] getApplicationGroupNames()
          Get the application group names that this criteria has mappings to.
 boolean getAscending()
          Get the search type of the current criteria.
 java.lang.String[] getDBFieldNames(java.lang.String agName)
          Get the database field name(s) for this folder criteria.
 java.util.Hashtable getDBFixedValuesMapping(java.lang.String agName)
          This API will return the possible values that can be used to update an InputTypeChoice (#ODConstant.InputTypeChoice) field.
 java.lang.String getDefaultFmt()
          Get the default format for this criteria.
 char getDefaultFmtQual()
          Get the default format qualifier for this criteria.
 java.lang.String getDescription()
          Get the description of the criteria.
 java.lang.String getDisplayFmt()
          Get the display format for this criteria.
 char getDisplayFmtQual()
          Get the display format qualifier for this criteria.
 char getFieldQualifier()
          Get the criteria qualifier.
 java.lang.String[] getFixedValues()
          Get the valid search values for this criteria.
 int getMaxDisplayChars()
          Get the maximum display characters.
 int getMaxEntryChars()
          Get the maximum entry characters.
 java.lang.String getMaxSearchValue()
          Get the Maximum Search Value.
 java.lang.String getMinSearchValue()
          Get the Minimum Search Value.
 java.lang.String getName()
          Get the name of the criteria.
 int getOperator()
          Get the current search operator.
 java.lang.String[] getSearchValues()
          Get the current search values.
 int getSortOrder()
          Get the search sort value for the current criteria.
 char getSubType()
          Get the subtype of the criteria.
 char getType()
          Get the type of criteria.
 int[] getValidOperators()
          Get the valid operators.
 boolean isDefaultValueAvailable()
          Determine whether a default value is available for this criteria.
 boolean isDefaultValueFixed()
          Determine whether the default value for this criteria is fixed (cannot be changed).
 boolean isDisplayable()
          Determine whether this criteria is Displayable.
 boolean isQueryable()
          Determine whether this criteria is Queryable.
 boolean isRequired()
          Determine whether a value is required for this criteria when searching the folder.
 boolean isUpdateable(java.lang.String agName, java.lang.String agFldName)
          Verify that this field can be updated.
 void setAscending(boolean value)
          Set the search type for the current criteria.
 void setOperator(int op)
          Set the current search operator.
 void setSearchValue(java.lang.String v)
          Set this criteria's search value.
 void setSearchValues(java.lang.String v1, java.lang.String v2)
          Set this criteria's search values.
 void setSortOrder(int value)
          Set the search sort value for the current criteria.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSortOrder

public void setSortOrder(int value)
Set the search sort value for the current criteria. Integer values between 0 and 32.
A value of 0 indicates that the hitlist will not be sorted by this value. Otherwise, specify the order you want to sort with in regard to this current criteria.

See Also:
ODFolder.setSortLocation(char)

getSortOrder

public int getSortOrder()
Get the search sort value for the current criteria. Values returned are integers between 0 and 32.

Returns:
integer.

setAscending

public void setAscending(boolean value)
Set the search type for the current criteria. Value is true for ascending or false for descending.


getAscending

public boolean getAscending()
Get the search type of the current criteria. Value returned is true or false, true being ascending, false being descending.

Returns:
true or false.

getName

public java.lang.String getName()
Get the name of the criteria.

Returns:
The criteria name.

getDescription

public java.lang.String getDescription()
Get the description of the criteria.

Returns:
The criteria description.

getType

public char getType()
Get the type of criteria. All of the criteria types are represented in ODConstant.

Returns:
The criteria type.
See Also:
ODConstant.InputTypeNormal, ODConstant.InputTypeChoice, ODConstant.InputTypeSegment, ODConstant.InputTypeTextSearch, ODConstant.InputTypeNoteTextSearch, ODConstant.InputTypeNoteColor

getSubType

public char getSubType()
Get the subtype of the criteria. All of the criteria subtypes are represented in ODConstant.

Returns:
The criteria subtype.
See Also:
ODConstant.OD_FLD_ANN_TEXT_SEARCH, ODConstant.OD_FLD_BIGINT, ODConstant.OD_FLD_ANN_COLOR_SEARCH, ODConstant.OD_FLD_DECIMAL, ODConstant.OD_FLD_APPLGRP, ODConstant.OD_FLD_INTEGER, ODConstant.OD_FLD_SMALLINT, ODConstant.OD_FLD_SEGMENT, ODConstant.OD_FLD_STRING, ODConstant.OD_FLD_TEXT_SEARCH, ODConstant.OD_FLD_VOID

getFieldQualifier

public char getFieldQualifier()
Get the criteria qualifier. All of the criteria qualifiers are represented in ODConstant.

Returns:
The criteria qualifier.
See Also:
ODConstant.OD_FLDQ_BASE, ODConstant.OD_FLDQ_DATETIME, ODConstant.OD_FLDQ_DATE, ODConstant.OD_FLDQ_TIME, ODConstant.OD_FLDQ_TZ_DATETIME

getMinSearchValue

public java.lang.String getMinSearchValue()
Get the Minimum Search Value.

Returns:
the specified Default Mimimum value for this criteria.

getMaxSearchValue

public java.lang.String getMaxSearchValue()
Get the Maximum Search Value.

Returns:
the specified Default Maximum value for this criteria.

getValidOperators

public int[] getValidOperators()
Get the valid operators. All of the operator types are represented in ODConstant.

Returns:
An integer array containing the valid operators for this criteria.
See Also:
ODConstant.OPEqual, ODConstant.OPNotEqual, ODConstant.OPLessThan, ODConstant.OPLessThanEqual, ODConstant.OPGreaterThan, ODConstant.OPGreaterThanEqual, ODConstant.OPIn, ODConstant.OPNotIn, ODConstant.OPLike, ODConstant.OPNotLike, ODConstant.OPBetween, ODConstant.OPNotBetween

getOperator

public int getOperator()
Get the current search operator. All of the operator types are represented in ODConstant.

Returns:
The current search operand.
See Also:
ODConstant.OPEqual, ODConstant.OPNotEqual, ODConstant.OPLessThan, ODConstant.OPLessThanEqual, ODConstant.OPGreaterThan, ODConstant.OPGreaterThanEqual, ODConstant.OPIn, ODConstant.OPNotIn, ODConstant.OPLike, ODConstant.OPNotLike, ODConstant.OPBetween, ODConstant.OPNotBetween

setOperator

public void setOperator(int op)
                 throws ODException
Set the current search operator. All of the operand types are represented in ODConstant.

Parameters:
op - Operand to use for this criteria when performing a search.
Throws:
ODException
See Also:
ODConstant.OPEqual, ODConstant.OPNotEqual, ODConstant.OPLessThan, ODConstant.OPLessThanEqual, ODConstant.OPGreaterThan, ODConstant.OPGreaterThanEqual, ODConstant.OPIn, ODConstant.OPNotIn, ODConstant.OPLike, ODConstant.OPNotLike, ODConstant.OPBetween, ODConstant.OPNotBetween

getSearchValues

public java.lang.String[] getSearchValues()
Get the current search values. Immediately after opening a folder this vector contains any default search values specified by the OnDemand administrator.

Returns:
String[] containing current set of search values.

setSearchValue

public void setSearchValue(java.lang.String v)
                    throws ODException
Set this criteria's search value. This method should be used if the search operator requires one search value.

Parameters:
v - Search value.
Throws:
ODException

setSearchValues

public void setSearchValues(java.lang.String v1,
                            java.lang.String v2)
                     throws ODException
Set this criteria's search values. This method is used when the search operator requires more than one search value, i.e., the between operator.

Parameters:
v1 - Search value number one.
v2 - Search value number two.
Throws:
ODException

getFixedValues

public java.lang.String[] getFixedValues()
Get the valid search values for this criteria. This method is only valid if this criteria has a fixed set of search values.

Returns:
String[] containing possible search values.

getDisplayFmt

public java.lang.String getDisplayFmt()
Get the display format for this criteria. For date/time fields this value represents the format the database values should be displayed in as set by the OD administrator.

Returns:
The display format.

getDisplayFmtQual

public char getDisplayFmtQual()
Get the display format qualifier for this criteria. For date/time fields this value represents the format qualifier for the display format.

Returns:
The display format qualifier.

getDefaultFmt

public java.lang.String getDefaultFmt()
Get the default format for this criteria. For date/time fields this value represents the format values should be specified in when performing searches. In the case where the OnDemand admin has not specified a default date/time format, the following will be returned.
      DefaultTimeFormat = "%H:%M:%S"
      DefaultDateFormat = "%m/%d/%y"
      DefaultDateTimeFormat = "%m/%d/%y %H:%M:%S"
 

Returns:
The default format.

getDefaultFmtQual

public char getDefaultFmtQual()
Get the default format qualifier for this criteria. For date/time fields this value represents the format qualifier for the default format.

Returns:
The default format qualifier.

isRequired

public boolean isRequired()
Determine whether a value is required for this criteria when searching the folder.

Returns:
true/false

isDisplayable

public boolean isDisplayable()
Determine whether this criteria is Displayable.

Returns:
true/false

isQueryable

public boolean isQueryable()
Determine whether this criteria is Queryable.

Returns:
true/false

isDefaultValueAvailable

public boolean isDefaultValueAvailable()
Determine whether a default value is available for this criteria.

Returns:
true/false

isDefaultValueFixed

public boolean isDefaultValueFixed()
Determine whether the default value for this criteria is fixed (cannot be changed).

Returns:
true/false

getMaxEntryChars

public int getMaxEntryChars()
Get the maximum entry characters.

Returns:
The maximum number of characters that can be entered for this criteria during a search operation.

getMaxDisplayChars

public int getMaxDisplayChars()
Get the maximum display characters.

Returns:
The maximum number of characters that will be present in a display value for this criteria after a search operation.

getDBFieldNames

public java.lang.String[] getDBFieldNames(java.lang.String agName)
Get the database field name(s) for this folder criteria. This method will return the database field name(s) for this criteria object. Only those db field names for the specified application group will be returned. If the String[] returned contains more than one element it means that the folder field is mapped to two fields within the specified application group.

Parameters:
agName - The application group for which the db fields are required.
Returns:
String array containing the database field name(s). Will return null if this criteria is not mapped to an Application Group Field.

getApplicationGroupNames

public java.lang.String[] getApplicationGroupNames()
Get the application group names that this criteria has mappings to. Once you have these names you can then use ODCriteria.getDBFieldNames(String) to determine the field names within the application group that this criteria is mapped to.

Returns:
String array containing the application group name(s).

getDBFixedValuesMapping

public java.util.Hashtable getDBFixedValuesMapping(java.lang.String agName)
This API will return the possible values that can be used to update an InputTypeChoice (#ODConstant.InputTypeChoice) field. Since a single folder can be mapped to multiple Application Groups, this Hashtable contains only field values for the specified Application Group.

NOTE: A Fixed Choice Field that is mapped to an Application ID field cannot be updated.

Parameters:
String - AGName The Application Group Name from the ODHit that will be updated.
Returns:
Hashtable. The Keys are the Display/Search values (see #getFixedValues()), and the Elements are the internal values required for #ODFolder.updateValuesForHits().
See Also:
ODHit.getApplGrpName(), ODCriteria.isUpdateable(java.lang.String, java.lang.String)

isUpdateable

public boolean isUpdateable(java.lang.String agName,
                            java.lang.String agFldName)
                     throws ODException
Verify that this field can be updated.
Used in conjunction with ODHit.hasPermToUpdateDoc() to determine permissions for updating field info for a document/hit.

Parameters:
agName - The Application Group name for the specific ODHit you are attempting to update.
agFldName - The Application Group Field Name that you are attempting to update.
Returns:
true if the field can be updated.
Throws:
ODException
See Also:
ODHit.getApplGrpName(), ODCriteria.getDBFieldNames(java.lang.String), ODHit.hasPermToUpdateDoc()

CM OnDemand V8.5 WEK Java APIs

(c)Copyright International Business Machines Corporation 2001, 2013. IBM Corp. All rights reserved.