Package org.fenixedu.academic.domain.candidacy

Examples of org.fenixedu.academic.domain.candidacy.PersonalInformationBean


    }

    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;
View Full Code Here


        final Row row = sheet.addRow();
        final Person graduate = registration.getPerson();
        //List<Registration> registrationPath = getFullRegistrationPath(registration);
        Registration sourceRegistration = registrationPath.iterator().next();
        final PersonalInformationBean personalInformationBean = registration.getPersonalInformationBean(executionYear);
        StudentCurricularPlan lastStudentCurricularPlan = registration.getLastStudentCurricularPlan();

        // Ciclo
        row.setCell(cycleType.getDescription());

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

        // Média do Ciclo
        if (graduation) {
            row.setCell(concluded ? printBigDecimal(average.setScale(0, BigDecimal.ROUND_HALF_EVEN)) : printBigDecimal(average));
        } else {
            row.setCell(concluded ? lastStudentCurricularPlan.getCycle(cycleType).getCurriculum().getAverage().toPlainString() : "n/a");
        }

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

        // Data de Início
        row.setCell(registration.getStartDate() != null ? registration.getStartDate().toString("dd-MM-yyyy") : "");

        // Nº de aluno
        row.setCell(registration.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.getName());

        // 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");

        // Tipo Curso
        row.setCell(registration.getDegreeType().getLocalizedName());

        // Nome Curso
        row.setCell(registration.getDegree().getNameI18N().getContent());

        // Sigla Curso
        row.setCell(registration.getDegree().getSigla());

        // Ramos do currículo do aluno
        final StringBuilder majorBranches = new StringBuilder();
        final StringBuilder minorBranches = new StringBuilder();
        for (final BranchCurriculumGroup group : lastStudentCurricularPlan.getBranchCurriculumGroups()) {
            if (group.isMajor()) {
                majorBranches.append(group.getName().toString()).append(",");
            } else if (group.isMinor()) {
                minorBranches.append(group.getName().toString()).append(",");
            }
        }

        // Ramo Principal
        if (majorBranches.length() > 0) {
            row.setCell(majorBranches.deleteCharAt(majorBranches.length() - 1).toString());
        } else {
            row.setCell("");
        }

        // Ramo Secundáro
        if (minorBranches.length() > 0) {
            row.setCell(minorBranches.deleteCharAt(minorBranches.length() - 1).toString());
        } else {
            row.setCell("");
        }

        // Ano Curricular
        row.setCell(registration.getCurricularYear(executionYear));

        // Ano de Ingresso no Curso Actual
        row.setCell(sourceRegistration.getStartExecutionYear().getName());

        // Nº de anos lectivos de inscrição no Curso actual
        int numberOfEnrolmentYears = 0;
        for (Registration current : registrationPath) {
            numberOfEnrolmentYears += current.getNumberOfYearsEnrolledUntil(executionYear);
        }
        row.setCell(numberOfEnrolmentYears);

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

        // Regime de frequência curso: Tempo integral/Tempo Parcial
        row.setCell(registration.getRegimeType(executionYear) != null ? registration.getRegimeType(executionYear).getName() : "");

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

        // Regime de Ingresso no Curso Actual (código)
        Ingression ingression = sourceRegistration.getIngression();
        if (ingression == null && sourceRegistration.getStudentCandidacy() != null) {
            ingression = sourceRegistration.getStudentCandidacy().getIngression();
        }
        row.setCell(ingression != null ? ingression.getName() : "");

        // Regime de Ingresso no Curso Actual (designação)
        row.setCell(ingression != null ? ingression.getFullDescription() : "");

        // estabelecimento do grau preced.: Instituição onde esteve
        // inscrito mas não obteve grau, (e.g: transferencias, mudanças de
        // curso...)
        row.setCell(personalInformationBean.getPrecedentInstitution() != null ? personalInformationBean.getPrecedentInstitution()
                .getName() : "");
        // curso grau preced.
        row.setCell(personalInformationBean.getPrecedentDegreeDesignation() != null ? personalInformationBean
                .getPrecedentDegreeDesignation() : "");

        // estabelec. 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.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());

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

        // Nota de Ingresso
        Double entryGrade = null;
        if (registration.getStudentCandidacy() != null) {
            entryGrade = registration.getStudentCandidacy().getEntryGrade();
        }

        row.setCell(printDouble(entryGrade));

        // Opção de Ingresso
        Integer placingOption = null;
        if (registration.getStudentCandidacy() != null) {
            placingOption = registration.getStudentCandidacy().getPlacingOption();
        }

        row.setCell(placingOption);

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

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

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

        // Concelho de Residência Permanente
        if (personalInformationBean.getDistrictSubdivisionOfResidence() != null) {
            row.setCell(personalInformationBean.getDistrictSubdivisionOfResidence().getName());
        } else {
            row.setCell(registration.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("");
        }

        // Estatuto de Trabalhador Estudante 1º semestre do ano a que se
        // referem
        // os dados
        boolean working1Found = false;
        for (StudentStatute statute : registration.getStudent().getStudentStatutesSet()) {
            if (statute.getStatuteType() == StudentStatuteType.WORKING_STUDENT
                    && statute.isValidInExecutionPeriod(executionYear.getFirstExecutionPeriod())) {
                working1Found = true;
                break;
            }
        }
        row.setCell(String.valueOf(working1Found));

        // Estatuto de Trabalhador Estudante 1º semestre do ano a que se
        // referem
        // os dados
        boolean working2Found = false;
        for (StudentStatute statute : registration.getStudent().getStudentStatutesSet()) {
            if (statute.getStatuteType() == StudentStatuteType.WORKING_STUDENT
                    && statute.isValidInExecutionPeriod(executionYear.getLastExecutionPeriod())) {
                working2Found = true;
                break;
            }
        }
        row.setCell(String.valueOf(working2Found));

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

        // Instituição que atribuiu a bolsa
        if (personalInformationBean.getGrantOwnerType() != null
                && personalInformationBean.getGrantOwnerType().equals(GrantOwnerType.OTHER_INSTITUTION_GRANT_OWNER)) {
            row.setCell(personalInformationBean.getGrantOwnerProviderName());
        } else {
            row.setCell("");
        }

        // Bolseiro (info. oficial)
        boolean sasFound = false;
        for (StudentStatute statute : registration.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() : "");

        // Outro Grau Precedente
        row.setCell(personalInformationBean.getOtherPrecedentSchoolLevel());

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

        // Codigo do grau habl anterior
        DegreeDesignation designation =
                DegreeDesignation.readByNameAndSchoolLevel(personalInformationBean.getDegreeDesignation(),
                        personalInformationBean.getPrecedentSchoolLevel());
        row.setCell(designation != null ? designation.getDegreeClassification().getCode() : "");

        // Outro grau da habl anterior compl
        row.setCell(personalInformationBean.getOtherSchoolLevel());

        // País de Habilitação Anterior ao Curso Actual
        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
        row.setCell(personalInformationBean.getConclusionYear());

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

        MobilityAgreement mobilityAgreement = null;
        ExecutionInterval chosenCandidacyInterval = null;
        //getting the last mobility program done
        for (OutboundMobilityCandidacySubmission outboundCandidacySubmission : registration
                .getOutboundMobilityCandidacySubmissionSet()) {
            if (outboundCandidacySubmission.getSelectedCandidacy() != null
                    && outboundCandidacySubmission.getSelectedCandidacy().getSelected()) {
                ExecutionInterval candidacyInterval =
                        outboundCandidacySubmission.getOutboundMobilityCandidacyPeriod().getExecutionInterval();
                //the candidacies are made in the previous year
                if (candidacyInterval.getAcademicInterval().isBefore(executionYear.getAcademicInterval())) {
                    if (mobilityAgreement != null) {
                        if (!candidacyInterval.getAcademicInterval().isAfter(chosenCandidacyInterval.getAcademicInterval())) {
                            continue;
                        }
                    }
                    mobilityAgreement =
                            outboundCandidacySubmission.getSelectedCandidacy().getOutboundMobilityCandidacyContest()
                                    .getMobilityAgreement();
                    chosenCandidacyInterval = candidacyInterval;
                }
            }
        }
        // Programa de mobilidade
        row.setCell(mobilityAgreement != null ? mobilityAgreement.getMobilityProgram().getName().getContent() : "");

        // País de mobilidade
        row.setCell(mobilityAgreement != null ? mobilityAgreement.getUniversityUnit().getCountry().getName() : "");

        // 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("");
        }

        int totalEnrolmentsInPreviousYear = 0;
View Full Code Here

    public ActionForward prepareEditPostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        request.setAttribute("personalInformationsWithMissingInformation", getPersonalInformationsWithMissingInfo());
        PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        personalInformationBean.resetInstitutionAndDegree();
        request.setAttribute("personalInformationBean", personalInformationBean);
        RenderUtils.invalidateViewState();

        return mapping.findForward("editMissingPersonalInformation");
    }
View Full Code Here

    public ActionForward prepareEditInstitutionPostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        request.setAttribute("personalInformationsWithMissingInformation", getPersonalInformationsWithMissingInfo());
        PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        personalInformationBean.resetDegree();
        request.setAttribute("personalInformationBean", personalInformationBean);
        RenderUtils.invalidateViewState();

        return mapping.findForward("editMissingPersonalInformation");
    }
View Full Code Here

        return mapping.findForward("editMissingPersonalInformation");
    }

    public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {

        final PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");

        final Set<String> messages = personalInformationBean.validate();

        if (!messages.isEmpty()) {
            for (final String each : messages) {
                addActionMessage(request, each);
            }
            return prepareEditInvalid(mapping, form, request, response);
        }

        try {
            personalInformationBean.updatePersonalInformation(true);
        } catch (DomainException e) {
            addActionMessage(request, e.getKey(), e.getArgs());
            return prepareEditInvalid(mapping, form, request, response);
        }

        if (personalInformationBean.getStudent().hasAnyMissingPersonalInformation()) {
            RenderUtils.invalidateViewState();
            return prepareEdit(mapping, form, request, response);
        }

        final ActionForward forward = new ActionForward();
View Full Code Here

        @Forward(name = "visualizeStudent", path = "/academicAdministration/student.do?method=visualizeStudent") })
public class EditCandidacyInformationDA extends FenixDispatchAction {

    public ActionForward prepareEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        PersonalInformationBean currentPersonalInformationBean = getPersonalInformationBean(request);
        if (currentPersonalInformationBean == null) {
            return mapping.findForward("visualizeStudent");
        }
        request.setAttribute("personalInformationBean", currentPersonalInformationBean);
View Full Code Here

        }
    }

    public ActionForward prepareEditInvalid(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        request.setAttribute("personalInformationBean", personalInformationBean);

        return mapping.findForward("editCandidacyInformation");
    }
View Full Code Here

    }

    public ActionForward prepareEditInstitutionPostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        personalInformationBean.resetDegree();
        RenderUtils.invalidateViewState();
        request.setAttribute("personalInformationBean", personalInformationBean);

        return mapping.findForward("editCandidacyInformation");
    }
View Full Code Here

        return mapping.findForward("editCandidacyInformation");
    }

    public ActionForward schoolLevelPostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        RenderUtils.invalidateViewState("personalInformationBean.editPrecedentDegreeInformation");
        RenderUtils.invalidateViewState("personalInformationBean.editPersonalInformation");
        personalInformationBean.resetInstitutionAndDegree();
        request.setAttribute("personalInformationBean", personalInformationBean);

        return mapping.findForward("editCandidacyInformation");
    }
View Full Code Here

        return mapping.findForward("editCandidacyInformation");
    }

    public ActionForward changePostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PersonalInformationBean personalInformationBean = getRenderedObject("personalInformationBean");
        RenderUtils.invalidateViewState("personalInformationBean.editPrecedentDegreeInformation");
        request.setAttribute("personalInformationBean", personalInformationBean);

        return mapping.findForward("editCandidacyInformation");
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.candidacy.PersonalInformationBean

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.