use of org.alfresco.repo.security.authority.AuthorityInfo in project alfresco-remote-api by Alfresco.
the class GroupsFilter method getGroups.
public CollectionWithPagingInfo<Group> getGroups(final Parameters parameters) {
Paging paging = parameters.getPaging();
// Retrieve sort column. This is limited for now to sort column due to
// v0 api implementation. Should be improved in the future.
Pair<String, Boolean> sortProp = getGroupsSortProp(parameters);
// Parse where clause properties.
GroupsFilter groupsFilters = getGroupsFilterFromQueryParameters(parameters.getQuery());
final AuthorityType authorityType = AuthorityType.GROUP;
final Set<String> rootAuthorities = getAllRootAuthorities(authorityType);
PagingResults<AuthorityInfo> pagingResult;
try {
pagingResult = getAuthoritiesInfo(authorityType, groupsFilters, rootAuthorities, sortProp, paging);
} catch (UnknownAuthorityException e) {
// Non-existent zone
pagingResult = new EmptyPagingResults<>();
}
List<Group> groups = createGroupsResponse(pagingResult.getPage(), parameters.getInclude(), rootAuthorities);
int totalItems = pagingResult.getTotalResultCount().getFirst();
return CollectionWithPagingInfo.asPaged(paging, groups, pagingResult.hasMoreItems(), totalItems);
}
Aggregations