use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project openolat by klemens.
the class LectureBlockAuditLogExport method addHeaders.
@Override
protected void addHeaders(OpenXMLWorksheet exportSheet) {
Row headerRow = exportSheet.newRow();
int pos = 0;
headerRow.addCell(pos++, translator.translate("export.header.entry", new String[] { entry.getDisplayname() }));
Formatter formatter = Formatter.getInstance(translator.getLocale());
String[] args = new String[] { lectureBlock.getTitle(), formatter.formatDate(lectureBlock.getStartDate()), formatter.formatTimeShort(lectureBlock.getStartDate()), formatter.formatTimeShort(lectureBlock.getEndDate()) };
headerRow.addCell(pos++, translator.translate("export.header.lectureblocks", args));
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project openolat by klemens.
the class LectureBlockExport method addHeaders_1.
private void addHeaders_1(OpenXMLWorksheet exportSheet) {
Row headerRow = exportSheet.newRow();
int pos = 0;
Formatter formatter = Formatter.getInstance(translator.getLocale());
String[] args = new String[] { lectureBlock.getTitle(), formatter.formatDate(lectureBlock.getStartDate()), formatter.formatTimeShort(lectureBlock.getStartDate()), formatter.formatTimeShort(lectureBlock.getEndDate()) };
headerRow.addCell(pos, translator.translate("export.header.lectureblocks", args));
if (isAdministrativeUser) {
pos++;
}
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
pos++;
}
if (teachers != null && teachers.size() > 0) {
StringBuilder sb = new StringBuilder();
for (Identity teacher : teachers) {
if (sb.length() > 0)
sb.append(", ");
sb.append(userManager.getUserDisplayName(teacher));
}
headerRow.addCell(pos, translator.translate("export.header.teachers", new String[] { sb.toString() }));
}
if (StringHelper.containsNonWhitespace(lectureBlock.getLocation())) {
pos += lectureBlock.getPlannedLecturesNumber();
headerRow.addCell(pos, translator.translate("export.header.location", new String[] { lectureBlock.getLocation() }));
}
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project openolat by klemens.
the class LectureBlockExport method addContent.
private void addContent(OpenXMLWorksheet exportSheet) {
List<Identity> participants = lectureService.getParticipants(lectureBlock);
List<LectureBlockRollCall> rollCalls = lectureService.getRollCalls(lectureBlock);
Map<Identity, LectureBlockRollCall> participantToRollCallMap = rollCalls.stream().collect(Collectors.toMap(r -> r.getIdentity(), r -> r));
for (Identity participant : participants) {
Row row = exportSheet.newRow();
int pos = 0;
if (isAdministrativeUser) {
row.addCell(pos++, participant.getName());
}
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
String val = userPropertyHandler.getUserProperty(participant.getUser(), translator.getLocale());
row.addCell(pos++, val);
}
LectureBlockRollCall rollCall = participantToRollCallMap.get(participant);
if (rollCall != null) {
List<Integer> absentList = rollCall.getLecturesAbsentList();
for (int i = 0; i < lectureBlock.getPlannedLecturesNumber(); i++) {
String val = absentList.contains(i) ? "x" : null;
row.addCell(pos++, val);
}
if (authorizedAbsenceEnabled && rollCall.getAbsenceAuthorized() != null && rollCall.getAbsenceAuthorized().booleanValue()) {
row.addCell(pos++, "x");
row.addCell(pos++, rollCall.getAbsenceReason());
}
}
}
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project openolat by klemens.
the class LecturesBlocksEntryExport method addContent.
private void addContent(OpenXMLWorksheet exportSheet) {
for (LectureBlockWithTeachers block : blocks) {
Row row = exportSheet.newRow();
LectureBlock lectureBlock = block.getLectureBlock();
int pos = 0;
row.addCell(pos++, lectureBlock.getTitle());
row.addCell(pos++, lectureBlock.getLocation());
row.addCell(pos++, formatDate(lectureBlock.getStartDate()));
row.addCell(pos++, formatTime(lectureBlock.getStartDate()));
row.addCell(pos++, formatTime(lectureBlock.getEndDate()));
StringBuilder teachers = new StringBuilder();
for (Identity teacher : block.getTeachers()) {
if (teachers.length() > 0)
teachers.append(", ");
teachers.append(userManager.getUserDisplayName(teacher));
}
row.addCell(pos++, teachers.toString());
if (lectureBlock.getRollCallStatus() == null) {
pos++;
} else {
String status = LectureBlockStatusCellRenderer.getStatus(lectureBlock, translator);
if (status != null) {
row.addCell(pos++, status);
} else {
pos++;
}
}
row.addCell(pos++, formatter.formatDate(lectureBlock.getAutoClosedDate()));
row.addCell(pos++, toInt(lectureBlock.getPlannedLecturesNumber()));
row.addCell(pos++, toInt(lectureBlock.getEffectiveLecturesNumber()));
row.addCell(pos++, formatTime(lectureBlock.getEffectiveEndDate()));
Reason reason = lectureBlock.getReasonEffectiveEnd();
if (reason == null) {
pos++;
} else {
row.addCell(pos++, reason.getTitle());
}
row.addCell(pos++, lectureBlock.getComment());
}
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project openolat by klemens.
the class LecturesBlocksEntryExport method addHeaders.
private void addHeaders(OpenXMLWorksheet exportSheet) {
Row headerRow = exportSheet.newRow();
int pos = 0;
headerRow.addCell(pos++, translator.translate("lecture.title", null));
headerRow.addCell(pos++, translator.translate("lecture.location", null));
headerRow.addCell(pos++, translator.translate("lecture.date", null));
headerRow.addCell(pos++, translator.translate("table.header.start.time", null));
headerRow.addCell(pos++, translator.translate("table.header.end.time", null));
headerRow.addCell(pos++, translator.translate("table.header.teachers", null));
headerRow.addCell(pos++, translator.translate("table.header.status", null));
headerRow.addCell(pos++, translator.translate("table.header.auto.close.date", null));
headerRow.addCell(pos++, translator.translate("planned.lectures", null));
headerRow.addCell(pos++, translator.translate("table.header.effective.lectures", null));
headerRow.addCell(pos++, translator.translate("lecture.block.effective.end", null));
headerRow.addCell(pos++, translator.translate("lecture.block.effective.reason", null));
headerRow.addCell(pos++, translator.translate("table.header.comment", null));
}
Aggregations