use of org.olat.repository.RepositoryEntryLight in project OpenOLAT by OpenOLAT.
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;
}
use of org.olat.repository.RepositoryEntryLight in project OpenOLAT by OpenOLAT.
the class RepositoryPortletRunController method convertRepositoryEntriesToPortletEntryList.
private List<PortletEntry<RepositoryEntryLight>> convertRepositoryEntriesToPortletEntryList(List<RepositoryEntry> items) {
List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
for (RepositoryEntry item : items) {
boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
if (!closed) {
RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
convertedList.add(entry);
}
}
return convertedList;
}
use of org.olat.repository.RepositoryEntryLight in project OpenOLAT by OpenOLAT.
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());
}
}
}
}
use of org.olat.repository.RepositoryEntryLight in project openolat by klemens.
the class RepositoryPortletRunController method convertRepositoryEntriesToPortletEntryList.
private List<PortletEntry<RepositoryEntryLight>> convertRepositoryEntriesToPortletEntryList(List<RepositoryEntry> items) {
List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
for (RepositoryEntry item : items) {
boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
if (!closed) {
RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
convertedList.add(entry);
}
}
return convertedList;
}
use of org.olat.repository.RepositoryEntryLight 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;
}
Aggregations