CentraSite 10.7 | CentraSite Developer's Guide | Web Service Interfaces | Approval Service | Scrolling Through the List of Returned Approval Requests
 
Scrolling Through the List of Returned Approval Requests
The getPendingApprovals, getApprovalRequests, and getApprovalHistory operations each return an array of approval requests (that is, their result set) in an ApprovalRequestList message. In certain cases, the result set can be quite large (for example, if you were to retrieve the entire Approval History log). Instead of receiving the entire result set in a single message, you can use the scroll parameter to retrieve the results in blocks of a specified size (for example, 15 entries at a time). For example, you might use this feature to display when an approval requests a page at a time in your client application.
To receive a specified block of results, set the following elements in the scroll parameter when you invoke the getPendingApprovals, getApprovalRequests, and getApprovalHistory operation.
In this element...
Specify...
start
The first element in the block that you want to retrieve (where 1 represents the first element in the entire set of results).
number
The total number of elements that you want to retrieve in that block (that is, the size of the block).
For example, let's say you are using the getApprovalHistory operation, and you want to retrieve the contents of the log 20 entries at a time. To do this you would:
Invoke...
Set...
Set...
scroll.start = 1
scroll.number = 20
scroll.start = 21
scroll.number = 20
scroll.start = 41
scroll.number = 20
You would continue until you reach the end of the result set.
To determine that you have reached the end of the result set, you can check the value in the count parameter in the ApprovalRequestList. This parameter reports the total number of entries in the entire result set.
Note:
If the last block in the set contains fewer entries than what you specify in scroll.number, the operation returns the remaining entries in that last block. If the element that you specify in scroll.start does not exist in the result set, the operation returns an empty list.