FileNet Content Services
Java Connector v3.0

com.filenet.wcm.api
Interface Search

All Known Subinterfaces:
Search

public interface Search

A Search object contains the search criteria used to retrieve objects from an object store (library). The search criteria is expressed in a Structured Query Language (SQL) statement and formatted in an XML string. A Search object has no properties associated with it and cannot be persisted to an object store.

To create a Search object, call ObjectFactory.getSearch(Session sess). The code fragment below creates a Session object (which supplies the logon credentials to the Content Services server), and creates an instance of a Search object:

 Session oSession = ObjectFactory.getSession("TestApp", null, "testuser",
                "testpassword", "testdomain");
 Search oSearch = ObjectFactory.getSearch(oSession);

Note: In this release of the CS Java Connector, you can search by property values for current document versions in a single object store.

See Also:
CS Java Connector Developer's Guide

Field Summary
static java.lang.String MERGE_TYPE_INTERSECTION
          

Not Implemented in CS Java Connector v3.0.

static java.lang.String MERGE_TYPE_NONE
          

Not Implemented in CS Java Connector v3.0.

static java.lang.String MERGE_TYPE_UNION
          

Not Implemented in CS Java Connector v3.0.

 
Method Summary
 java.lang.String executeXML(java.lang.String searchRequestXML)
          Executes a Property Based Search and Content Based Retrieval and then returns the matching results as a String formatted according to the Microsoft ADO XML schema.
 ChoiceLists getChoiceLists(ObjectStores objectStores, java.lang.String mergeOption, SearchPropInfo[] propInfo)
          

Not Implemented in CS Java Connector v3.0.

 ClassDescriptions getClassDescriptions(ObjectStores objectStores, java.lang.String mergeOption)
          

Not Implemented in CS Java Connector v3.0.

 ClassDescriptions getClassDescriptions(ObjectStores objectStores, java.lang.String mergeOption, int[] objectTypes)
          

Not Implemented in CS Java Connector v3.0.

 SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores, java.lang.String mergeOption, int[] objectTypes)
          

Not Implemented in CS Java Connector v3.0.

 SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores, java.lang.String mergeOption, int objectType, SearchClassInfo[] classInfo)
          

Not Implemented in CS Java Connector v3.0.

 SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores, java.lang.String mergeOption, SearchClassInfo[] classInfo)
          

Not Implemented in CS Java Connector v3.0.

 SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores, java.lang.String mergeOption, SearchPropInfo[] propInfo)
          

Not Implemented in CS Java Connector v3.0.

 BaseObjects singleObjectTypeExecute(java.lang.String searchRequestXML, int objectType)
          

Not Implemented in CS Java Connector v3.0.

 java.lang.String singleObjectTypeExecuteXML(java.lang.String searchRequestXML, int objectType)
          

Not Implemented in CS Java Connector v3.0.

 

Field Detail

MERGE_TYPE_NONE

public static final java.lang.String MERGE_TYPE_NONE

Not Implemented in CS Java Connector v3.0.

Specifies that no merge is to be performed. Use this setting when passing an ObjectStores collection that contains a single ObjectStore object.

See Also:
Constant Field Values

MERGE_TYPE_UNION

public static final java.lang.String MERGE_TYPE_UNION

Not Implemented in CS Java Connector v3.0.

Specifies the merge option as union. Specifies that the result set (columns and rows of data returned from a search) will contain the requested property descriptions from the union of two or more object stores being queried.

See Also:
Constant Field Values

MERGE_TYPE_INTERSECTION

public static final java.lang.String MERGE_TYPE_INTERSECTION

Not Implemented in CS Java Connector v3.0.

Specifies the merge option as intersection. Specifies that the result set (columns and rows of data returned from a search) will contain the requested property descriptions from the intersection of two or more object stores being queried.

See Also:
Constant Field Values
Method Detail

executeXML

public java.lang.String executeXML(java.lang.String searchRequestXML)
Executes a Property Based Search and Content Based Retrieval and then returns the matching results as a String formatted according to the Microsoft ADO XML schema.

The parameter you pass to the method is an XML representation of a Structured Query Language (SQL) SELECT statement, as shown below:

 <request>
   <objectstores>
       <objectstore id="pin2ms^Pinta"/>
   </objectstores>
   <querystatement>SELECT idmId, idmDocOnlineLimit,
      idmDocType, idmDocOwner, idmDateAdded, idmDocProtected
      FROM Document WHERE idmVerFileName like 'w%'
      CONTAINS 'central processing unit' inorder '0'
      INFOLDER '988143960'
      ORDER BY idmId
   </querystatement>
   <options maxrecords="100" />
 </request>

Parameters:
searchRequestXML - An XML String representation of an SQL Select statement. For supported SQL grammar, supported XML schema, and examples, see the "Searching" section in CS Java Toolkit Developer's Guide.

Returns:
A String containing an XML representation of the ADO result set.

getClassDescriptions

public ClassDescriptions getClassDescriptions(ObjectStores objectStores,
                                              java.lang.String mergeOption)

Not Implemented in CS Java Connector v3.0.

Returns a ClassDescriptions collection of all classes from a specified set of object stores.

To retrieve class descriptions for a specific object type or for a limited set of object types, use one of the other forms of this method as a more efficient retrieval mechanism.

The returned class descriptions may be different than the class descriptions returned by other methods, even for the same classes. This is because the classes returned from a search may be a combination of classes retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of classes is derived. A setting of MERGE_TYPE_UNION retrieves all specified classes even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those classes that occur on all object stores in the search.

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of classes, an intersection (MERGE_TYPE_INTERSECTION) of classes, or the classes for a single object store (MERGE_TYPE_NONE).

Returns:
A ClassDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getClassDescriptions

public ClassDescriptions getClassDescriptions(ObjectStores objectStores,
                                              java.lang.String mergeOption,
                                              int[] objectTypes)

Not Implemented in CS Java Connector v3.0.

Returns a ClassDescriptions collection from a specified set of object stores. This method returns class descriptions for the classes associated with the requested object types, plus the subclasses of those classes.

Use this method for efficient retrieval of class descriptions for a specific BaseObject object or limited set of BaseObject objects. Specify the object types using constants that are defined in the BaseObject interface. If the input array contains multiple object types, this method returns a single collection containing class descriptions for all of the input object types.

The returned class descriptions may be different than the class descriptions returned by other methods, even for the same classes. This is because the classes returned from a search may be a combination of classes retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of classes is derived. A setting of MERGE_TYPE_UNION retrieves all specified classes even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those classes that occur on all object stores in the search.

The following code fragment illustrates how to create an array for retrieving the classes of a Document object type.

int[] objectTypes = new int[] {BaseObject.TYPE_DOCUMENT};

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of classes, an intersection (MERGE_TYPE_INTERSECTION) of classes, or the classes for a single object store (MERGE_TYPE_NONE).

objectTypes - An int array of BaseObject objects. This method returns classes associated with the requested object types, plus the subclasses of those classes. If null or an empty array, this method returns all ClassDescription objects for the specified object stores.

Returns:
A ClassDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getPropertyDescriptions

public SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores,
                                                          java.lang.String mergeOption,
                                                          int[] objectTypes)

Not Implemented in CS Java Connector v3.0.

Returns a SearchPropertyDescriptions collection from a specified set of object stores. The elements of the returned collection represent property descriptions that belong to the specified object types. Specify the object types in the objectTypes parameter using constants defined in the BaseObject interface. If the input array contains multiple object types, this method returns a single collection containing property descriptions for all of the input object types.

The returned property descriptions may be different than the property descriptions returned by other methods, even for the same properties. This is because the properties returned from a search may be a combination of properties retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of properties is derived. Setting this parameter to MERGE_TYPE_NONE specifies that no merging of the data is performed. A setting of MERGE_TYPE_UNION retrieves all specified properties even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those properties that occur on all object stores in the search.

The objectTypes parameter is a integer array whose elements represent the object types whose property descriptions you want to retrieve. To retrieve properties of all object types from all of the input object stores, specify null or pass in an empty array for this parameter. However, retrieving all those properties is a slow process and consumes significant memory. It is always better to limit the scope of a search by specifying only those object types for which you need properties.

The following code fragment illustrates how to create an array for retrieving properties of a Document object type.

 int[] objectTypes = new int[] {BaseObject.TYPE_DOCUMENT};

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of properties, an intersection (MERGE_TYPE_INTERSECTION) of properties, or the properties for a single object store (MERGE_TYPE_NONE).

objectTypes - An int array of BaseObject objects. This method returns properties associated with the requested object types. If null or an empty array, this method returns all PropertyDescription objects for the specified object stores.

Returns:
A SearchPropertyDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getPropertyDescriptions

public SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores,
                                                          java.lang.String mergeOption,
                                                          SearchClassInfo[] classInfo)

Not Implemented in CS Java Connector v3.0.

Returns a SearchPropertyDescriptions collection from a specified set of object stores. The elements of the returned collection represent property descriptions for the classes specified in the classInfo parameter. This parameter is an array of SearchClassInfo elements. Each element of the array specifies the symbolic name of a class and an IncludeSubclasses flag. The flag setting controls whether or not this method returns the properties of the subclasses of the specified class. If the array contains more than one element, the properties are returned in a single SearchPropertyDescriptions collection. The following code fragment illustrates how to create a classInfo array for retrieving properties of StoredSearch and PublishTemplate classes but not their subclasses.
SearchClassInfo[] classInfo = new SearchClassInfo[] {new
 SearchClassInfo("StoredSearch", false),
 SearchClassInfo("PublishTemplate", false)};

The returned property descriptions may be different than the property descriptions returned by other methods, even for the same properties. This is because the properties returned from a search may be a combination of properties retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of properties is derived. Setting this parameter to MERGE_TYPE_NONE specifies that no merging of the data is performed. A setting of MERGE_TYPE_UNION retrieves all specified properties even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those properties that occur on all object stores in the search.

The classInfo parameter is a SearchClassInfo array whose elements represent the classes whose property descriptions you want to retrieve. To retrieve properties of all classes from all of the input object stores, specify null or pass in an empty array for this parameter. However, retrieving all those properties is a slow process and consumes significant memory. It is always better to limit the scope of a search by specifying only those classes for which you need properties.

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of properties, an intersection (MERGE_TYPE_INTERSECTION) of properties, or the properties for a single object store (MERGE_TYPE_NONE).

classInfo - A SearchClassInfo array whose elements represent the classes whose property descriptions you want to retrieve. If null or an empty array, this method returns all PropertyDescription objects for the specified object stores.

Returns:
A SearchPropertyDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getPropertyDescriptions

public SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores,
                                                          java.lang.String mergeOption,
                                                          SearchPropInfo[] propInfo)

Not Implemented in CS Java Connector v3.0.

Returns a SearchPropertyDescriptions collection from a specified set of object stores. The elements of the returned collection represent property descriptions for the classes and properties specified in the propInfo parameter. This parameter is an array of SearchPropInfo elements. Each element of the array specifies the symbolic names of a class and a property. Note, however, that either or both can be specified as an empty string. (See the SearchPropInfo class for more information.)

The returned property descriptions may be different than the property descriptions returned by other methods, even for the same properties. This is because the properties returned from a search may be a combination of properties retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of properties is derived. Setting this parameter to MERGE_TYPE_NONE specifies that no merging of the data is performed. A setting of MERGE_TYPE_UNION retrieves all specified properties even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those properties that occur on all object stores in the search.

The propInfo parameter is a SearchPropInfo array whose elements represent the properties whose property descriptions you want to retrieve. To retrieve all properties from all the input object stores, specify null or pass in an empty array for this parameter. However, retrieving all properties from all of the specified object stores is a slow process and consumes significant memory. It is always better to limit the scope of a search by specifying only those properties you need.

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of properties, an intersection (MERGE_TYPE_INTERSECTION) of properties, or the properties for a single object store (MERGE_TYPE_NONE).

propInfo - A SearchPropInfo array whose elements represent the properties whose property descriptions you want to retrieve. If null or an empty array, this method returns all PropertyDescription objects for the specified object stores. (If you pass in a null, you must first explicitly cast it to a SearchPropInfo[] to avoid a compilation error.)

Returns:
A SearchPropertyDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getPropertyDescriptions

public SearchPropertyDescriptions getPropertyDescriptions(ObjectStores objectStores,
                                                          java.lang.String mergeOption,
                                                          int objectType,
                                                          SearchClassInfo[] classInfo)

Not Implemented in CS Java Connector v3.0.

Returns a SearchPropertyDescriptions collection from a specified set of object stores. The elements of the returned collection represent property descriptions that belong to the specified object type and the classes specified in the classInfo parameter. This parameter also controls whether or not this method returns the properties of the subclasses of the specified class. If the array contains more than one element, the properties are returned in a single SearchPropertyDescriptions collection.

The returned property descriptions may be different than the property descriptions returned by other methods, even for the same properties. This is because the properties returned from a search may be a combination of properties retrieved from multiple object stores.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of properties is derived. Setting this parameter to MERGE_TYPE_NONE specifies that no merging of the data is performed. A setting of MERGE_TYPE_UNION retrieves all specified properties even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those properties that occur on all object stores in the search.

Specify the object type whose properties are to be retrieved in the objectType parameter using constants defined in the BaseObject interface. Currently, only the following object types are supported: BaseObject.TYPE_DOCUMENT, BaseObject.TYPE_FOLDER, and BaseObject.TYPE_CUSTOMOBJECT.

The classInfo parameter is an array of SearchClassInfo elements. Each element of the array specifies the symbolic name of the class whose properties you want to retrieve and an IncludeSubclasses flag. To retrieve all properties of a specified object type, pass null or an empty array in this parameter. If this array is not null or not empty, the properties that belong to all specified classes are retrieved and combined (that is, duplicates are eliminated). The setting of the IncludeSubclasses flag determines whether or not to include subclasses of the specified classes. Setting the flag to false retrieves properties for only the class; setting the flag to true retrieves properties for the class plus properties for the subclasses of the class. The following code fragment illustrates how to create an array for retrieving properties of the StoredSearch and PublishTemplate classes but not their subclasses.

SearchClassInfo[] classInfo = new SearchClassInfo[] {new
 SearchClassInfo("StoredSearch", false),
 SearchClassInfo("PublishTemplate", false)};
If multiple classes have the same inherited properties, this method returns only one copy of the properties.

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one ObjectStore object, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of properties, an intersection (MERGE_TYPE_INTERSECTION) of properties, or the properties for a single object store (MERGE_TYPE_NONE).

objectType - An integer specifying the object type whose properties are to be retrieved. Currently limited to CustomObject, Document, and Folder objects, which you can specify as constants that are defined in the BaseObject interface.

classInfo - A SearchClassInfo array whose elements represent the classes whose property descriptions you want to retrieve. If null or an empty array, returns all PropertyDescription objects for the specified object type.

Returns:
A SearchPropertyDescriptions collection.

See Also:
MERGE_TYPE_NONE, MERGE_TYPE_UNION, MERGE_TYPE_INTERSECTION

getChoiceLists

public ChoiceLists getChoiceLists(ObjectStores objectStores,
                                  java.lang.String mergeOption,
                                  SearchPropInfo[] propInfo)

Not Implemented in CS Java Connector v3.0.

Returns a ChoiceLists collection from a specified set of object stores. The elements of the returned collection represent ChoiceList objects for the classes and properties specified in the propInfo parameter. This parameter is an array of SearchPropInfo elements. Each element of the array specifies the symbolic names of a class and a property. Note, however, that either or both can be specified as empty strings. (See the SearchPropInfo class for more information.)

A ChoiceList object contains Choice objects, each of which represents a possible value for a settable property.

The choice lists returned by this method may be different than the choice lists returned by other methods, even for the same properties. This is because the properties returned from a search may be a combination of properties retrieved from multiple object stores. Note that a ChoiceLists object returned from a search across multiple object stores returns ChoiceList objects from all of the object stores as one combined, non-hierarchical list.

The objectStores parameter specifies the object stores to search and must contain at least one ObjectStore object.

The mergeOption setting determines how the combination of properties is derived. Setting this parameter to MERGE_TYPE_NONE specifies that no merging of the data is performed, and is invalid when the ObjectStores collection contains more than one object store. Setting this parameter to MERGE_TYPE_UNION retrieves all specified properties even if they don't exist on all object stores in the search. A setting of MERGE_TYPE_INTERSECTION retrieves only those specified properties that occur on all object stores in the search.

Parameters:
objectStores - An ObjectStores collection containing at least one ObjectStore object. If the collection contains only one object store, the mergeOption setting is treated as MERGE_TYPE_NONE.

mergeOption - A String specifying that the result set will be a union (MERGE_TYPE_UNION) of properties, an intersection (MERGE_TYPE_INTERSECTION) of properties, or the properties for a single object store (MERGE_TYPE_NONE).

propInfo - A SearchPropInfo array. A ChoiceList object is returned for each class and property in the array for which the property has an associated choice list. If null or an empty array, this method returns all choice lists for the specified object stores.

Returns:
A ChoiceLists collection.

See Also:
ChoiceList, Choice

singleObjectTypeExecuteXML

public java.lang.String singleObjectTypeExecuteXML(java.lang.String searchRequestXML,
                                                   int objectType)

Not Implemented in CS Java Connector v3.0.

Executes a search on a single object type and returns a collection of BaseObject objects meeting the search criteria.

Parameters to this method are a search request and an object type. The searchRequestXML parameter is an XML representation of a search request including criteria such as object store IDs, a Structured Query Language (SQL) SELECT statement, and other search options (such as the maximum number of records to return). With one exception, this method does not support table joins when performing the search. The exception is that an inner join is allowed between the document and contentsearch tables for a content-based search. If the SELECT statement contains an illegal join (multi-table join or self-join), the returned result is undefined.

You can also perform a content-based search on a document using Verity Query Language (VQL) in the SELECT statement. For more information about usage and syntax, refer to your VQL documentation. For more information about content-based searches, refer to Content-Based Retrieval in the Content Services online help.

The objectType parameter specifies the object type to be searched for. Currently, this method supports only Document, Folder, and CustomObject objects. Note that the specified object type must match the object type specified in the searchRequestXML parameter; otherwise the returned result is undefined.

Parameters:
searchRequestXML - An XML String representation of a search request. For documentation that describes the XML schema used to generate the string, refer to Schemas in the FileNet P8 Developer's Roadmap.

objectType - A flag to indicate the object type to search for. Valid object types are Document, Folder, and CustomObject. Use constants provided in the BaseObject interface to specify the object type. This value must match the object type specified in the query statement; otherwise the return result is undefined. For example, if the query string specifies a Document object in the SELECT statement, specify BaseObject.TYPE_DOCUMENT for this parameter.

Returns:
A collection of BaseObject objects.
See Also:
executeXML, singleObjectTypeExecuteXML

singleObjectTypeExecute

public BaseObjects singleObjectTypeExecute(java.lang.String searchRequestXML,
                                           int objectType)

Not Implemented in CS Java Connector v3.0.

Executes a search on a single object type and returns a collection of BaseObject objects meeting the search criteria.

Parameters to this method are a search request and an object type. The searchRequestXML parameter is an XML representation of a search request including criteria such as object store IDs, a Structured Query Language (SQL) SELECT statement, and other search options (such as the maximum number of records to return). With one exception, this method does not support table joins when performing the search. The exception is that an inner join is allowed between the document and contentsearch tables for a content-based search. If the SELECT statement contains an illegal join (multi-table join or self-join), the returned result is undefined.

You can also perform a content-based search on a document using Verity Query Language (VQL) in the SELECT statement. For more information about usage and syntax, refer to your VQL documentation. For more information about content-based searches, refer to Content-Based Retrieval in the Content Services online help.

The objectType parameter specifies the object type to be searched for. Currently, this method supports only Document, Folder, and CustomObject objects. Note that the specified object type must match the object type specified in the searchRequestXML parameter; otherwise the returned result is undefined.

Parameters:
searchRequestXML - An XML String representation of a search request. For documentation that describes the XML schema used to generate the string, refer to Schemas in the FileNet P8 Developer's Roadmap.

objectType - A flag to indicate the object type to search for. Valid object types are Document, Folder, and CustomObject. Use constants provided in the BaseObject interface to specify the object type. This value must match the object type specified in the query statement; otherwise the return result is undefined. For example, if the query string specifies a Document object in the SELECT statement, specify BaseObject.TYPE_DOCUMENT for this parameter.

Returns:
A collection of BaseObject objects.
See Also:
executeXML, singleObjectTypeExecuteXML

FileNet Content Services
Java Connector v3.0