use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.
the class LectureBlockExport method addHeaders_3.
private void addHeaders_3(OpenXMLWorksheet exportSheet) {
Row headerRow = exportSheet.newRow();
int pos = 0;
if (isAdministrativeUser) {
headerRow.addCell(pos++, translator.translate("table.header.username"));
}
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
String propName = userPropertyHandler.getName();
headerRow.addCell(pos++, translator.translate("form.name." + propName));
}
for (int i = 0; i < lectureBlock.getPlannedLecturesNumber(); i++) {
headerRow.addCell(pos++, Integer.toString(i + 1));
}
if (authorizedAbsenceEnabled) {
// authorized absence
headerRow.addCell(pos++, translator.translate("table.header.authorized.absence"));
// authorized absence reason
headerRow.addCell(pos++, translator.translate("authorized.absence.reason"));
}
// comment
headerRow.addCell(pos++, translator.translate("table.header.comment"));
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.
the class LectureBlockExport method addFooter.
private void addFooter(OpenXMLWorksheet exportSheet) {
exportSheet.newRow();
exportSheet.newRow();
Row footerRow = exportSheet.newRow();
int pos = 0;
if (isAdministrativeUser) {
pos++;
}
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
pos++;
}
footerRow.addCell(pos, translator.translate("export.footer.lectures.hint"));
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.
the class QuestionItemAuditLogExport method addContent.
@SuppressWarnings("deprecation")
private void addContent(OpenXMLWorksheet exportSheet, OpenXMLWorkbook workbook) {
for (QuestionItemAuditLog logEntry : auditLog) {
int pos = 0;
Row row = exportSheet.newRow();
Date creationDate = logEntry.getCreationDate();
row.addCell(pos++, creationDate, workbook.getStyles().getDateTimeStyle());
row.addCell(pos++, logEntry.getAction());
QuestionItem item = null;
if (logEntry.getQuestionItemKey() != null) {
item = qpoolService.toAuditQuestionItem(logEntry.getAfter());
}
if (item != null) {
row.addCell(pos++, item.getTitle());
row.addCell(pos++, item.getTopic());
if (qpoolModule.isTaxonomyEnabled()) {
row.addCell(pos++, item.getTaxonomicPath());
}
if (qpoolModule.isEducationalContextEnabled()) {
row.addCell(pos++, getTranslatedContext(item.getEducationalContext()));
}
row.addCell(pos++, item.getKeywords());
row.addCell(pos++, item.getAdditionalInformations());
row.addCell(pos++, item.getCoverage());
row.addCell(pos++, item.getLanguage());
row.addCell(pos++, getTranslatedAssessmentType(item.getAssessmentType()));
row.addCell(pos++, getTranslatedItemType(item.getItemType()));
row.addCell(pos++, item.getEducationalLearningTime());
row.addCell(pos++, format(item.getDifficulty()));
row.addCell(pos++, format(item.getStdevDifficulty()));
row.addCell(pos++, format(item.getDifferentiation()));
row.addCell(pos++, String.valueOf(item.getNumOfAnswerAlternatives()));
row.addCell(pos++, String.valueOf(item.getUsage()));
row.addCell(pos++, item.getItemVersion());
row.addCell(pos++, getTranslatedStatus(item.getQuestionStatus()));
} else {
pos += 16;
if (qpoolModule.isTaxonomyEnabled()) {
pos++;
}
if (qpoolModule.isEducationalContextEnabled()) {
pos++;
}
}
if (licenseModule.isEnabled(licenseHandler)) {
License license = licenseService.licenseFromXml(logEntry.getLicenseAfter());
if (license != null) {
row.addCell(pos++, license.getLicenseType() != null ? license.getLicenseType().getName() : null);
row.addCell(pos++, license.getLicensor());
} else if (item != null) {
// Backward compatibility:
// Before the introduction of the LicenseService the license was stored in the item itself.
row.addCell(pos++, item.getLicense() != null ? item.getLicense().getLicenseKey() : null);
row.addCell(pos++, item.getCreator());
} else {
pos += 2;
}
}
Long authorKey = logEntry.getAuthorKey();
if (authorKey != null) {
String fullname = userManager.getUserDisplayName(authorKey);
row.addCell(pos++, fullname);
}
}
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.
the class QuestionItemAuditLogExport method addHeader.
private void addHeader(OpenXMLWorksheet exportSheet) {
exportSheet.setHeaderRows(2);
Row headerRow = exportSheet.newRow();
int pos = 0;
headerRow.addCell(pos++, translator.translate("export.log.header.log.date"));
headerRow.addCell(pos++, translator.translate("export.log.header.log.action"));
headerRow.addCell(pos++, translator.translate("export.log.header.title"));
headerRow.addCell(pos++, translator.translate("export.log.header.topic"));
if (qpoolModule.isTaxonomyEnabled()) {
headerRow.addCell(pos++, translator.translate("export.log.header.taxonomic.path"));
}
if (qpoolModule.isEducationalContextEnabled()) {
headerRow.addCell(pos++, translator.translate("export.log.header.context"));
}
headerRow.addCell(pos++, translator.translate("export.log.header.keywords"));
headerRow.addCell(pos++, translator.translate("export.log.header.additional.informations"));
headerRow.addCell(pos++, translator.translate("export.log.header.coverage"));
headerRow.addCell(pos++, translator.translate("export.log.header.language"));
headerRow.addCell(pos++, translator.translate("export.log.header.assessment.type"));
headerRow.addCell(pos++, translator.translate("export.log.header.item.type"));
headerRow.addCell(pos++, translator.translate("export.log.header.learningTime"));
headerRow.addCell(pos++, translator.translate("export.log.header.difficulty"));
headerRow.addCell(pos++, translator.translate("export.log.header.stdevDifficulty"));
headerRow.addCell(pos++, translator.translate("export.log.header.differentiation"));
headerRow.addCell(pos++, translator.translate("export.log.header.numOfAnswerAlternatives"));
headerRow.addCell(pos++, translator.translate("export.log.header.usage"));
headerRow.addCell(pos++, translator.translate("export.log.header.version"));
headerRow.addCell(pos++, translator.translate("export.log.header.status"));
if (licenseModule.isEnabled(licenseHandler)) {
headerRow.addCell(pos++, translator.translate("export.log.header.license"));
headerRow.addCell(pos++, translator.translate("export.log.header.licensor"));
}
headerRow.addCell(pos++, translator.translate("export.log.header.log.author"));
}
use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.
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());
}
}
Aggregations