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;
}
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;
}
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;
}
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;
}
Aggregations