use of org.olat.repository.model.RepositoryEntryShortImpl in project OpenOLAT by OpenOLAT.
the class OpenMeetingsManagerImpl method getResourceNames.
private Map<Long, String> getResourceNames(List<OpenMeetingsRoomReference> properties) {
Map<Long, String> roomIdToResourceName = new HashMap<Long, String>();
Map<Long, List<Long>> resourceIdToRoomIds = new HashMap<Long, List<Long>>();
for (OpenMeetingsRoomReference prop : properties) {
long roomId = prop.getRoomId();
if (prop.getGroup() != null) {
roomIdToResourceName.put(roomId, prop.getGroup().getName());
} else if ("CourseModule".equals(prop.getResourceTypeName())) {
if (!resourceIdToRoomIds.containsKey(prop.getResourceTypeId())) {
resourceIdToRoomIds.put(prop.getResourceTypeId(), new ArrayList<Long>());
}
resourceIdToRoomIds.get(prop.getResourceTypeId()).add(roomId);
}
}
if (!resourceIdToRoomIds.isEmpty()) {
List<RepositoryEntryShortImpl> shortRepos = repositoryManager.loadRepositoryEntryShortsByResource(resourceIdToRoomIds.keySet(), "CourseModule");
for (RepositoryEntryShortImpl repoEntry : shortRepos) {
List<Long> roomIds = resourceIdToRoomIds.get(repoEntry.getOlatResource().getResourceableId());
for (Long roomId : roomIds) {
roomIdToResourceName.put(roomId, repoEntry.getDisplayname());
}
}
}
return roomIdToResourceName;
}
use of org.olat.repository.model.RepositoryEntryShortImpl in project openolat by klemens.
the class OpenMeetingsManagerImpl method getResourceNames.
private Map<Long, String> getResourceNames(List<OpenMeetingsRoomReference> properties) {
Map<Long, String> roomIdToResourceName = new HashMap<Long, String>();
Map<Long, List<Long>> resourceIdToRoomIds = new HashMap<Long, List<Long>>();
for (OpenMeetingsRoomReference prop : properties) {
long roomId = prop.getRoomId();
if (prop.getGroup() != null) {
roomIdToResourceName.put(roomId, prop.getGroup().getName());
} else if ("CourseModule".equals(prop.getResourceTypeName())) {
if (!resourceIdToRoomIds.containsKey(prop.getResourceTypeId())) {
resourceIdToRoomIds.put(prop.getResourceTypeId(), new ArrayList<Long>());
}
resourceIdToRoomIds.get(prop.getResourceTypeId()).add(roomId);
}
}
if (!resourceIdToRoomIds.isEmpty()) {
List<RepositoryEntryShortImpl> shortRepos = repositoryManager.loadRepositoryEntryShortsByResource(resourceIdToRoomIds.keySet(), "CourseModule");
for (RepositoryEntryShortImpl repoEntry : shortRepos) {
List<Long> roomIds = resourceIdToRoomIds.get(repoEntry.getOlatResource().getResourceableId());
for (Long roomId : roomIds) {
roomIdToResourceName.put(roomId, repoEntry.getDisplayname());
}
}
}
return roomIdToResourceName;
}
Aggregations