Examples of PersonBean


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

        request.setAttribute("candidacyBean", bean);
        request.setAttribute("individualProgramProcess", phdProcess);
        canEditCandidacy(request, bean.getCandidacyHashCode());
        canEditPersonalInformation(request, hashCode.getPerson());

        PersonBean personBean = new PersonBean(phdProcess.getPerson());
        initPersonBean(personBean, phdProcess.getPerson());
        request.setAttribute("personBean", personBean);

        request.setAttribute("candidacyPeriod", getPhdCandidacyPeriod(hashCode));
        validateProcess(request, hashCode.getIndividualProgramProcess());
View Full Code Here

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

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();
        final Person person = individualProgramProcess.getPerson();

        canEditPersonalInformation(request, person);
        bean.setPersonBean(new PersonBean(person));

        /* TODO: UGLY HACK DUE TO PENDING VALIDATION DATA FOR PERSON */
        initPersonBean(bean.getPersonBean(), person);

        request.setAttribute("candidacyBean", bean);
View Full Code Here

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

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();
        final Person person = individualProgramProcess.getPerson();
        canEditPersonalInformation(request, person);

        PersonBean personBean = bean.getPersonBean();
        final String familyName = personBean.getFamilyNames();
        final String composedName =
                familyName == null || familyName.isEmpty() ? personBean.getGivenNames() : personBean.getGivenNames() + " "
                        + familyName;
        personBean.setName(composedName);

        try {
            ExecuteProcessActivity.run(individualProgramProcess, EditPersonalInformation.class, bean.getPersonBean());
        } catch (final DomainException e) {
            addErrorMessage(request, e.getKey(), e.getArgs());
View Full Code Here

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

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

        final PhdProgramCandidacyProcessBean bean = new PhdProgramCandidacyProcessBean();
        bean.setState(PhdProgramCandidacyProcessState.STAND_BY_WITH_MISSING_INFORMATION);
        bean.setPersonBean(new PersonBean());
        bean.setChoosePersonBean(new ChoosePersonBean());

        request.setAttribute("createCandidacyBean", bean);
        request.setAttribute("persons", Collections.emptyList());
View Full Code Here

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

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

    // 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

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

    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

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

        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

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

    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

Examples of org.springframework.ui.jasperreports.PersonBean

  }

  protected List getData() {
    List list = new ArrayList();
    for (int x = 0; x < 10; x++) {
      PersonBean bean = new PersonBean();
      bean.setId(x);
      bean.setName("Rob Harrop");
      bean.setStreet("foo");
      list.add(bean);
    }
    return list;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.