Provides paging functionality for sets of independent objects and repository rows.

Sets of independent objects and repository rows are divided into pages; each page is a number of collection elements (objects or rows) that represent a subset of the collection elements. You can enumerate a page at a time instead of one object or row at a time. As an example, if a page is defined as 10 elements, and the collection has a total of 22 elements, the first paging operation returns a page containing 10 elements, the second page returns the next 10 elements, and the third page returns the last 2 elements. This page enumeration is especially useful for interactive applications that display a page of information at a time.

Each page enumerator is initially positioned before the first page of the set. The first call to the NextPage method moves the enumerator to the first page. The second call to NextPage moves the enumerator to the second page, and so on. The NextPage method returns True until the end of the set is NextPagereached. When the enumerator reaches the end of the set, it is positioned after the last page and NextPage returns False.

The GetCurrentPage and GetElementCount methods throw an exception if the enumerator is positioned before the first page or after the last page, or between pages after a Reset(mark) operation. For proper positioning, you must call NextPage on a new enumerator and after a Reset operation. You may call the GetPageMark method at any time. Of these methods, only NextPage moves the position of the enumerator.

The returned value of GetElementCount is always equal to GetCurrentPage().Length. Use GetElementCount to avoid copying the potentially large internal array just to get its length.

You can also get the current page continuation state (that is, the page on which the enumerator will continue with the next call) and reset the enumerator back to a previous page of results. The saved position of the enumerator is called a "page mark". The GetPageMark method retrieves the current mark, and the Reset(mark) method resets the state of the enumerator to a previously saved mark. The Reset method positions the enumerator before the marked page; the NextPage method must be called to position the enumerator to the marked page. It is also possible to mark and reset to the position before the first page and the position after the last page.

The Reset method (with no parameters) positions the enumerator before the first page of the collection. This is essentially the same as getting a new enumerator from the collection. You must then call the NextPage method to position the enumerator to the first page.

The GetPageSize and SetPageSize methods allow you to query and adjust the internal paging size of the enumerator. The new size takes effect on the next fetch from the server. This is typically on the next call to NextPage. The actual size of each returned page may be smaller (including zero) or larger than the requested page size.

The first page of a set may be pre-fetched from the server and cached in the client. All enumerators of a set with a pre-fetched first page may return the same first page. All enumerators fetch subsequent pages, if any, directly from the server.


Namespace: FileNet.Api.Collection
Assembly: FileNet.Api (in filenet.api.dll)

Syntax

Visual Basic (Declaration)
Public Interface IPageEnumerator
C#
public interface IPageEnumerator
C++
interface class IPageEnumerator
J#
public interface IPageEnumerator
JScript
public interface IPageEnumerator

See Also