Search in sources :

Example 1 with RepositoryEntryRow

use of org.olat.repository.ui.list.RepositoryEntryRow in project OpenOLAT by OpenOLAT.

the class VideoEntryDataSource method getRows.

@Override
public ResultInfos<RepositoryEntryRow> getRows(String query, List<FlexiTableFilter> filters, List<String> condQueries, int firstResult, int maxResults, SortKey... orderBy) {
    if (condQueries != null && condQueries.size() > 0) {
        String filter = condQueries.get(0);
        if (StringHelper.containsNonWhitespace(filter)) {
            searchParams.setFilters(Collections.singletonList(Filter.valueOf(filter)));
        } else {
            searchParams.setFilters(null);
        }
    }
    if (orderBy != null && orderBy.length > 0 && orderBy[0] != null) {
        OrderBy o = OrderBy.valueOf(orderBy[0].getKey());
        searchParams.setOrderBy(o);
        searchParams.setOrderByAsc(orderBy[0].isAsc());
    }
    if (StringHelper.containsNonWhitespace(query)) {
        searchParams.setText(query);
    } else {
        searchParams.setText(null);
    }
    List<RepositoryEntryMyView> views = repositoryService.searchMyView(searchParams, firstResult, maxResults);
    List<RepositoryEntryRow> rows = processViewModel(views);
    ResultInfos<RepositoryEntryRow> results = new DefaultResultInfos<RepositoryEntryRow>(firstResult + rows.size(), -1, rows);
    if (firstResult == 0 && views.size() < maxResults) {
        count = new Integer(views.size());
    }
    return results;
}
Also used : OrderBy(org.olat.repository.model.SearchMyRepositoryEntryViewParams.OrderBy) DefaultResultInfos(org.olat.core.commons.persistence.DefaultResultInfos) RepositoryEntryRow(org.olat.repository.ui.list.RepositoryEntryRow) RepositoryEntryMyView(org.olat.repository.RepositoryEntryMyView)

Example 2 with RepositoryEntryRow

use of org.olat.repository.ui.list.RepositoryEntryRow in project openolat by klemens.

the class VideoEntryDataSource method getRows.

@Override
public ResultInfos<RepositoryEntryRow> getRows(String query, List<FlexiTableFilter> filters, List<String> condQueries, int firstResult, int maxResults, SortKey... orderBy) {
    if (condQueries != null && condQueries.size() > 0) {
        String filter = condQueries.get(0);
        if (StringHelper.containsNonWhitespace(filter)) {
            searchParams.setFilters(Collections.singletonList(Filter.valueOf(filter)));
        } else {
            searchParams.setFilters(null);
        }
    }
    if (orderBy != null && orderBy.length > 0 && orderBy[0] != null) {
        OrderBy o = OrderBy.valueOf(orderBy[0].getKey());
        searchParams.setOrderBy(o);
        searchParams.setOrderByAsc(orderBy[0].isAsc());
    }
    if (StringHelper.containsNonWhitespace(query)) {
        searchParams.setText(query);
    } else {
        searchParams.setText(null);
    }
    List<RepositoryEntryMyView> views = repositoryService.searchMyView(searchParams, firstResult, maxResults);
    List<RepositoryEntryRow> rows = processViewModel(views);
    ResultInfos<RepositoryEntryRow> results = new DefaultResultInfos<RepositoryEntryRow>(firstResult + rows.size(), -1, rows);
    if (firstResult == 0 && views.size() < maxResults) {
        count = new Integer(views.size());
    }
    return results;
}
Also used : OrderBy(org.olat.repository.model.SearchMyRepositoryEntryViewParams.OrderBy) DefaultResultInfos(org.olat.core.commons.persistence.DefaultResultInfos) RepositoryEntryRow(org.olat.repository.ui.list.RepositoryEntryRow) RepositoryEntryMyView(org.olat.repository.RepositoryEntryMyView)

Example 3 with RepositoryEntryRow

use of org.olat.repository.ui.list.RepositoryEntryRow in project openolat by klemens.

the class VideoEntryDataSource method processViewModel.

private List<RepositoryEntryRow> processViewModel(List<RepositoryEntryMyView> repoEntries) {
    List<RepositoryEntryRow> items = new ArrayList<RepositoryEntryRow>();
    for (RepositoryEntryMyView entry : repoEntries) {
        RepositoryEntryRow row = new RepositoryEntryRow(entry);
        items.add(row);
    }
    return items;
}
Also used : RepositoryEntryRow(org.olat.repository.ui.list.RepositoryEntryRow) ArrayList(java.util.ArrayList) RepositoryEntryMyView(org.olat.repository.RepositoryEntryMyView)

Example 4 with RepositoryEntryRow

use of org.olat.repository.ui.list.RepositoryEntryRow in project OpenOLAT by OpenOLAT.

the class VideoEntryDataSource method processViewModel.

private List<RepositoryEntryRow> processViewModel(List<RepositoryEntryMyView> repoEntries) {
    List<RepositoryEntryRow> items = new ArrayList<RepositoryEntryRow>();
    for (RepositoryEntryMyView entry : repoEntries) {
        RepositoryEntryRow row = new RepositoryEntryRow(entry);
        items.add(row);
    }
    return items;
}
Also used : RepositoryEntryRow(org.olat.repository.ui.list.RepositoryEntryRow) ArrayList(java.util.ArrayList) RepositoryEntryMyView(org.olat.repository.RepositoryEntryMyView)

Aggregations

RepositoryEntryMyView (org.olat.repository.RepositoryEntryMyView)4 RepositoryEntryRow (org.olat.repository.ui.list.RepositoryEntryRow)4 ArrayList (java.util.ArrayList)2 DefaultResultInfos (org.olat.core.commons.persistence.DefaultResultInfos)2 OrderBy (org.olat.repository.model.SearchMyRepositoryEntryViewParams.OrderBy)2