Package pt.utl.ist.fenix.tools.util.excel.Spreadsheet

Examples of pt.utl.ist.fenix.tools.util.excel.Spreadsheet.Row


                                for (final ExecutionCourse executionCourse : curricularCourse.getAssociatedExecutionCoursesSet()) {
                                    if (checkExecutionYear(getExecutionYear(), executionCourse)) {
                                        for (final Professorship professorship : executionCourse.getProfessorshipsSet()) {
                                            if (professorship.hasTeacher()) {
                                                final Teacher teacher = professorship.getTeacher();
                                                final Row row = spreadsheet.addRow();
                                                setDegreeCells(row, degree);
                                                row.setCell(curricularCourse.getName());
                                                row.setCell(executionCourse.getExternalId());
                                                row.setCell(teacher.getPerson().getUsername());
                                                row.setCell(String.valueOf(executionCourse.getOid()));
                                            }
                                        }
                                    }
                                }
                            }
View Full Code Here


    private Spreadsheet buildReport(final Degree degree, final SortedSet<SecondCycleIndividualCandidacyProcess> name) {
        final Spreadsheet spreadsheet = new Spreadsheet(degree.getSigla(), getHeader());

        for (final SecondCycleIndividualCandidacyProcess process : name) {
            final Row row = spreadsheet.addRow();
            row.setCell(process.getPersonalDetails().getName());
            row.setCell(process.getPrecedentDegreeInformation().getConclusionGrade());
            row.setCell(process.getCandidacyProfessionalExperience());
            row.setCell(process.getPrecedentDegreeInformation().getDegreeAndInstitutionName());
            row.setCell(process.getCandidacyAffinity());
            row.setCell(process.getCandidacyDegreeNature());
            row.setCell(process.getCandidacyGrade());
            row.setCell(process.getCandidacyInterviewGrade() != null ? process.getCandidacyInterviewGrade() : " ");
            row.setCell(process.getCandidacySeriesGrade());
            if (process.isCandidacyAccepted() || process.isCandidacyRejected()) {
                row.setCell(BundleUtil.getString(Bundle.ENUMERATION, process.getCandidacyState().getQualifiedName()));
            } else {
                row.setCell(" ");
            }
        }

        return spreadsheet;
    }
View Full Code Here

                                    && ((RegistrationState) item).getExecutionYear().equals(getExecutionYear());
                        }
                    });
                    Collections.sort(states, RegistrationState.DATE_COMPARATOR);
                    if (!states.isEmpty() && states.getLast().getStateType().equals(RegistrationStateType.FLUNKED)) {
                        final Row row = spreadsheet.addRow();
                        row.setCell(registration.getNumber());
                        CycleType cycleType = registration.getCycleType(states.getLast().getExecutionYear());
                        row.setCell(cycleType != null ? cycleType.toString() : "");
                        setDegreeCells(row, degree);
                    }
                }
            }
        }
View Full Code Here

        for (final ExecutionSemester executionSemester : getExecutionYear().getExecutionPeriodsSet()) {
            for (final ExecutionCourse executionCourse : executionSemester.getAssociatedExecutionCoursesSet()) {
                for (final Evaluation evaluation : executionCourse.getAssociatedEvaluationsSet()) {
                    if (evaluation instanceof WrittenEvaluation) {
                        final WrittenEvaluation writtenEvaluation = (WrittenEvaluation) evaluation;
                        final Row row = spreadsheet.addRow();
                        row.setCell(getExecutionYear().getYear());
                        row.setCell(executionSemester.getSemester());
                        row.setCell(executionCourse.getExternalId());
                        row.setCell(executionCourse.getName());
                        row.setCell(writtenEvaluation.getExternalId());
                        row.setCell(writtenEvaluation instanceof Exam ? "Exame" : "Teste");
                        row.setCell(writtenEvaluation.getDayDateYearMonthDay().toString("yyyy-MM-dd"));
                        row.setCell(writtenEvaluation.getBeginningDateTime().toString("HH:mm"));
                        row.setCell(writtenEvaluation.getEndDateTime().toString("HH:mm"));
                        final StringBuilder rooms = new StringBuilder();
                        int examVacancy = 0;
                        int normalVacancy = 0;
                        for (final WrittenEvaluationSpaceOccupation roomOccupation : writtenEvaluation
                                .getWrittenEvaluationSpaceOccupationsSet()) {
                            final Space room = roomOccupation.getRoom();
                            if (rooms.length() > 0) {
                                rooms.append(", ");
                            }
                            rooms.append(room.getName());
                            examVacancy += room.<Integer> getMetadata("examCapacity").orElse(0).intValue();
                            normalVacancy += room.getAllocatableCapacity().intValue();
                        }
                        row.setCell(rooms.toString());
                        row.setCell(examVacancy);
                        row.setCell(normalVacancy);

                        if (writtenEvaluation.getEnrollmentBeginDayDateYearMonthDay() == null) {
                            row.setCell(" ");
                        } else {
                            final int enrolmentCount = writtenEvaluation.getWrittenEvaluationEnrolmentsSet().size();
                            row.setCell(enrolmentCount);
                        }
                    }
                }
            }
        }
View Full Code Here

                        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());
                row.setCell(degree.getSigla());
                row.setCell(thesis.getTitle().getContent());
                row.setCell(thesisPresentationState.getName());

                addTeacherRows(thesis, row, ThesisParticipationType.ORIENTATOR);
                addTeacherRows(thesis, row, ThesisParticipationType.COORIENTATOR);
            }
        }
View Full Code Here

            final Degree degree = degreeCurricularPlan.getDegree();
            if (degreesToInclude == null || degreesToInclude.contains(degree)) {
                for (final CurricularCourse curricularCourse : degreeCurricularPlan.getAllCurricularCourses()) {
                    if (curricularCourse.isActive(executionYear)) {
                        final int enrolmentCount = countEnrolments(curricularCourse, executionYear);
                        final Row row = spreadsheet.addRow();
                        row.setCell(degree.getSigla());
                        row.setCell(degree.getPresentationName(executionYear));
                        row.setCell(curricularCourse.getName());
                        row.setCell(Integer.toString(enrolmentCount));
                        row.setCell(Integer.toString(countEnrolments(curricularCourse, executionYear.getFirstExecutionPeriod())));
                        row.setCell(Integer.toString(countEnrolments(curricularCourse, executionYear.getLastExecutionPeriod())));
                    }
                }
            }
        }
    }
View Full Code Here

    }

    private Spreadsheet generateSpreadsheet(SpecialSeasonStatusTrackerBean bean) {
        final Spreadsheet spreadsheet = createSpreadSheet();
        for (final Enrolment enrolment : bean.getEnrolments()) {
            final Row row = spreadsheet.addRow();

            row.setCell(enrolment.getRegistration().getPerson().getUsername());
            row.setCell(enrolment.getRegistration().getNumber());
            row.setCell(enrolment.getRegistration().getPerson().getName());
            row.setCell(enrolment.getRegistration().getPerson().getInstitutionalOrDefaultEmailAddressValue());
            row.setCell(enrolment.getRegistration().getDegree().getSigla());
            row.setCell(enrolment.getRegistration().getStudentCurricularPlan(bean.getExecutionSemester()).getName());
            row.setCell(enrolment.getCurricularCourse().getAcronym());
            row.setCell(enrolment.getCurricularCourse().getName());
        }

        return spreadsheet;
    }
View Full Code Here

        spreadsheet.setHeader("Sala");
        spreadsheet.setHeader("Numero Presencas");
        for (final ExecutionSemester executionSemester : getExecutionYear().getExecutionPeriodsSet()) {
            for (final ExecutionCourse executionCourse : executionSemester.getAssociatedExecutionCoursesSet()) {
                for (final Summary summary : executionCourse.getAssociatedSummariesSet()) {
                    final Row row = spreadsheet.addRow();
                    row.setCell(getExecutionYear().getYear());
                    row.setCell(executionSemester.getSemester());
                    row.setCell(executionCourse.getExternalId());
                    row.setCell(executionCourse.getName());
                    final LessonInstance lessonInstance = summary.getLessonInstance();
                    final CourseLoad courseLoad = lessonInstance == null ? null : lessonInstance.getCourseLoad();
                    final ShiftType shiftType = courseLoad == null ? null : courseLoad.getType();
                    row.setCell(shiftType == null ? "" : shiftType.getName());
                    final Shift shift = summary.getShift();
                    row.setCell(shift == null ? "" : shift.getNome());
                    row.setCell(getTeacherId(summary));
                    row.setCell(getTeacherName(summary));
                    row.setCell(getSchedule(summary));
                    final Space room = summary.getRoom();
                    row.setCell(room == null ? "" : room.getName());
                    row.setCell(summary.getStudentsNumber());
                }
            }
        }
    }
View Full Code Here

                                    new EnrolmentAndAprovalCounterMap(firstExecutionSemester, lastExecutionSemester, registration);
                            for (final Entry<ExecutionSemester, EnrolmentAndAprovalCounter> entry : map.entrySet()) {
                                final ExecutionSemester executionSemester = entry.getKey();
                                final EnrolmentAndAprovalCounter enrolmentAndAprovalCounter = entry.getValue();

                                final Row row = spreadsheet.addRow();
                                row.setCell(registration.getNumber().toString());
                                row.setCell(executionSemester.getExecutionYear().getYear());
                                row.setCell(executionSemester.getSemester().toString());
                                setDegreeCells(row, degree);
                                final StringBuilder stringBuilder = new StringBuilder();
                                for (final StudentStatuteBean studentStatuteBean : registration.getStudent().getStatutes(
                                        executionSemester)) {
                                    if (stringBuilder.length() > 0) {
                                        stringBuilder.append(", ");
                                    }
                                    stringBuilder.append(studentStatuteBean.getStudentStatute().getStatuteType());
                                }
                                row.setCell(stringBuilder.toString());
                                CycleType cycleType = registration.getCycleType(executionSemester.getExecutionYear());
                                row.setCell(cycleType != null ? cycleType.getDescription() : "");
                                row.setCell(registration.getRegimeType(executionSemester.getExecutionYear()).getLocalizedName());
                                row.setCell(Integer.toString(enrolmentAndAprovalCounter.getEnrolments()));
                                row.setCell(Integer.toString(enrolmentAndAprovalCounter.getAprovals()));
                            }
                        }
                    }
                }
            }
View Full Code Here

        spreadsheet.setHeader("Data de Apresentação Pública da CAT");
    }

    private void reportRaidesGraduate(Spreadsheet spreadsheet, PhdIndividualProgramProcess process, ExecutionYear executionYear) {
        final Row row = spreadsheet.addRow();
        final Person graduate = process.getPerson();
        final PersonalInformationBean personalInformationBean = process.getPersonalInformationBean(executionYear);
        final Registration registration = process.getRegistration();
        final boolean concluded = process.isConcluded();
        final LocalDate conclusionDate = process.getConclusionDate();

        if (registration != null && !registration.isBolonha()) {
            return;
        }

        YearMonthDay registrationConclusionDate =
                registration != null ? registration.getLastStudentCurricularPlan().getCycle(CycleType.THIRD_CYCLE)
                        .getConclusionDate() : null;

        if (registration != null && registrationConclusionDate == null) {
            registrationConclusionDate =
                    registration.getLastStudentCurricularPlan().calculateConclusionDate(CycleType.THIRD_CYCLE);
        }

        row.setCell(String.valueOf(registration != null && !registration.isCanceled()));

        // Ciclo
        row.setCell(CycleType.THIRD_CYCLE.getDescription());

        // Concluído
        row.setCell(String.valueOf(process.isConcluded()));

        // Média do Ciclo
        String grade = concluded ? process.getFinalGrade().getLocalizedName() : "n/a";
        if (concluded && registration != null && registration.isConcluded()) {
            grade +=
                    " "
                            + registration.getLastStudentCurricularPlan().getCycle(CycleType.THIRD_CYCLE)
                                    .getCurriculum(registrationConclusionDate.toDateTimeAtMidnight()).getAverage()
                                    .toPlainString();
        }
        row.setCell(grade);

        // Data de conclusão
        row.setCell(conclusionDate != null ? conclusionDate.toString("dd-MM-yyyy") : "");

        // Data de Início
        row.setCell(process.getCandidacyDate().toString("dd-MM-yyyy"));

        // Nº de aluno
        row.setCell(process.getStudent().getNumber());

        // Tipo Identificação
        row.setCell(graduate.getIdDocumentType().getLocalizedName());

        // Nº de Identificação
        row.setCell(graduate.getDocumentIdNumber());

        // Dígitos de Controlo
        row.setCell(graduate.getIdentificationDocumentExtraDigitValue());

        // Versão Doc. Identificação
        row.setCell(graduate.getIdentificationDocumentSeriesNumberValue());

        // Nome
        row.setCell(registration != null ? registration.getName() : process.getPerson() != null ? process.getPerson().getName() : "n/a");

        // Sexo
        row.setCell(graduate.getGender().toString());

        // Data de Nascimento
        row.setCell(graduate.getDateOfBirthYearMonthDay() != null ? graduate.getDateOfBirthYearMonthDay().toString("dd-MM-yyyy") : "n/a");

        // País de Nascimento
        row.setCell(graduate.getCountryOfBirth() != null ? graduate.getCountryOfBirth().getName() : "n/a");

        // País de Nacionalidade
        row.setCell(graduate.getCountry() != null ? graduate.getCountry().getName() : "n/a");

        // Sigla programa doutoral
        row.setCell(process.getPhdProgram().getAcronym());

        // Programa doutoral
        row.setCell(process.getPhdProgram().getName().getContent());

        // Tipo Curso
        row.setCell(registration != null ? registration.getDegreeType().getLocalizedName() : "n/a");

        // Nome Curso
        row.setCell(registration != null ? registration.getDegree().getNameI18N().getContent() : "n/a");

        // Sigla Curso
        row.setCell(registration != null ? registration.getDegree().getSigla() : "n/a");

        // Ramo (caso se aplique)
        row.setCell("não determinável");

        if (registration != null) {
            // Nº de anos lectivos de inscrição no Curso actual
            row.setCell(calculateNumberOfEnrolmentYears(registration, executionYear));

            // Último ano em que esteve inscrito
            row.setCell(registration.getLastEnrolmentExecutionYear() != null ? registration.getLastEnrolmentExecutionYear()
                    .getName() : "");
        } else {
            row.setCell("n/a");
            row.setCell("n/a");
        }

        // estabelecimento do habl anterior compl (se o aluno ingressou por uma via
        // diferente CNA, e deve ser IST caso o aluno tenha estado matriculado noutro curso do IST)
        row.setCell(personalInformationBean.getInstitution() != null ? personalInformationBean.getInstitution().getName() : "");

        // curso habl anterior compl (se o aluno ingressou por uma via diferente CNA, e
        // deve ser IST caso o aluno tenha estado matriculado noutro curso do IST)
        row.setCell(personalInformationBean.getDegreeDesignation());

        // Estado Civil
        row.setCell(personalInformationBean.getMaritalStatus() != null ? personalInformationBean.getMaritalStatus().toString() : process
                .getPerson().getMaritalStatus().toString());

        // País de Residência Permanente
        if (personalInformationBean.getCountryOfResidence() != null) {
            row.setCell(personalInformationBean.getCountryOfResidence().getName());
        } else {
            row.setCell(process.getStudent().getPerson().getCountryOfResidence() != null ? process.getStudent().getPerson()
                    .getCountryOfResidence().getName() : "");
        }

        // Distrito de Residência Permanente
        if (personalInformationBean.getDistrictSubdivisionOfResidence() != null) {
            row.setCell(personalInformationBean.getDistrictSubdivisionOfResidence().getDistrict().getName());
        } else {
            row.setCell(process.getStudent().getPerson().getDistrictOfResidence());
        }

        // Concelho de Residência Permanente
        if (personalInformationBean.getDistrictSubdivisionOfResidence() != null) {
            row.setCell(personalInformationBean.getDistrictSubdivisionOfResidence().getName());
        } else {
            row.setCell(process.getStudent().getPerson().getDistrictSubdivisionOfResidence());
        }

        // Deslocado da Residência Permanente
        if (personalInformationBean.getDislocatedFromPermanentResidence() != null) {
            row.setCell(personalInformationBean.getDislocatedFromPermanentResidence().toString());
        } else {
            row.setCell("");
        }

        // Nível de Escolaridade do Pai
        if (personalInformationBean.getFatherSchoolLevel() != null) {
            row.setCell(personalInformationBean.getFatherSchoolLevel().getName());
        } else {
            row.setCell("");
        }

        // Nível de Escolaridade da Mãe
        if (personalInformationBean.getMotherSchoolLevel() != null) {
            row.setCell(personalInformationBean.getMotherSchoolLevel().getName());
        } else {
            row.setCell("");
        }

        // Condição perante a situação na profissão/Ocupação do Pai
        if (personalInformationBean.getFatherProfessionalCondition() != null) {
            row.setCell(personalInformationBean.getFatherProfessionalCondition().getName());
        } else {
            row.setCell("");
        }

        // Condição perante a situação na profissão/Ocupação da Mãe
        if (personalInformationBean.getMotherProfessionalCondition() != null) {
            row.setCell(personalInformationBean.getMotherProfessionalCondition().getName());
        } else {
            row.setCell("");
        }

        // Profissão do Pai
        if (personalInformationBean.getFatherProfessionType() != null) {
            row.setCell(personalInformationBean.getFatherProfessionType().getName());
        } else {
            row.setCell("");
        }

        // Profissão da Mãe
        if (personalInformationBean.getMotherProfessionType() != null) {
            row.setCell(personalInformationBean.getMotherProfessionType().getName());
        } else {
            row.setCell("");
        }

        // Profissão do Aluno
        if (personalInformationBean.getProfessionType() != null) {
            row.setCell(personalInformationBean.getProfessionType().getName());
        } else {
            row.setCell("");
        }

        // Data preenchimento dados RAIDES
        if (personalInformationBean.getLastModifiedDate() != null) {
            DateTime dateTime = personalInformationBean.getLastModifiedDate();
            row.setCell(dateTime.getYear() + "-" + dateTime.getMonthOfYear() + "-" + dateTime.getDayOfMonth());
        } else {
            row.setCell("");
        }

        // Estatuto de Trabalhador Estudante introduzido pelo aluno
        if (personalInformationBean.getProfessionalCondition() != null) {
            row.setCell(personalInformationBean.getProfessionalCondition().getName());
        } else {
            row.setCell("");
        }

        // Bolseiro (info. RAIDES)
        if (personalInformationBean.getGrantOwnerType() != null) {
            row.setCell(personalInformationBean.getGrantOwnerType().getName());
        } else {
            row.setCell("");
        }

        // Bolseiro (info. oficial)
        boolean sasFound = false;
        for (StudentStatute statute : process.getStudent().getStudentStatutesSet()) {
            if (statute.getStatuteType() == StudentStatuteType.SAS_GRANT_OWNER
                    && statute.isValidInExecutionPeriod(executionYear.getFirstExecutionPeriod())) {
                sasFound = true;
                break;
            }
        }
        row.setCell(String.valueOf(sasFound));

        // Grau Precedente
        row.setCell(personalInformationBean.getPrecedentSchoolLevel() != null ? personalInformationBean.getPrecedentSchoolLevel()
                .getName() : "");

        // grau habl anterior compl
        row.setCell(personalInformationBean.getSchoolLevel() != null ? personalInformationBean.getSchoolLevel().getName() : "");

        // outro grau habl anterior compl
        row.setCell(personalInformationBean.getOtherSchoolLevel() != null ? personalInformationBean.getOtherSchoolLevel() : "");

        // País de Habilitação Anterior Completa
        row.setCell(personalInformationBean.getCountryWhereFinishedPreviousCompleteDegree() != null ? personalInformationBean
                .getCountryWhereFinishedPreviousCompleteDegree().getName() : "");

        // País de Habilitação do 12º ano ou equivalente
        row.setCell(personalInformationBean.getCountryWhereFinishedHighSchoolLevel() != null ? personalInformationBean
                .getCountryWhereFinishedHighSchoolLevel().getName() : "");

        // Ano de conclusão da habilitação anterior completa
        row.setCell(personalInformationBean.getConclusionYear());

        // Nota de conclusão da habilitação anterior completa
        row.setCell(personalInformationBean.getConclusionGrade() != null ? personalInformationBean.getConclusionGrade() : "");

        // Nº inscrições no curso preced. (conta uma por cada ano)
        row.setCell(personalInformationBean.getNumberOfPreviousYearEnrolmentsInPrecedentDegree() != null ? personalInformationBean
                .getNumberOfPreviousYearEnrolmentsInPrecedentDegree().toString() : "");

        // Duração do programa de mobilidade
        row.setCell(personalInformationBean.getMobilityProgramDuration() != null ? BundleUtil.getString(Bundle.ENUMERATION,
                personalInformationBean.getMobilityProgramDuration().name()) : "");

        // Tipo de Estabelecimento Frequentado no Ensino Secundário
        if (personalInformationBean.getHighSchoolType() != null) {
            row.setCell(personalInformationBean.getHighSchoolType().getName());
        } else {
            row.setCell("");
        }

        double totalEctsConcludedUntilPreviousYear = 0d;
        if (registration != null) {

            // Total de ECTS inscritos no total do ano
            double totalCreditsEnrolled = 0d;
            for (Enrolment enrollment : registration.getLastStudentCurricularPlan().getEnrolmentsByExecutionYear(executionYear)) {
                totalCreditsEnrolled += enrollment.getEctsCredits();
            }
            row.setCell(totalCreditsEnrolled);

            // Total de ECTS concluídos até ao fim do ano lectivo anterior (1º
            // Semestre do ano lectivo actual) ao que se
            // referem os dados (neste caso até ao fim de 2008) no curso actual
            for (final CycleCurriculumGroup cycleCurriculumGroup : registration.getLastStudentCurricularPlan()
                    .getInternalCycleCurriculumGrops()) {

                // We can use current year because only the first semester has
                // occured
                totalEctsConcludedUntilPreviousYear += cycleCurriculumGroup.getCreditsConcluded(executionYear);
            }
            row.setCell(totalEctsConcludedUntilPreviousYear);

            // Nº ECTS equivalência/substituição/dispensa
            double totalCreditsDismissed = 0d;
            for (Credits credits : registration.getLastStudentCurricularPlan().getCreditsSet()) {
                if (credits.isEquivalence()) {
                    totalCreditsDismissed += credits.getEnrolmentsEcts();
                }
            }
            row.setCell(totalCreditsDismissed);

        } else {
            row.setCell("n/a");
            row.setCell("n/a");
            row.setCell("n/a");
        }

        if (registration != null) {
            // Total de ECTS necessários para a conclusão
            if (concluded) {
                row.setCell(0);
            } else {
                row.setCell(registration.getLastStudentCurricularPlan().getRoot().getDefaultEcts(executionYear)
                        - totalEctsConcludedUntilPreviousYear);
            }
        } else {
            row.setCell("n/a");
        }

        // Se alunos de Doutoramento, inscrito na Parte Curricular?
        if (registration != null && registration.isDEA()) {
            row.setCell(String.valueOf(registration.getLastStudentCurricularPlan().hasEnrolments(executionYear)));
        } else {
            row.setCell("not PhD");
        }

        row.setCell(process.getPhdStudentNumber());

        // ist id dos orientadores
        int count = 0;
        StringBuilder guidings = new StringBuilder();
        for (PhdParticipant phdParticipant : process.getGuidingsSet()) {
            if (phdParticipant.isInternal()) {
                if (count > 0) {
                    guidings.append(";");
                }
                guidings.append(((InternalPhdParticipant) phdParticipant).getPerson().getUsername());
                count++;
            }
        }
        row.setCell(guidings.toString());

        // ist id dos co-orientadores
        int countAssistantGuidings = 0;
        StringBuilder assistantGuidings = new StringBuilder();
        for (PhdParticipant phdParticipant : process.getAssistantGuidingsSet()) {
            if (phdParticipant.isInternal()) {
                if (countAssistantGuidings > 0) {
                    assistantGuidings.append(";");
                }
                assistantGuidings.append(((InternalPhdParticipant) phdParticipant).getPerson().getUsername());
                countAssistantGuidings++;
            }
        }
        row.setCell(assistantGuidings.toString());

        // Nome do Orientador Externo
        int countExternalGuidings = 0;
        StringBuilder externalGuidingNames = new StringBuilder();
        for (PhdParticipant phdParticipant : process.getGuidingsSet()) {
            if (!phdParticipant.isInternal()) {
                if (countExternalGuidings > 0) {
                    externalGuidingNames.append(";");
                }
                externalGuidingNames.append(((ExternalPhdParticipant) phdParticipant).getName());
                externalGuidingNames.append(" (");
                externalGuidingNames.append(((ExternalPhdParticipant) phdParticipant).getInstitution());
                externalGuidingNames.append(")");
                countExternalGuidings++;
            }
        }
        row.setCell(externalGuidingNames.toString());

        // Nome do Co-Orientador Externo
        int countExternalAssistantGuidings = 0;
        StringBuilder externalAssistantGuidingNames = new StringBuilder();
        for (PhdParticipant phdParticipant : process.getAssistantGuidingsSet()) {
            if (!phdParticipant.isInternal()) {
                if (countExternalAssistantGuidings > 0) {
                    externalAssistantGuidingNames.append(";");
                }
                externalAssistantGuidingNames.append(((ExternalPhdParticipant) phdParticipant).getName());
                externalAssistantGuidingNames.append(" (");
                externalAssistantGuidingNames.append(((ExternalPhdParticipant) phdParticipant).getInstitution());
                externalAssistantGuidingNames.append(")");
                countExternalAssistantGuidings++;
            }
        }
        row.setCell(externalAssistantGuidingNames.toString());

        PhdProgramProcessState lastActiveState = process.getMostRecentState();
        row.setCell(lastActiveState != null ? lastActiveState.getType().getLocalizedName() : "n/a");

        if (process.getCollaborationType() != null) {
            row.setCell(process.getCollaborationType().getLocalizedName());
        } else {
            row.setCell("n/a");
        }

        if (process.getCandidacyDate() != null) {
            row.setCell(process.getCandidacyDate().toString("dd/MM/yyyy"));
        } else {
            row.setCell("n/a");
        }

        if (process.getCandidacyProcess().getWhenRatified() != null) {
            row.setCell(process.getCandidacyDate().toString("dd/MM/yyyy"));
        } else {
            row.setCell("n/a");
        }

        if (process.getWhenStartedStudies() != null) {
            row.setCell(process.getWhenStartedStudies().toString("dd/MM/yyyy"));
        } else {
            row.setCell("n/a");
        }

        if (process.getThesisProcess() != null && process.getThesisProcess().getDiscussionDate() != null) {
            row.setCell(process.getThesisProcess().getDiscussionDate().toString("dd/MM/yyyy"));
        } else {
            row.setCell("n/a");
        }

        // Tipo de Acordo (AFA, AM, ERASMUS, etc)
        row.setCell(registration != null ? registration.getRegistrationProtocol() != null ? registration
                .getRegistrationProtocol().getCode() : "" : "");

        // Data de Apresentação Pública da CAT
        if (process.getSeminarProcess() != null && process.getSeminarProcess().getPresentationDate() != null) {
            row.setCell(process.getSeminarProcess().getPresentationDate().toString("dd/MM/yyyy"));
        } else {
            row.setCell("n/a");
        }
    }
View Full Code Here

TOP

Related Classes of pt.utl.ist.fenix.tools.util.excel.Spreadsheet.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.