Search in sources :

Example 1 with ShareRequestCriteria

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;
}
Also used : ShareRequestCriteria(de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria) TaskCriteria(de.symeda.sormas.api.task.TaskCriteria)

Example 2 with ShareRequestCriteria

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);
}
Also used : SormasToSormasShareRequestIndexDto(de.symeda.sormas.api.sormastosormas.sharerequest.SormasToSormasShareRequestIndexDto) SortProperty(de.symeda.sormas.api.utils.SortProperty) ShareRequestCriteria(de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria)

Aggregations

ShareRequestCriteria (de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria)2 SormasToSormasShareRequestIndexDto (de.symeda.sormas.api.sormastosormas.sharerequest.SormasToSormasShareRequestIndexDto)1 TaskCriteria (de.symeda.sormas.api.task.TaskCriteria)1 SortProperty (de.symeda.sormas.api.utils.SortProperty)1