com.webmethods.sc.directory
Interface IDirectoryPagingCookie


public interface IDirectoryPagingCookie

Interface that describes directory cookie which is used in the IDirectorySession.searchDirectory(String, int, DirectorySearchQuery, IDirectoryPagingCookie) API to page through search results

Before use this cookie is created by IDirectorySession.createPagingCookie(String) call, after use the cookie must be destroyed by IDirectorySession.destroyPagingCookie(IDirectoryPagingCookie). The minimal setup cookie is required before first use is to set start index IDirectoryPagingCookie.setStart(int) and page size IDirectoryPagingCookie.setPageSize(int). The cookie is then passed to searchDirectory() API. To page through result set use IDirectoryPagingCookie.pageForward() and IDirectoryPagingCookie.pageBackward() methods of the cookie.


Method Summary
 int getEnd()
          The index of the last item in the current page.
 boolean getOrderAtoZ()
          Returns true if the list is ordered ascending (a-z or 1-10).
 int getPageCount()
          The total number of pages in the list.
 int getPageIndex()
          The index of the current page.
 int getPageSize()
          The maximum number of items in the current page.
 String getSort()
          The sort key by which the list is sorted (ex: 'name').
 int getStart()
          The index of the first item in the current page.
 int getTotal()
          The total number of items in the list.
 boolean hasNext()
          True if the list can page forward.
 boolean hasPrevious()
          True if the list can page back.
 void pageBackward()
          Pages the cookie backward.
 void pageForward()
          Pages the cookie forward.
 void setEnd(int end)
          The index of the last item in the current page.
 void setOrderAtoZ(boolean order)
          Sets ascending/descending order
 void setPageIndex(int pageIndex)
          The index of the current page.
 void setPageSize(int pageSize)
          The maximum number of items in the current page.
 void setSort(String sortKey)
          The sort key by which the list is sorted (ex: 'name').
 void setStart(int start)
          The index of the first item in the current page.
 

Method Detail

hasPrevious

boolean hasPrevious()
True if the list can page back.

Returns:
True if the list can page back.

hasNext

boolean hasNext()
True if the list can page forward.

Returns:
True if the list can page forward.

getStart

int getStart()
The index of the first item in the current page. The index of the first item in a list is one (1). Returns zero (0) if the starting index is unavailable.

Returns:
The index of the first item in the current page.

setStart

void setStart(int start)
The index of the first item in the current page. The index of the first item in a list is one (1). Returns zero (0) if the starting index is unavailable.

Parameters:
start - The index of the first item in the current page.

getEnd

int getEnd()
The index of the last item in the current page. The index of the last item in a list of ten (10) is ten (10). Returns zero (0) if the ending index is unavailable.

Returns:
The index of the of the last item in the current page.

setEnd

void setEnd(int end)
The index of the last item in the current page. The index of the last item in a list of ten (10) is ten (10). Returns zero (0) if the ending index is unavailable.

Parameters:
end - The index of the of the last item in the current page.

getTotal

int getTotal()
The total number of items in the list. Returns zero (0) if the total is unavailable.

Returns:
The total number of items in the list.

getPageSize

int getPageSize()
The maximum number of items in the current page. The actual number of items in the current page may be less than this number. Returns zero (0) if the page size is unavailable.

Returns:
The maximum number of items in the current page.

setPageSize

void setPageSize(int pageSize)
The maximum number of items in the current page. The actual number of items in the current page may be less than this number. Returns zero (0) if the page size is unavailable.

Parameters:
pageSize - The maximum number of items in the current page.

getPageIndex

int getPageIndex()
The index of the current page. The index of the first page in a list is one (1). Returns zero (0) if the page index is unavailable.

Returns:
The index of the current page.

setPageIndex

void setPageIndex(int pageIndex)
The index of the current page. The index of the first page in a list is one (1). Returns zero (0) if the page index is unavailable.

Parameters:
pageIndex - The index of the current page.

getPageCount

int getPageCount()
The total number of pages in the list. The page count of a list of zero (0) to (10) items with a page size of ten (10) is one (1). Returns zero (0) if the page count is unavailable.


getSort

String getSort()
The sort key by which the list is sorted (ex: 'name'). Returns null if the sort key is unavailable.

Returns:
The sort key by which the list is sorted (ex: 'name').

setSort

void setSort(String sortKey)
The sort key by which the list is sorted (ex: 'name'). Returns null if the sort key is unavailable.

Parameters:
sortKey - The sort key by which the list is sorted (ex: 'name').

getOrderAtoZ

boolean getOrderAtoZ()
Returns true if the list is ordered ascending (a-z or 1-10). Returns true if the order is unavailable.

Returns:
True if the list is ordered ascending (a-z or 1-10).

setOrderAtoZ

void setOrderAtoZ(boolean order)
Sets ascending/descending order

Parameters:
order -

pageForward

void pageForward()
                 throws DirectoryException
Pages the cookie forward.

Throws:
PortalException - if the cookie cannot page forward.
DirectoryException

pageBackward

void pageBackward()
                  throws DirectoryException
Pages the cookie backward.

Throws:
PortalException - if the cookie cannot page backward.
DirectoryException