Search in sources :

Example 6 with RepositoryEntryLight

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

the class RepositoryPortletRunController method event.

/**
 * @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    super.event(ureq, source, event);
    if (source == tableCtr) {
        if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
            TableEvent te = (TableEvent) event;
            String actionid = te.getActionId();
            if (actionid.equals(CMD_LAUNCH)) {
                int rowId = te.getRowId();
                PortletEntry<RepositoryEntryLight> entry = repoEntryListModel.getObject(rowId);
                NewControllerFactory.getInstance().launch("[RepositoryEntry:" + entry.getKey() + "]", ureq, getWindowControl());
            }
        }
    }
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) TableEvent(org.olat.core.gui.components.table.TableEvent)

Example 7 with RepositoryEntryLight

use of org.olat.repository.RepositoryEntryLight 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)

Example 8 with RepositoryEntryLight

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

the class RepositoryPortletRunController method convertShortRepositoryEntriesToPortletEntryList.

private List<PortletEntry<RepositoryEntryLight>> convertShortRepositoryEntriesToPortletEntryList(List<RepositoryEntryLight> items) {
    List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
    for (RepositoryEntryLight item : items) {
        boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
        if (!closed) {
            RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
            convertedList.add(entry);
        }
    }
    return convertedList;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) ArrayList(java.util.ArrayList)

Aggregations

RepositoryEntryLight (org.olat.repository.RepositoryEntryLight)8 ArrayList (java.util.ArrayList)4 PortletEntry (org.olat.core.gui.control.generic.portal.PortletEntry)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 TableEvent (org.olat.core.gui.components.table.TableEvent)2 RepositoryEntryOrder (org.olat.repository.RepositoryEntryOrder)2