Examples of PhdProgramCandidacyProcessBean


Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward addGuidingToExistingCandidacy(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();

        try {
            PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();
            ExecuteProcessActivity.run(individualProgramProcess, AddGuidingsInformation.class, bean.getGuidings());
            addSuccessMessage(request, "message.guiding.created.with.success");

        } catch (final DomainException e) {
            addErrorMessage(request, e.getKey(), e.getArgs());
            return editCandidacyGuidingsInvalid(mapping, actionForm, request, response);
        }

        bean.setGuidings(null);
        return prepareEditCandidacyGuidings(mapping, actionForm, request, response);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    public ActionForward removeGuidingFromExistingCandidacy(ActionMapping mapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) {

        final String externalId = (String) getFromRequest(request, "removeIndex");
        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdParticipant guiding = getGuiding(bean.getCandidacyHashCode().getIndividualProgramProcess(), externalId);

        try {
            PhdIndividualProgramProcess individualProgramProcess =
                    getCandidacyBean().getCandidacyHashCode().getIndividualProgramProcess();
            ExecuteProcessActivity.run(individualProgramProcess, DeleteGuiding.class, guiding);
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward sendCandidacyRefereeEmail(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdCandidacyReferee referee = getReferee(bean.getCandidacyHashCode().getIndividualProgramProcess(), request);
        referee.sendEmail();
        addSuccessMessage(request, "message.candidacy.referee.email.sent.with.success", referee.getName());

        return prepareEditCandidacyReferees(mapping, actionForm, request, response);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward removeQualificationFromExistingCandidacy(ActionMapping mapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();

        final String externalId = (String) getFromRequest(request, "removeIndex");
        PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();

        final Qualification qualification = getQualification(individualProgramProcess, externalId);

        try {
            ExecuteProcessActivity.run(individualProgramProcess, DeleteQualification.class, qualification);
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward uploadPhoto(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws IOException {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhotographUploadBean photo = getRenderedObject("uploadPhotoBean");

        if (!RenderUtils.getViewState("uploadPhotoBean").isValid()) {
            addErrorMessage(request, "error.photo.upload.invalid.information");
            return uploadPhotoInvalid(mapping, actionForm, request, response);
        }

        if (ContentType.getContentType(photo.getContentType()) == null) {
            addErrorMessage(request, "error.photo.upload.unsupported.file");
            return uploadPhotoInvalid(mapping, actionForm, request, response);
        }

        try {
            photo.processImage();
            UploadOwnPhoto.upload(photo, bean.getCandidacyHashCode().getPerson());

        } catch (final UnableToProcessTheImage e) {
            addErrorMessage(request, "error.photo.upload.unable.to.process.image");
            photo.deleteTemporaryFiles();
            return uploadPhotoInvalid(mapping, actionForm, request, response);

        } catch (final DomainException e) {
            addErrorMessage(request, e.getKey(), e.getArgs());
            photo.deleteTemporaryFiles();
            return uploadPhotoInvalid(mapping, actionForm, request, response);
        }

        return viewCandidacy(mapping, request, bean.getCandidacyHashCode());
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward prepareValidateCandidacy(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        validateProcess(request, bean.getCandidacyHashCode().getIndividualProgramProcess());
        request.setAttribute("candidacyBean", bean);

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

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    }

    public ActionForward validateCandidacy(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdIndividualProgramProcess process = bean.getCandidacyHashCode().getIndividualProgramProcess();

        if (!validateProcess(request, process)) {
            request.setAttribute("candidacyBean", bean);
            return mapping.findForward("validateCandidacy");
        }

        try {
            ExecuteProcessActivity.run(process, ValidatedByCandidate.class, null);
            addSuccessMessage(request, "message.validation.with.success");

        } catch (final DomainException e) {
            addErrorMessage(request, e.getKey(), e.getArgs());
            return prepareValidateCandidacy(mapping, actionForm, request, response);
        }

        return viewCandidacy(mapping, request, bean.getCandidacyHashCode());
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

            HttpServletResponse response) throws Exception {
        request.setAttribute("sibsEntityCode", SIBS_ENTITY_CODE);

        request.setAttribute("dont-cache-pages-in-search-engines", Boolean.TRUE);

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        if (bean != null && bean.hasCandidacyHashCode()) {
            canEditCandidacy(request, bean.getCandidacyHashCode());
        }

        ActionForward forward = filterDispatchMethod(bean, mapping, actionForm, request, response);

        if (forward != null) {
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    public abstract ActionForward fillPersonalDataInvalid(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response);

    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);
                }
            } else {
                addErrorMessage(request,
                        "error.phd.public.candidacy.fill.personal.information.and.institution.id.different.birthday");
                return fillPersonalDataInvalid(mapping, form, request, response);
            }

            // Check if person has an application for this period
            if (PhdProgramCandidacyProcess.hasOnlineApplicationForPeriod(person, bean.getPhdCandidacyPeriod())) {
                addErrorMessage(request,
                        "error.phd.public.candidacy.fill.personal.information.and.institution.alreadyHasApplication");
                return fillPersonalDataInvalid(mapping, form, request, response);
            }
        }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.candidacy.PhdProgramCandidacyProcessBean

    @Override
    public Object provide(Object source, Object currentValue) {

        if (source instanceof PhdProgramCandidacyProcessBean) {
            PhdProgramCandidacyProcessBean bean = (PhdProgramCandidacyProcessBean) source;
            if (bean.getFocusArea() == null) {
                return Collections.EMPTY_LIST;
            }

            return bean.getFocusArea().getAssociatedExternalPhdProgramsForCollaborationType(bean.getCollaborationType());
        }

        if (source instanceof PhdIndividualProgramProcessBean) {
            PhdIndividualProgramProcessBean bean = (PhdIndividualProgramProcessBean) source;

            if (bean.getFocusArea() == null) {
                return Collections.EMPTY_LIST;
            }

            return bean.getFocusArea().getAssociatedExternalPhdProgramsForCollaborationType(bean.getCollaborationType());
        }

        return null;
    }
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.