Search in sources :

Example 1 with RepositoryEntryOrder

use of org.olat.repository.RepositoryEntryOrder in project openolat by klemens.

the class RepositoryPortletRunController method getAllEntries.

private List<RepositoryEntryLight> getAllEntries(SortingCriteria criteria) {
    int maxResults = criteria == null ? -1 : criteria.getMaxEntries();
    RepositoryEntryOrder orderBy = RepositoryEntryOrder.nameAsc;
    if (criteria != null && !criteria.isAscending()) {
        orderBy = RepositoryEntryOrder.nameDesc;
    }
    List<RepositoryEntryLight> entries;
    if (studentView) {
        entries = RepositoryManager.getInstance().getParticipantRepositoryEntry(getIdentity(), maxResults, orderBy);
    } else {
        List<RepositoryEntry> fullEntries = RepositoryManager.getInstance().getLearningResourcesAsTeacher(getIdentity(), 0, maxResults, orderBy);
        entries = new ArrayList<RepositoryEntryLight>();
        for (RepositoryEntry fullEntry : fullEntries) {
            entries.add(new FullReWrapper(fullEntry));
        }
    }
    return entries;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) RepositoryEntryOrder(org.olat.repository.RepositoryEntryOrder) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 2 with RepositoryEntryOrder

use of org.olat.repository.RepositoryEntryOrder in project OpenOLAT by OpenOLAT.

the class RepositoryPortletRunController method getAllEntries.

private List<RepositoryEntryLight> getAllEntries(SortingCriteria criteria) {
    int maxResults = criteria == null ? -1 : criteria.getMaxEntries();
    RepositoryEntryOrder orderBy = RepositoryEntryOrder.nameAsc;
    if (criteria != null && !criteria.isAscending()) {
        orderBy = RepositoryEntryOrder.nameDesc;
    }
    List<RepositoryEntryLight> entries;
    if (studentView) {
        entries = RepositoryManager.getInstance().getParticipantRepositoryEntry(getIdentity(), maxResults, orderBy);
    } else {
        List<RepositoryEntry> fullEntries = RepositoryManager.getInstance().getLearningResourcesAsTeacher(getIdentity(), 0, maxResults, orderBy);
        entries = new ArrayList<RepositoryEntryLight>();
        for (RepositoryEntry fullEntry : fullEntries) {
            entries.add(new FullReWrapper(fullEntry));
        }
    }
    return entries;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) RepositoryEntryOrder(org.olat.repository.RepositoryEntryOrder) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

RepositoryEntry (org.olat.repository.RepositoryEntry)2 RepositoryEntryLight (org.olat.repository.RepositoryEntryLight)2 RepositoryEntryOrder (org.olat.repository.RepositoryEntryOrder)2