Package org.fenixedu.academic.dto.person

Examples of org.fenixedu.academic.dto.person.PersonBean


                if (showSimilarPersons(choosePersonBean, persons)) {
                    RenderUtils.invalidateViewState();
                    return mapping.findForward("searchPerson");
                }
            }
            bean.setPersonBean(new PersonBean(choosePersonBean.getName(), choosePersonBean.getIdentificationNumber(),
                    choosePersonBean.getDocumentType(), choosePersonBean.getDateOfBirth()));

            return mapping.findForward("createCandidacy");

        } else {
            bean.setPersonBean(new PersonBean(bean.getChoosePersonBean().getPerson()));
            return mapping.findForward("createCandidacy");
        }

    }
View Full Code Here


    // Edit Personal Information
    public ActionForward prepareEditPersonalInformation(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        Person person = getProcess(request).getPerson();
        final PersonBean personBean = new PersonBean(person);

        /* TODO: UGLY HACK DUE TO PENDING VALIDATION DATA FOR PERSON */
        initPersonBeanUglyHack(personBean, person);

        request.setAttribute("editPersonalInformationBean", personBean);
View Full Code Here

    protected ActionForward checkPersonalData(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();

        final PersonBean personBean = bean.getPersonBean();

        // First case : get persons by document id value (not type)
        final Collection<Person> personsFoundByDocumentId = Person.readByDocumentIdNumber(personBean.getDocumentIdNumber());

        if (personsFoundByDocumentId.size() > 1) {
            // There's more than one person, throw an error
            addErrorMessage(request, "error.phd.public.candidacy.fill.personal.information.and.institution.id.more.than.one");
            return fillPersonalDataInvalid(mapping, form, request, response);
        }

        final Person person = !personsFoundByDocumentId.isEmpty() ? personsFoundByDocumentId.iterator().next() : null;

        if (!StringUtils.isEmpty(personBean.getFiscalCode())) {
            final Party partyFoundBySocialSecurityNumber =
                    PartySocialSecurityNumber.readPartyBySocialSecurityNumber(personBean.getFiscalCode());

            // Second case : person found by documentId and person found by
            // social
            // security number must be equal
            if (person != null || partyFoundBySocialSecurityNumber != null) {
                if (person != partyFoundBySocialSecurityNumber) {
                    addErrorMessage(request,
                            "error.phd.public.candidacy.fill.personal.information.and.institution.id.different.ssn");
                    return fillPersonalDataInvalid(mapping, form, request, response);
                }
            }
        }

        if (bean.hasInstitutionId()) {
            Person personByIstId = Person.readPersonByUsername(bean.getInstitutionId());

            if (personByIstId == null) {
                addErrorMessage(request, "error.phd.public.candidacy.fill.personal.information.and.institution.id.noIstIdPerson");
                return fillPersonalDataInvalid(mapping, form, request, response);
            }

            if (person != null && person != personByIstId) {
                addErrorMessage(request,
                        "error.phd.public.candidacy.fill.personal.information.and.institution.id.different.istId");
                return fillPersonalDataInvalid(mapping, form, request, response);
            }
        }

        // check if person already exists
        if (person != null) {
            // Exists
            // Third case person exists so the birth date must be equal and also
            // ist Id if it has

            if (person.getDateOfBirthYearMonthDay().equals(personBean.getDateOfBirth())) {
                if (person.getUsername() != null && person.getUsername().equals(bean.getInstitutionId())) {
                    personBean.setPerson(person);
                } else if (person.getUsername() == null && !bean.hasInstitutionId()) {
                    personBean.setPerson(person);
                } else {
                    addErrorMessage(request,
                            "error.phd.public.candidacy.fill.personal.information.and.institution.id.different.istIds");
                    return fillPersonalDataInvalid(mapping, form, request, response);
                }
View Full Code Here

        request.setAttribute("executionDegreeBean", executionDegreeBean);
        request.setAttribute("ingressionInformationBean", ingressionInformationBean);
        request.setAttribute("precedentDegreeInformationBean", precedentDegreeInformationBean);

        PersonBean personBean = null;
        Person person = null;

        if (RenderUtils.getViewState("person") != null) { // Postback
            request.setAttribute("personBean", RenderUtils.getViewState("person").getMetaObject().getObject());
            return mapping.findForward("fillNewPersonData");
        }

        ChoosePersonBean choosePersonBean =
                (ChoosePersonBean) RenderUtils.getViewState("choosePerson").getMetaObject().getObject();

        final String identificationNumber = choosePersonBean.getIdentificationNumber();
        final YearMonthDay dateOfBirth = choosePersonBean.getDateOfBirth();

        if (choosePersonBean.getPerson() == null) {

            Collection<Person> persons = Person.findPersonByDocumentID(identificationNumber);

            if (choosePersonBean.isFirstTimeSearch()) {
                choosePersonBean.setFirstTimeSearch(false);
                if (!persons.isEmpty()
                        || !Person.findByDateOfBirth(dateOfBirth,
                                Person.findPersonMatchingFirstAndLastName(choosePersonBean.getName())).isEmpty()
                        || (choosePersonBean.getStudentNumber() != null && Student.readStudentByNumber(choosePersonBean
                                .getStudentNumber()) != null)) {
                    // show similar persons
                    RenderUtils.invalidateViewState();
                    request.setAttribute("choosePersonBean", choosePersonBean);
                    return mapping.findForward("chooseNewStudentExecutionDegreeAndIdentification");
                }
            }

        } else {
            person = choosePersonBean.getPerson();
        }

        if (!checkIngression(request, executionDegreeBean, ingressionInformationBean, person, choosePersonBean)) {
            return mapping.findForward("chooseNewStudentExecutionDegreeAndIdentification");
        }

        if (person != null) {
            personBean = new PersonBean(person);

            personBean.setStudentNumber(person.getStudent() != null ? person.getStudent().getNumber() : choosePersonBean
                    .getStudentNumber());
        } else {
            personBean =
                    new PersonBean(choosePersonBean.getName(), identificationNumber, choosePersonBean.getDocumentType(),
                            dateOfBirth, choosePersonBean.getStudentNumber());
        }

        request.setAttribute("personBean", personBean);
        return mapping.findForward("fillNewPersonData");
View Full Code Here

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

        request.setAttribute("executionDegreeBean", getRenderedObject("executionDegree"));
        request.setAttribute("ingressionInformationBean", getRenderedObject("chooseIngression"));
        PersonBean personBean = getRenderedObject("person");
        request.setAttribute("personBean", personBean);
        request.setAttribute("precedentDegreeInformationBean", getRenderedObject("precedentDegreeInformation"));
        request.setAttribute("originInformationBean", getRenderedObject("originInformation"));

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

            SecondCycleIndividualCandidacyProcessBean newBean = new SecondCycleIndividualCandidacyProcessBean(process);
            newBean.setCandidacyProcess(destinationCandidacyProcess);
            newBean.setPublicCandidacyHashCode(DegreeOfficePublicCandidacyHashCode.getUnusedOrCreateNewHashCode(
                    SecondCycleIndividualCandidacyProcess.class, destinationCandidacyProcess, process.getCandidacyHashCode()
                            .getEmail()));
            newBean.setPersonBean(new PersonBean(process.getPersonalDetails()));
            newBean.setCandidacyDate(destinationCandidacyProcess.getCandidacyPeriod().getStart().toLocalDate());
            newBean.initializeDocumentUploadBeans();

            SecondCycleIndividualCandidacyProcess newProcess =
                    createNewProcess(userView, SecondCycleIndividualCandidacyProcess.class, newBean);
View Full Code Here

        }

        final PhdProgramCandidacyProcessBean bean = new PhdProgramCandidacyProcessBean();
        PhdCandidacyPeriod phdCandidacyPeriod = getPhdCandidacyPeriod(hashCode);

        bean.setPersonBean(new PersonBean());
        bean.getPersonBean().setEmail(hashCode.getEmail());
        bean.setCandidacyHashCode(hashCode);
        bean.setExecutionYear(phdCandidacyPeriod.getExecutionInterval());
        bean.setState(PhdProgramCandidacyProcessState.PRE_CANDIDATE);
        bean.setMigratedProcess(Boolean.FALSE);
View Full Code Here

        request.setAttribute("process", individualProgramProcess.getCandidacyProcess());

        canEditCandidacy(request, hashCode);
        canEditPersonalInformation(request, hashCode.getPerson());

        PersonBean personBean = new PersonBean(individualProgramProcess.getPerson());
        initPersonBeanUglyHack(personBean, individualProgramProcess.getPerson());
        request.setAttribute("personBean", personBean);

        validateProcess(request, individualProgramProcess);
View Full Code Here

    public ActionForward prepareEditPersonalData(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PhdProgramCandidacyProcess process = getProcess(request);
        final PhdProgramCandidacyProcessBean bean = new PhdProgramCandidacyProcessBean(process);
        Person person = process.getPerson();
        PersonBean personBean = new PersonBean(person);
        bean.setPersonBean(personBean);

        /* TODO: UGLY HACK DUE TO PENDING VALIDATION DATA FOR PERSON */
        initPersonBeanUglyHack(personBean, person);

View Full Code Here

                if (showSimilarPersons(choosePersonBean, persons)) {
                    RenderUtils.invalidateViewState();
                    return mapping.findForward("prepare-create-new-process");
                }
            }
            bean.setPersonBean(new PersonBean(choosePersonBean.getName(), choosePersonBean.getIdentificationNumber(),
                    choosePersonBean.getDocumentType(), choosePersonBean.getDateOfBirth()));

            // bean.getPersonBean().setAddress("Some address");
            // bean.getPersonBean().setArea("Some area");
            // bean.getPersonBean().setAreaOfAreaCode("2345-2341");
            // //bean.getPersonBean().setCountryOfBirth(Country.readByTwoLetterCode("AF"));
            // bean.getPersonBean().setCountryOfResidence(Country.readByTwoLetterCode("PT"));
            // bean.getPersonBean().setDistrictOfBirth("Some district of birth");
            // bean.getPersonBean().setDistrictOfResidence("Some district of residence");
            // bean.getPersonBean().setDistrictSubdivisionOfBirth("district subdivision of birth");
            // bean.getPersonBean().setDistrictSubdivisionOfResidence("district subdivision of residence");
            // bean.getPersonBean().setGender(Gender.MALE);
            // bean.getPersonBean().setPhone("12313234132");
            // bean.getPersonBean().setNationality(Country.readByTwoLetterCode("AF"));
            // bean.getPersonBean().setAreaCode("1223-123");

            return mapping.findForward("fill-personal-information");

        } else {
            bean.setPersonBean(new PersonBean(bean.getChoosePersonBean().getPerson()));

            // bean.getPersonBean().setAddress("Some address");
            // bean.getPersonBean().setArea("Some area");
            // bean.getPersonBean().setAreaOfAreaCode("2345-2341");
            // bean.getPersonBean().setCountryOfBirth(Country.readByTwoLetterCode("AF"));
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.person.PersonBean

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.