public interface RMPagedSearch
RMPagedSearch
class to perform ad hoc searches that fulfill specific one-time
requirements to retrieve information from an object store.
You can use the methods defined for this class to search for record categories, record folders, records, and physical record markers. These methods return paged results.
To execute a single object type search and return paged results, perform the following steps:
RMPagedSearch
object by calling the getRMPagedSearch
method
on the RMObjectStore
object that represents the object store to be searched.singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method to execute the search and return the paged result.nextPageXML()
method or the previousPageXML()
method to
page through the result. Call the hasNextPage()
method to see if you have reached the end of the result set
or the hasPreviousPage()
method to see if you have reached the beginning of the result set.The following code sample illustrates using the RMPagedSearch
class:
RMPagedSearch pagedSearch = objStore.getRMPagedSearch();
String stmt = "Select d.DocumentTitle, d.ClassDescription from Document d Where d.Creator='jdoe'";
String asNonPropSQLstmt = null;
String asContentSearchWhereClause = "(contains(content, '(testCBR)'))";
String asOperator = "AND";
int pageSize = 50; // set to return 50 documents each page call.
boolean filterByParent=false;
pagedSearch.singleObjectTypeExecute(stmt,asNonPropSQLstmt, asContentSearchWhereClause, asOperator, BaseObject.TYPE_DOCUMENT, pageSize, filterByParent);
while (pagedSearch.hasNextPage())
{
String objectsetXML = pagedSearch.nextPageXML();
system.out.println(objectsetXML);
}
RMPagedSearch pagedSearch = objStore.getRMPagedSearch();
String stmt = "Select d.DocumentTitle, d.ClassDescription from Document d Where d.Creator='jdoe' order by d.DocumentTitle";
String asNonPropSQLstmt = null;
String asContentSearchWhereClause = "(contains(content, '(testCBR)'))";
String asOperator = "AND";
int pageSize = 50; // set to return 50 documents each page call.
boolean filterByParent=false;
pagedSearch.singleObjectTypeExecute(stmt,asNonPropSQLstmt, asContentSearchWhereClause, asOperator, BaseObject.TYPE_DOCUMENT, pageSize, filterByParent);
while (pagedSearch.hasNextPage())
{
Object[] rowset = pagedSearch.nextPage();
if (rowset == null || rowset.size() == 0)
{
// The end of paging. No more search results.
break;
}
else
{
//Process rowset ...
}
}
Modifier and Type | Method and Description |
---|---|
java.lang.String |
executeXML(java.lang.String asSearchRequestXML,
java.lang.String asContentSearchRequestXML,
java.lang.String asOperator)
Searches across one or more object stores by property values, by content, or both,
and returns an XML
String that contains a representation of the Record Manager objects
meeting the search criteria. |
boolean |
hasNextPage()
Checks if the current page is the last page of the search results returned by the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method. |
boolean |
hasPreviousPage()
Checks if the current page is the first page of the search results returned by the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method. |
java.lang.Object[] |
nextPage()
Returns an array containing each repository row in the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method and repositions the iterator to the next page. |
java.lang.String |
nextPageXML()
Returns a
String containing the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method and repositions the iterator to the next page. |
java.lang.Object[] |
previousPage()
Returns an array containing each repository row in the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method and repositions the iterator to the previous page. |
java.lang.String |
previousPageXML()
Returns a
String containing the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean) method and repositions the iterator to the previous page. |
void |
singleObjectTypeExecute(java.lang.String asSearchSQLstmt,
java.lang.String asNonPropSQLstmt,
java.lang.String asContentSearchWhereClause,
java.lang.String asOperator,
int aiObjectType,
int pageSize,
boolean filterByParent)
Searches for objects of a specified type by property values and returns paged results.
|
void singleObjectTypeExecute(java.lang.String asSearchSQLstmt, java.lang.String asNonPropSQLstmt, java.lang.String asContentSearchWhereClause, java.lang.String asOperator, int aiObjectType, int pageSize, boolean filterByParent)
The singleObjectTypeExecute()
method supports two P8 object types: BaseObject.TYPE_DOCUMENT and
BaseObject.TYPE_FOLDER. Currently, this method does not support content-based retrieval on Document type.
With one exception, this method does not support table joins when performing the search.
If the SELECT
statement contains an illegal join such as a multi-table join or a self-join,
the returned result is undefined.
When you call this method, you must pass in an SQL statement
that contains the ClassDescription
property in its select list. For example, you might define the select
list as follows:
Select d.DocumentTitle, d.DateCreated, d.ClassDescription From Document d
The singleObjectTypeExecute()
method returns a rowset of the search results. To get paged results,
call the nextPageXML()
or the previousPageXML()
method.
asSearchSQLstmt
- A String
defining the criteria for searching metadata in a FPOS using an SQL
statement.asNonPropSQLstmt
- A String
defining the non property SQL statement like specifying the file plan
or class, this is only needed when parameter asOperator is "OR". In "AND" conditions, set this value to null.asContentSearchWhereClause
- A String
that defines the WHERE clause for a content-based search
in the ROS. For a metadata search, this parameter needs to be null.asOperator
- A String
logic operator specifying either the moOR_OPERATOR or moAND_OPERATOR
operator, to indicate the merge option for the metadata or content search on the FPOS and the content search on the ROS.aiObjectType
- An int
value identifying the type of object to be searched.
The object type must be either BaseObject.TYPE_DOCUMENT or BaseObject.TYPE_FOLDER.pageSize
- A positive int
value identifying the page size of the returned pages.filterByParent
- A boolean
value specifying if the query contains the "filter by parent" clause and
should only be used in the asSearchSQLstmt parameter. True indicates that the query contains the clause.java.lang.String nextPageXML()
String
containing the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method and repositions the iterator to the next page.
Call the hasNextPage()
method to determine if there is a next page in the result set.
String
containing the current page of the result set in XML format. The XML format is based on
the Search XML Schema that is provided by the Content Engine Java API.java.lang.String previousPageXML()
String
containing the current page of the search results that were obtained by a call to the
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method and repositions the iterator to the previous page.
Call the hasPreviousPage()
method to determine if there is a previous page in the result set.
String
containing the current page of the result set in XML format. The XML format is based on
the Search XML Schema that is provided by the Content Engine Java API.java.lang.Object[] nextPage()
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method and repositions the iterator to the next page.
Call the hasNextPage()
method to determine if there is a next page in the result set.
Object
array containing the repository rows in the current page of the search results.java.lang.Object[] previousPage()
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method and repositions the iterator to the previous page.
Call the hasPreviousPage()
method to determine if there is a previous page in the result set.
Object
array containing the repository rows in the current page of the search results.boolean hasNextPage()
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method.boolean
value of false
if the iterator is on the last page of the result set;
otherwise, returns true
.boolean hasPreviousPage()
singleObjectTypeExecute(String, String, String, String, int, int, boolean)
method.boolean
value of false
if the iterator is on the first page of the result set;
otherwise, returns true
.java.lang.String executeXML(java.lang.String asSearchRequestXML, java.lang.String asContentSearchRequestXML, java.lang.String asOperator)
String
that contains a representation of the Record Manager objects
meeting the search criteria.
The asSearchRequestXML
and asContentSearchWhereClause
parameters
define the search criteria and scope as follows:
asSearchRequestXML | asContentSearchRequestXML | Searches |
---|---|---|
Contains a WHERE clause | null or empty | The metadata in a File Plan Object Store (FPOS). |
Contains a WHERE clause | Contains a WHERE clause. | The content in a Records Object Store (ROS). |
Contains object ID and aggregation properties | Contains a WHERE clause | The metadata in an FPOS and the content in an ROS. |
The method merges the results obtained from the FPOS
and ROS based on the values provided in the asOperator
parameter. You must specify this parameter if this method is to
return both metadata and content.
asSearchRequestXML
- A String
in XML format. If the method is to search the
metadata in the FPOS, this String
defines the search criteria. If the method is
to search the content only, this String
contains the ID and aggregation properties
that identify the objects to be searched. This parameter cannot be null
.asContentSearchRequestXML
- A String
in XML format that defines the
WHERE clause for searching content in a ROS. Set this parameter to null
if the method is to search only the metadata.asOperator
- A String
specifying either the moOR_OPERATOR or moAND_OPERATOR
operator to indicate the merge option for the metadata or content search on the FPOS and
the content search on the ROS.String
in XML format that contains a representation of the
objects that meet the search criteria. This String
is in XML format based
on the Search XML Schema provided by the Microsoft ADO RecordSet
object.© Copyright IBM Corp. 2003, 2013. All Rights Reserved.