use of edu.stanford.bmir.protege.web.shared.collection.GetCollectionItemsResult in project webprotege by protegeproject.
the class GetCollectionItemsActionHandler method execute.
@Nonnull
@Override
public GetCollectionItemsResult execute(@Nonnull GetCollectionItemsAction action, @Nonnull ExecutionContext executionContext) {
PageRequest pageRequest = action.getPageRequest();
List<CollectionItem> elementIdList = repository.list(action.getCollectionId(), pageRequest.getSkip(), pageRequest.getPageSize());
long totalItemsCount = repository.count(action.getCollectionId());
int pageCount = (int) (totalItemsCount / pageRequest.getPageSize()) + 1;
return new GetCollectionItemsResult(new Page<>(pageRequest.getPageNumber(), pageCount, elementIdList, elementIdList.size()), pageRequest);
}
Aggregations