use of de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria in project SORMAS-Project by hzi-braunschweig.
the class ShareRequestsView method getCriteria.
private ShareRequestCriteria getCriteria() {
ShareRequestCriteria criteria = ViewModelProviders.of(ShareRequestsView.class).get(ShareRequestCriteria.class);
if (!ViewModelProviders.of(TasksView.class).has(TaskCriteria.class)) {
// init default filter
criteria = new ShareRequestCriteria();
criteria.setStatusesExcepted(Arrays.asList(ShareRequestStatus.REJECTED, ShareRequestStatus.REVOKED));
ViewModelProviders.of(ShareRequestsView.class).get(ShareRequestCriteria.class, criteria);
}
return criteria;
}
use of de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria in project SORMAS-Project by hzi-braunschweig.
the class ShareRequestGrid method setLazyDataProvider.
public void setLazyDataProvider() {
DataProvider<SormasToSormasShareRequestIndexDto, ShareRequestCriteria> dataProvider = DataProvider.fromFilteringCallbacks(query -> FacadeProvider.getSormasToSormasShareRequestFacade().getIndexList(query.getFilter().orElse(null), query.getOffset(), query.getLimit(), query.getSortOrders().stream().map(sortOrder -> new SortProperty(sortOrder.getSorted(), sortOrder.getDirection() == SortDirection.ASCENDING)).collect(Collectors.toList())).stream(), query -> (int) FacadeProvider.getSormasToSormasShareRequestFacade().count(query.getFilter().orElse(null)));
setDataProvider(dataProvider);
setSelectionMode(SelectionMode.NONE);
}
Aggregations