Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Grouper client: getting total result count when performing paginated query

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Grouper client: getting total result count when performing paginated query


Chronological Thread 
  • From: Geert van der Ploeg <>
  • To:
  • Subject: [grouper-users] Grouper client: getting total result count when performing paginated query
  • Date: Thu, 17 Oct 2013 11:55:49 +0200

Hi all,

I'm trying to use Grouper client to get a list of groups, but I want the results paginated.
So I include a WsQueryFilter to contain a pageSize and pageNumber.
This indeed returns a paged 'slice' of the results.

But how can I figure out the total result count of the request (if it weren't paginated)?
Only then I could render a message like "Displaying results 11-20 of 87" and decide whether to hide/show 'next page' links etc, in my user interface.

Code I use right now:
~~~
    WsQueryFilter filter = new WsQueryFilter();
    filter.setPageSize("10");
    filter.setPageNumber("1");
    filter.setQueryFilterType("FIND_BY_GROUP_NAME_APPROXIMATE");
    filter.setGroupName("%");
    String personId = "urn:collab:person:example.com:admin";
    WsFindGroupsResults results = new GcFindGroups()
            .assignQueryFilter(filter)
            .assignIncludeGroupDetail(false)
            .assignActAsSubject(new WsSubjectLookup(personId, null, null))
            .execute();

~~~
Running the same query but without filter would probably return the whole set. But that would defeat the purpose of the pagination (not having to query a huge list of groups).

Thanks for any hints.

Kind regards,
Geert



Archive powered by MHonArc 2.6.16.

Top of Page