Oracle Content Management SDK

oracle.ifs.search
Class PropertyQualification

java.lang.Object
  |
  +--oracle.ifs.search.SearchQualification
        |
        +--oracle.ifs.search.PropertyQualification
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class PropertyQualification
extends SearchQualification

The PropertyQualification(PQ) represents a condition on a Class Property. Conecptually PropertyQualifications are similar to AttributeQualifications, except that a PQ is applied on an Object's Property instead of an Attribute.

A PropertyQualification consists of a search Class, a property name, a search Value and a comparison operator. The comparison value must be specified as a AttributeValue. For late Binding, the setlateBound function must be called, with dataType of the property specified. This is required there are no rules for mapping property names to dataTypes. Each object is free to use a property name as it chooses.

Roughly, a PropertyQualification translates to the SQL condition exists (select list of proeprties where name = ' Specified Name' and type = 'Specified Type' and value 'oper' 'Specified Comparison Value'

 //
 // Usage Examples
 
 
 // Search for documents that are having a property value of RED 
 // in a property called "color"

 PropertyQualification pq = new PropertyQualification();
 pq.setClassname(Document.CLASS_NAME);
 pq.setPropertyName("color");
 // Note that the operators used here are same as that in AttributeQualification.
 pq.setOperatorType(AttributeQualification.EQUAL);
 pq.setValue(AttributeValue.newAttributeValue("RED"));
 pq.setCaseIgnored(ignoreCase);
 
 // Using a date type attribute value
 // This looks for a particular date in a property containing Dates.
 
 PropertyQualification pq = new PropertyQualification();
 pq.setClassname(Document.CLASS_NAME);
 pq.setPropertyName("expire-date");
 pq.setOperatorType(AttributeQualification.EQUAL);
 pq.setValue(AttributeValue.newAttributeValue(new GregorianCalendar(1995, 0, 15).getTime()));
 pq.setDateComparisonLevel(AttributeQualification.DATE_COMP_MONTH);
 
 // Using DOCUMENT(or any object type) type attribute value
 // This looks for a particular document in a property containing DOCUMENT objects 
 
 PropertyQualification pq = new PropertyQualification();
 pq.setClassname(Document.CLASS_NAME);
 pq.setPropertyName("related-docs");
 pq.setOperatorType(AttributeQualification.EQUAL);
 pq.setValue(AttributeValue.newAttributeValue(new Document[] {d}));
 
 // Using late bound attribute value with a property search 
 
 AttributeValue srchDate = AttributeValue.newAttributeValue(new GregorianCalendar(1995, 0, 1).getTime());
 PropertyQualification pq = new PropertyQualification();
 pq.setClassname(Document.CLASS_NAME);
 pq.setPropertyName("expire-date");
 pq.setOperatorType(AttributeQualification.EQUAL);
 pq.setLateBoundDataType(srchDate.getDataType());

 

See Also:
Serialized Form

Fields inherited from class oracle.ifs.search.SearchQualification
LATE_BIND_OPER
 
Constructor Summary
PropertyQualification()
          Constructs a PropertyQualification.
 
Method Summary
 java.lang.String getClassname()
          Returns the search class for this qualification object.
 int getDateComparisonLevel()
          Returns the date comparison level.
 int getLateBoundDataType()
          Get the data type if the qualification is late bound.
 int getOperatorType()
          Gets the operator for this qualification.
 java.lang.String getPropertyName()
          Return the name of the property being searched.
 AttributeValue getValue()
          Return the comparison value.
 boolean isCaseIgnored()
          Returns true if this object is set to be case insensitive.
 boolean isLateBound()
          Returns true if the qualification is late bound.
 void setCaseIgnored(boolean value)
          Sets up case sensitive behavior for this object.
 void setClassname(java.lang.String clss)
          Set the Search Classname.
 void setDateComparisonLevel(int df)
          Sets the date comparison value.
 void setLateBoundDataType(int dataType)
          Set Qualification as Late Bound.
 void setOperatorType(int oper)
          Sets the comparision operator.
 void setOperatorType(java.lang.String oper)
          Sets the comparison operator.
 void setPropertyName(java.lang.String name)
          Set the name of property used in the condition.
 void setValue(AttributeValue av)
          Sets the comparison value.
 
Methods inherited from class oracle.ifs.search.SearchQualification
clone
 

Constructor Detail


PropertyQualification

public PropertyQualification()
                      throws IfsException
Constructs a PropertyQualification. The Date Comparison Level is set to DATE_COMP_SEC, and the comparison operator is set to EQUAL. There are no defaulst for the propertyName, and Search Class.
Method Detail

setClassname

public void setClassname(java.lang.String clss)
                  throws IfsException
Set the Search Classname.

Class should be a valid iFS PublicObject or SubClass or an Alias. A null class is taken to mean, use the first Result Class of the SearchSpecification.

Parameters:
clss - Search Class.
Throws:
IfsException - if the operation fails
See Also:
SearchClassSpecification

getClassname

public java.lang.String getClassname()
                              throws IfsException
Returns the search class for this qualification object.
Returns:
search class.
Throws:
IfsException - if the operation fails

setPropertyName

public void setPropertyName(java.lang.String name)
                     throws IfsException
Set the name of property used in the condition. Property Name cannot be null.
Parameters:
name - name of searched property.

getPropertyName

public java.lang.String getPropertyName()
Return the name of the property being searched.
Returns:
searched property.

setValue

public void setValue(AttributeValue av)
              throws IfsException
Sets the comparison value. Irrespective of value, Qualification is assumed not to be late bound. Use setLateBound to specify Qualification as Late Bound. The dataType of the specified AttributeValue is assumed to be the dataType of the property.
Parameters:
av - the comparison value specified as an AttrbuteValue
Throws:
IfsException - 22002 if av is null.

getValue

public AttributeValue getValue()
Return the comparison value.
Returns:
comparison value.

setLateBoundDataType

public void setLateBoundDataType(int dataType)
                          throws IfsException
Set Qualification as Late Bound. The dataType of the property needs to be specified. Note there are no rules for mapping property names to datatypes. A property name can be used by different objects to mean differen things.
Parameters:
dataType - property's dataType
Throws:
IfsException - if the operation fails

getLateBoundDataType

public int getLateBoundDataType()
                         throws IfsException
Get the data type if the qualification is late bound. If the qualification is not late bound, it throws IfsException.
Returns:
data type of this qualification if it is late bound
Throws:
IfsException - if the operation fails

isLateBound

public boolean isLateBound()
Returns true if the qualification is late bound.
Overrides:
isLateBound in class SearchQualification
Returns:
whether Qualification is late bound.

setOperatorType

public void setOperatorType(java.lang.String oper)
                     throws IfsException
Sets the comparison operator. This variant lets the user pass in a string to represent the operator instead on the integer.
Parameters:
oper - comparison operator string; this should be one of =, <, <=, >, >=, !=, <>, IS NULL, IS NOT NULL, LIKE or NOT LIKE.
Throws:
IfsException - if specified operator is not supported.
See Also:
AttributeQualification

setOperatorType

public void setOperatorType(int oper)
                     throws IfsException
Sets the comparision operator.
Parameters:
oper - comaprison operator must be one of, AttributeQualification.EQUAL , AttributeQualification.GREATER_THAN , AttributeQualification.GREATER_THAN_EQUAL , AttributeQualification.IS_NOT_NULL , AttributeQualification.IS_NULL , AttributeQualification.LESS_THAN , AttributeQualification.LESS_THAN_EQUAL , AttributeQualification.LIKE
Throws:
IfsException - if specified operator is not supported.
See Also:
AttributeQualification

getOperatorType

public int getOperatorType()
                    throws IfsException
Gets the operator for this qualification.
Returns:
the operator of the Qualification.

setDateComparisonLevel

public void setDateComparisonLevel(int df)
                            throws IfsException
Sets the date comparison value. The default is DATE_COMP_SEC. If df is not valid, date comparison level is set to the default.
Parameters:
df - date comparison level. should be one of AttributeQualification.DATE_COMP_DAY, AttributeQualification.DATE_COMP_MONTH, AttributeQualification.DATE_COMP_YEAR, AttributeQualification.DATE_COMP_SEC, AttributeQualification.DATE_COMP_MIN, AttributeQualification.DATE_COMP_HOUR
Throws:
IfsException - if the operation fails
See Also:
AttributeQualification

setCaseIgnored

public void setCaseIgnored(boolean value)
                    throws IfsException
Sets up case sensitive behavior for this object. If the value is true search with respect to this qualification will ignore case. Default behavior is case sensitive.
Throws:
IfsException - if the operation fails

getDateComparisonLevel

public int getDateComparisonLevel()
Returns the date comparison level.
Returns:
date comparison level.

isCaseIgnored

public boolean isCaseIgnored()
Returns true if this object is set to be case insensitive.
Returns:
boolean True or False.

Oracle Content Management SDK

(c) 2002 Copyright Oracle Corporation. All rights reserved.