Interface IPagingCookie
- All Known Subinterfaces:
IDirPagingCookie
public interface IPagingCookie
Base interface for a paging cookie that maintains the paging state
of a session's view of a list. The paging cookie should at least
maintain the start index and the paging size of the list, and whether
the list can page forward or back. Other data and functionality is optional.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
getEnd()
The index of the last item in the current page.getOrder()
The order by which the list is sorted: #ASCENDING or #DESCENDING.boolean
Returns true if the list is ordered ascending (a-z or 1-10).int
The total number of pages in the list.int
The index of the current page.int
The maximum number of items in the current page.Query which produced the list or null.The resource providing the list.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.User for whom the list was populated or null.getView()
The name of the view used to identify the paging cookie (ie 'children' or 'containers').boolean
hasNext()
True if the list can page forward.boolean
True if the list can page back.void
Pages the cookie backward.void
Pages the cookie forward.void
release()
Clears the state of this in preperation for re-use or disposal.void
setEnd
(int end) The index of the last item in the current page.void
The order by which the list is sorted: #ASCENDING or #DESCENDING.void
setPageIndex
(int pageIndex) The index of the current page.void
setPageSize
(int pageSize) The maximum number of items in the current page.void
setQueryString
(String query) Query which produced the list or null.void
setResourceID
(IURI targetID) The resource providing the list.void
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.void
setTotal
(int total) The total number of items in the list.void
User for whom the list was populated or null.void
The name of the view used to identify the paging cookie (ie 'children' or 'containers').
-
Field Details
-
ASCENDING
- See Also:
-
DESCENDING
- See Also:
-
ACTION_NEXT
static final int ACTION_NEXTmove the cookie forward- See Also:
-
ACTION_PREVIOUS
static final int ACTION_PREVIOUSmove the cookie backward- See Also:
-
ACTION_REFRESH
static final int ACTION_REFRESHrepeat the same search- See Also:
-
-
Method Details
-
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.
-
setTotal
void setTotal(int total) The total number of items in the list. Returns zero (0) if the total is unavailable.- Parameters:
total
- 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
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').
-
getOrder
String getOrder()The order by which the list is sorted: #ASCENDING or #DESCENDING. Ascending order is a-z or 1-10; descending order is z-a or 10-1. Returns null if the order is unavailable.- Returns:
- The order by which the list is sorted: #ASCENDING or #DESCENDING.
-
setOrder
The order by which the list is sorted: #ASCENDING or #DESCENDING. Ascending order is a-z or 1-10; descending order is z-a or 10-1. Returns null if the order is unavailable.- Parameters:
order
- The order by which the list is sorted: #ASCENDING or #DESCENDING.
-
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).
-
getResourceID
IURI getResourceID()The resource providing the list. Returns null if not applicable.- Returns:
- Id of the resource providing the list or null.
-
setResourceID
The resource providing the list.- Parameters:
targetID
- Id of the resource providing the list or null.
-
getView
String getView()The name of the view used to identify the paging cookie (ie 'children' or 'containers'). Returns null if the cookie has no view.- Returns:
- Name of view or null.
-
setView
The name of the view used to identify the paging cookie (ie 'children' or 'containers').- Parameters:
view
- Name of view or null.
-
getUserID
IThingID getUserID()User for whom the list was populated or null.- Returns:
- User for whom the list was populated or null.
-
setUserID
User for whom the list was populated or null.- Parameters:
userID
- User for whom the list was populated or null.
-
getQueryString
String getQueryString()Query which produced the list or null.- Returns:
- Query which produced the list or null.
-
setQueryString
Query which produced the list or null.- Parameters:
query
- Query which produced the list or null.
-
pageForward
Pages the cookie forward.- Throws:
PortalException
- if the cookie cannot page forward.
-
pageBackward
Pages the cookie backward.- Throws:
PortalException
- if the cookie cannot page backward.
-
release
void release()Clears the state of this in preperation for re-use or disposal.
-