Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IDocumentManager.QueryDocuments Method (IProject, IDocumentFilter)

Queries for documents contained in the specified project, and returns an array of IDocuments that satisfies the query filter.

IDocument[] QueryDocuments(
   IProject project,
   IDocumentFilter documentFilter
);

Parameters

project
The query will be restricted to documents contained in the given project. Cannot be null.
documentFilter
An IDocumentFilter instance specifying which query to perform, the desired sort order of the query result, and the maximum number of results to return. Cannot be null.

Return Value

An array of IDocuments satisfying the filter, in the specified project.

Remarks

The following sample code demonstrates how to query a project for documents checked out by the current user.
//Create the new query filter
IDocumentFilter filter = documentManager.CreateDocumentFilter();
//Set it to only search for checked-out documents
filter.FilterType = DocumentFilterTypes.CheckedOutByCurrentUser;
//Set to order by size, then last modified date
DocumentQueryOrder sizeOrder = new DocumentQueryOrder(DocumentAttributes.NumBytes, true);
DocumentQueryOrder lastModifiedOrder = new DocumentQueryOrder(DocumentAttributes.LastModified, true);
DocumentQueryOrder[] orders = new DocumentQueryOrder[]}sizeOrder, lastModifiedOrder};
filter.QueryOrders = orders;
//Perform query
IDocument[] foundDocuments = documentManager.QueryDocuments(project, filter);

Exceptions

Exception TypeCondition
CollaborationException The method call resulted in an error.
SoapException There is a communication problem during the execution of the remote method call.
InvalidOperationException The project has not yet been stored or has already been removed.

See Also

IDocumentManager Interface | Plumtree.Remote.PRC.Collaboration.Document Namespace | IDocumentManager.QueryDocuments Overload List