FileNet Content Services
Java Connector v3.0

com.filenet.wcm.api
Interface ReadableMetadataObjects

All Superinterfaces:
BaseObjects, java.util.Collection, java.util.List, java.io.Serializable
All Known Subinterfaces:
ChoiceLists, ClassDescriptions, CustomObjects, Documents, Domains, EventActions, FeatureAddOns, Folders, Groups, Links, ObjectStores, PropertyDescriptions, PublishRequests, PublishTemplates, ReadableSecurityObjects, Realms, SearchPropertyDescriptions, SecurityPolicies, StoredSearches, StyleTemplates, Subscriptions, Users, WorkflowDefinitions, WorkflowSubscriptions, WriteableMetadataObjects, WriteableSecurityObjects

public interface ReadableMetadataObjects
extends BaseObjects

A ReadableMetadataObjects collection represents a collection of ReadableMetadataObject objects.

This interface includes two families of polymorphic methods, filterByProperty and findByProperty. All forms of these methods take as parameters a property name, a relational operator, and a value. (The polymorphism comes from the different data types for the value parameter). Using the relational operator, the methods compare an object's value for a property to the given value.

The filterByProperty methods return a collection that contains references to all matching objects from the original collection. On the other hand, the findByProperty methods stop their comparison upon finding the first match, and so always return a single ReadableMetadataObject, which might be null.

Not all relational operators apply for all the polymorphic forms. Any restrictions or caveats are noted in the descriptions of the specific methods. Note that a null property value is less than any non-null parameter value, and a non-null property value is greater than any null parameter value. To find objects for which the value "is null" or "is not null", choose one of the polymorphic forms in which the value is an Object and pass in null for the value.

The ReadableMetadataObjects interface also includes two forms of the orderByProperty method, which sorts the collection by the given property.

See Also:
CS Java Connector Developer's Guide

Field Summary
static int IS_EQUAL
          Relational operator for use with filterByProperty() or findByProperty().
static int IS_GREATER
          Relational operator for use with filterByProperty() or findByProperty().
static int IS_GREATER_OR_EQUAL
          Relational operator for use with filterByProperty() or findByProperty().
static int IS_LESS
          Relational operator for use with filterByProperty() or findByProperty().
static int IS_LESS_OR_EQUAL
          Relational operator for use with filterByProperty() or findByProperty().
static int IS_NOT_EQUAL
          Relational operator for use with filterByProperty() or findByProperty().
 
Method Summary
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, boolean value)
          Returns a collection of matching objects for the given property, relational operator, and boolean value.
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, byte[] value)
          Returns a collection of matching objects for the given property, relational operator, and byte array of binary values.
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, java.util.Date value)
          Returns a collection of matching objects for the given property, relational operator, and Date value.
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, double value)
          Returns a collection of matching objects for the given property, relational operator, and double value.
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, int value)
          Returns a collection of matching objects for the given property, relational operator, and integer value.
 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, ReadableMetadataObject value)
          

Not Implemented in CS Java Connector v3.0.

 ReadableMetadataObjects filterByProperty(java.lang.String propertyName, int op, java.lang.String value)
          Returns a collection of matching objects for the given property, relational operator, and String value.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, boolean value)
          Returns, at most, one matching object for the given property, relational operator, and boolean value.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, byte[] value)
          Returns, at most, one matching object for the given property, relational operator, and byte array of binary values.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, java.util.Date value)
          Returns, at most, one matching object for the given property, relational operator, and Date value.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, double value)
          Returns, at most, one matching object for the given property, relational operator, and double value.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, int value)
          Returns, at most, one matching object for the given property, relational operator, and integer value.
 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, ReadableMetadataObject value)
          

Not Implemented in CS Java Connector v3.0.

 ReadableMetadataObject findByProperty(java.lang.String propertyName, int op, java.lang.String value)
          Returns, at most, one matching object for the given property, relational operator, and String value.
 void orderByProperty(java.lang.String propertyName)
          Sorts this ReadableMetadataObjects collection by the given property.
 void orderByProperty(java.lang.String propertyName, java.util.Locale loc)
          Sorts this ReadableMetadataObjects collection by the given String-valued property for the specified locale.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

IS_EQUAL

public static final int IS_EQUAL
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values

IS_NOT_EQUAL

public static final int IS_NOT_EQUAL
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values

IS_GREATER

public static final int IS_GREATER
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values

IS_GREATER_OR_EQUAL

public static final int IS_GREATER_OR_EQUAL
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values

IS_LESS

public static final int IS_LESS
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values

IS_LESS_OR_EQUAL

public static final int IS_LESS_OR_EQUAL
Relational operator for use with filterByProperty() or findByProperty().

See Also:
Constant Field Values
Method Detail

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                byte[] value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and byte array of binary values. The comparisons are lexical byte-by-byte comparisons and do not use locale-based collation rules.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - A byte array of binary values to which objects' property values are compared.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                boolean value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and boolean value. To test for a null value, specify false in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface. You can use only IS_EQUAL and IS_NOT_EQUAL with this variant of the method.

value - The boolean value to which objects' property values are compared. Specify false for a null value.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                java.util.Date value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and Date value.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The Date value to which objects' property values are compared.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                double value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and double value. To test for a null value, specify Double.NaN in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The double value to which objects' property values are compared. Specify Double.NaN for a null value.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                int value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and integer value. To test for a null value, specify Integer.MIN_VALUE in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The int value to which objects' property values are compared. Specify Integer.MIN_VALUE for a null value.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                java.lang.String value)
                                         throws PropertyNotFoundException
Returns a collection of matching objects for the given property, relational operator, and String value. The String comparisons are lexical comparisons done via the String.compareTo method. These comparisons do not use locale-based collation rules.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The String value to which objects' property values are compared.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

filterByProperty

public ReadableMetadataObjects filterByProperty(java.lang.String propertyName,
                                                int op,
                                                ReadableMetadataObject value)
                                         throws PropertyNotFoundException

Not Implemented in CS Java Connector v3.0.

Returns a collection of matching objects for the given property, relational operator, and ReadableMetadataObject value. To test for a null value, specify a null cast to a ReadableMetadataObject in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface. You can use only IS_EQUAL and IS_NOT_EQUAL with this variant of the method.

value - The ReadableMetadataObject value to which objects' property values are compared.

Returns:
A ReadableMetadataObjects collection. The elements of the returned collection are objects that match the filtering criteria. If no matches are found, returns an empty collection.

Throws:
PropertyNotFoundException - Thrown when one or more of the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             byte[] value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and byte array of binary values. The comparisons are lexical byte-by-byte comparisons and do not use locale-based collation rules.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - A byte array of binary values to which objects' property values are compared.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             boolean value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and boolean value. To test for a null value, specify false in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface. You can use only IS_EQUAL and IS_NOT_EQUAL with this variant of the method.

value - The boolean value to which objects' property values are compared. Specify false for a null value.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             java.util.Date value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and Date value.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The Date value to which objects' property values are compared.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             double value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and double value. To test for a null value, specify Double.NaN in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The double value to which objects' property values are compared. Specify Double.NaN for a null value.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             int value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and integer value. To test for a null value, specify Integer.MIN_VALUE in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The int value to which objects' property values are compared. Specify Integer.MIN_VALUE for a null value.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             java.lang.String value)
                                      throws PropertyNotFoundException
Returns, at most, one matching object for the given property, relational operator, and String value. The String comparisons are lexical comparisons done via the String.compareTo method. These comparisons do not use locale-based collation rules.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface.

value - The String value to which objects' property values are compared.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when the objects in the collection do not have a property of the given name.

findByProperty

public ReadableMetadataObject findByProperty(java.lang.String propertyName,
                                             int op,
                                             ReadableMetadataObject value)
                                      throws PropertyNotFoundException

Not Implemented in CS Java Connector v3.0.

Returns, at most, one matching object for the given property, relational operator, and ReadableMetadataObject value. To test for a null value, specify a null cast to a ReadableMetadataObject in the value parameter.

Parameters:
propertyName - A String that is the symbolic name of the property to be examined. (The Property interface has constants for well-known properties.)

op - A relational operator selected from among those defined in this interface. You can use only IS_EQUAL and IS_NOT_EQUAL with this variant of the method.

value - The ReadableMetadataObject value to which objects' property values are compared.

Returns:
A reference to a matching object (or null if no matches are found).

Throws:
PropertyNotFoundException - Thrown when one or more of the objects in the collection do not have a property of the given name.

orderByProperty

public void orderByProperty(java.lang.String propertyName)
                     throws PropertyNotFoundException
Sorts this ReadableMetadataObjects collection by the given property. Collation is in ascending order based on the value of the property. This method uses the default locale for this instance of the Java Virtual Machine. For locale-sensitive sorting on String-valued properties, use the orderByProperty(propertyName, loc) form of this method. When specifying the symbolic name of the property, you can use constants available in the Property interface.

For example, the following code fragment retrieves a collection of documents filed in a folder, then sorts them by their DocumentTitle property:

 Folder someFolder = (Folder) objectStore.getObject(BaseObject.TYPE_FOLDER,"/Some Folder");
 int[] filter = {BaseObject.TYPE_DOCUMENT};
 ReadableMetadataObjects someDocs = (ReadableMetadataObjects) someFolder.getContainees(filter);
 someDocs.orderByProperty("DocumentTitle");

 Iterator iter = someDocs.iterator();
 while(iter.hasNext())
 {
     ReadableMetadataObject d = (ReadableMetadataObject) iter.next();
     System.out.println("Title is: " +
       d.getPropertyStringValue("DocumentTitle"));
 }
 

Parameters:
propertyName - A String that specifies the symbolic name of the property used to determine the order of the collection. (The Property interface has constants for well-known properties.)

Throws:
PropertyNotFoundException - Thrown when an object in the collection does not have a property of the given name.

orderByProperty

public void orderByProperty(java.lang.String propertyName,
                            java.util.Locale loc)
                     throws PropertyNotFoundException
Sorts this ReadableMetadataObjects collection by the given String-valued property for the specified locale. Collation is in ascending order based on the value of the property. This method does not throw an exception if the specified property is not String-valued, but the loc parameter is ignored and the default locale for this instance of the Java Virtual Machine is used instead. When specifying the symbolic name of the property, you can use constants available in the Property interface.

Parameters:
propertyName - A String that specifies the symbolic name of the property used to determine the order of the collection. (The Property interface has constants for well-known properties.)

loc - A java.util.Locale object that specifies the locale to use. Ignored if propertyName does not specify a String-valued property.

Throws:
PropertyNotFoundException - Thrown when an object in the collection does not have a property of the given name.

FileNet Content Services
Java Connector v3.0