use of org.olat.modules.portfolio.ui.model.UserAssignmentInfos in project OpenOLAT by OpenOLAT.
the class PageMetadataController method initAssignments.
private void initAssignments(UserRequest ureq) {
boolean needMapper = false;
List<UserAssignmentInfos> assignmentInfos = new ArrayList<>(assignments.size());
for (Assignment assignment : assignments) {
List<File> documents = null;
File storage = fileStorage.getAssignmentDirectory(assignment);
if (storage != null) {
documents = Arrays.<File>asList(storage.listFiles());
if (documents.size() > 0) {
needMapper = true;
}
}
UserAssignmentInfos infos = new UserAssignmentInfos(assignment, documents);
assignmentInfos.add(infos);
}
mainVC.contextPut("assignments", assignmentInfos);
if (needMapper) {
String mapperUri = registerCacheableMapper(ureq, "assigment-" + page.getKey(), new DocumentMapper());
mainVC.contextPut("mapperUri", mapperUri);
}
}
use of org.olat.modules.portfolio.ui.model.UserAssignmentInfos in project openolat by klemens.
the class PageMetadataController method initAssignments.
private void initAssignments(UserRequest ureq) {
boolean needMapper = false;
List<UserAssignmentInfos> assignmentInfos = new ArrayList<>(assignments.size());
for (Assignment assignment : assignments) {
List<File> documents = null;
File storage = fileStorage.getAssignmentDirectory(assignment);
if (storage != null) {
documents = Arrays.<File>asList(storage.listFiles());
if (documents.size() > 0) {
needMapper = true;
}
}
UserAssignmentInfos infos = new UserAssignmentInfos(assignment, documents);
assignmentInfos.add(infos);
}
mainVC.contextPut("assignments", assignmentInfos);
if (needMapper) {
String mapperUri = registerCacheableMapper(ureq, "assigment-" + page.getKey(), new DocumentMapper());
mainVC.contextPut("mapperUri", mapperUri);
}
}
Aggregations