use of org.olat.core.commons.services.mark.Mark in project OpenOLAT by OpenOLAT.
the class BookmarksPortletRunController method convertMarkToBookmark.
private List<Bookmark> convertMarkToBookmark(List<Mark> items) {
List<Bookmark> convertedList = new ArrayList<Bookmark>();
List<Long> reKeys = new ArrayList<Long>();
for (Mark mark : items) {
reKeys.add(mark.getOLATResourceable().getResourceableId());
}
List<RepositoryEntry> repositoryEntries = repositoryManager.lookupRepositoryEntries(reKeys);
Map<Long, RepositoryEntry> keyToRepositoryEntryMap = new HashMap<Long, RepositoryEntry>();
for (RepositoryEntry repositoryEntry : repositoryEntries) {
keyToRepositoryEntryMap.put(repositoryEntry.getKey(), repositoryEntry);
}
for (Mark mark : items) {
RepositoryEntry repositoryEntry = keyToRepositoryEntryMap.get(mark.getOLATResourceable().getResourceableId());
if (repositoryEntry != null) {
convertedList.add(new Bookmark(mark, repositoryEntry));
}
}
return convertedList;
}
use of org.olat.core.commons.services.mark.Mark in project openolat by klemens.
the class BookmarksPortletRunController method convertMarkToBookmark.
private List<Bookmark> convertMarkToBookmark(List<Mark> items) {
List<Bookmark> convertedList = new ArrayList<Bookmark>();
List<Long> reKeys = new ArrayList<Long>();
for (Mark mark : items) {
reKeys.add(mark.getOLATResourceable().getResourceableId());
}
List<RepositoryEntry> repositoryEntries = repositoryManager.lookupRepositoryEntries(reKeys);
Map<Long, RepositoryEntry> keyToRepositoryEntryMap = new HashMap<Long, RepositoryEntry>();
for (RepositoryEntry repositoryEntry : repositoryEntries) {
keyToRepositoryEntryMap.put(repositoryEntry.getKey(), repositoryEntry);
}
for (Mark mark : items) {
RepositoryEntry repositoryEntry = keyToRepositoryEntryMap.get(mark.getOLATResourceable().getResourceableId());
if (repositoryEntry != null) {
convertedList.add(new Bookmark(mark, repositoryEntry));
}
}
return convertedList;
}
Aggregations