response.flushBuffer();
return null;
}
private void exportDissertations(final ServletOutputStream writer, final ExecutionYear executionYear) throws IOException {
final Spreadsheet spreadsheet = new Spreadsheet("Dissertacoes " + executionYear.getYear().replace("/", ""));
spreadsheet.setHeader("Numero aluno");
spreadsheet.setHeader("Nome aluno");
spreadsheet.setHeader("Tipo Curso");
spreadsheet.setHeader("Curso");
spreadsheet.setHeader("Sigla Curso");
spreadsheet.setHeader("Tese");
spreadsheet.setHeader("Estado da tese");
spreadsheet.setHeader("Data da Discussão");
spreadsheet.setHeader("Resumo");
spreadsheet.setHeader("Abstract");
spreadsheet.setHeader("Numero Orientador");
spreadsheet.setHeader("Nome Orientador");
spreadsheet.setHeader("Affiliacao Orientador");
spreadsheet.setHeader("Distribuicao Creditos Orientador");
spreadsheet.setHeader("Numero Corientador");
spreadsheet.setHeader("Nome Corientador");
spreadsheet.setHeader("Affiliacao Corientador");
spreadsheet.setHeader("Distribuicao Creditos Corientador");
spreadsheet.setHeader("Numero Presidente");
spreadsheet.setHeader("Nome Presidente");
spreadsheet.setHeader("Afiliação Presidente");
spreadsheet.setHeader("Nota Dissertação");
for (final Thesis thesis : rootDomainObject.getThesesSet()) {
final Enrolment enrolment = thesis.getEnrolment();
final ExecutionSemester executionSemester = enrolment.getExecutionPeriod();
if (executionSemester.getExecutionYear() == executionYear) {
final ThesisPresentationState thesisPresentationState =
ThesisPresentationState.getThesisPresentationState(thesis);
final Degree degree = enrolment.getStudentCurricularPlan().getDegree();
final DegreeType degreeType = degree.getDegreeType();
final Row row = spreadsheet.addRow();
row.setCell(thesis.getStudent().getNumber().toString());
row.setCell(thesis.getStudent().getPerson().getName());
row.setCell(degreeType.getLocalizedName());
row.setCell(degree.getPresentationName(executionYear));
row.setCell(degree.getSigla());
row.setCell(thesis.getTitle().getContent());
row.setCell(thesisPresentationState.getName());
if (thesis.getDiscussed() != null) {
row.setCell(thesis.getDiscussed().toDate().toString());
}
row.setCell(thesis.getThesisAbstractPt());
row.setCell(thesis.getThesisAbstractEn());
addTeacherRows(thesis, row, ThesisParticipationType.ORIENTATOR);
addTeacherRows(thesis, row, ThesisParticipationType.COORIENTATOR);
addTeacherRows(thesis, row, ThesisParticipationType.PRESIDENT);
row.setCell(thesis.getMark());
}
}
spreadsheet.exportToXLSSheet(writer);
}