Package org.fenixedu.academic.domain.candidacyProcess.erasmus

Examples of org.fenixedu.academic.domain.candidacyProcess.erasmus.ErasmusVacancyBean


        }

        @Override
        protected MobilityApplicationProcess executeActivity(MobilityApplicationProcess process, User userView, Object object) {
            ErasmusVacancyBean bean = (ErasmusVacancyBean) object;

            for (Degree degree : bean.getDegrees()) {
                MobilityQuota.createVacancy(process.getCandidacyPeriod(), degree, bean.getMobilityProgram(),
                        bean.getUniversity(), bean.getNumberOfVacancies());
            }

            return process;
        }
View Full Code Here


            }
        }

        @Override
        protected MobilityApplicationProcess executeActivity(MobilityApplicationProcess process, User userView, Object object) {
            ErasmusVacancyBean bean = (ErasmusVacancyBean) object;
            MobilityQuota quota = bean.getQuota();

            if (quota.isQuotaAssociatedWithAnyApplication()) {
                throw new DomainException("error.mobility.quota.is.associated.with.applications");
            }
View Full Code Here

            return new DomainObjectKeyConverter();
        }

        @Override
        public Object provide(Object source, Object currentValue) {
            ErasmusVacancyBean bean = (ErasmusVacancyBean) source;

            CountryUnit selectedCountryUnit = CountryUnit.getCountryUnitByCountry(bean.getCountry());

            if (selectedCountryUnit == null) {
                return new ArrayList<Unit>();
            }
View Full Code Here

        return prepareExecuteViewMobilityQuota(mapping, form, request, response, null);
    }

    public ActionForward prepareExecuteViewMobilityQuota(final ActionMapping mapping, final ActionForm form,
            final HttpServletRequest request, final HttpServletResponse response, final MobilityProgram program) {
        ErasmusVacancyBean erasmusVacancyBean = new ErasmusVacancyBean(program);
        request.setAttribute("erasmusVacancyBean", erasmusVacancyBean);

        MobilityApplicationProcess process = getProcess(request);

        if (erasmusVacancyBean.getMobilityProgram() != null) {
            List<MobilityQuota> mobilityQuotasByProgram =
                    process.getApplicationPeriod().getMobilityQuotasByProgram(erasmusVacancyBean.getMobilityProgram());
            request.setAttribute("quotas", mobilityQuotasByProgram);
        }

        return mapping.findForward("view-university-agreements");
    }
View Full Code Here

        return mapping.findForward("view-university-agreements");
    }

    public ActionForward selectMobilityQuotaForQuotasManagementPostback(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) {
        ErasmusVacancyBean erasmusVacancyBean = getErasmusVacancyBean();

        request.setAttribute("erasmusVacancyBean", erasmusVacancyBean);

        MobilityApplicationProcess process = getProcess(request);

        if (erasmusVacancyBean.getMobilityProgram() != null) {
            List<MobilityQuota> mobilityQuotasByProgram =
                    process.getApplicationPeriod().getMobilityQuotasByProgram(erasmusVacancyBean.getMobilityProgram());
            request.setAttribute("quotas", mobilityQuotasByProgram);
        }

        return mapping.findForward("view-university-agreements");
    }
View Full Code Here

    public ActionForward prepareExecuteInsertMobilityQuota(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        MobilityProgram program = getDomainObject(request, "mobilityProgramId");

        request.setAttribute("erasmusVacancyBean", new ErasmusVacancyBean(program));

        return mapping.findForward("insert-university-agreement");
    }
View Full Code Here

    }

    public ActionForward executeInsertMobilityQuota(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {
        MobilityApplicationProcess process = getProcess(request);
        ErasmusVacancyBean bean = getErasmusVacancyBean();

        for (Degree degree : bean.getDegrees()) {
            if (process.getCandidacyPeriod().existsFor(bean.getMobilityAgreement(), degree)) {
                addActionMessage(request, "error.erasmus.insert.vacancy.already.exists");
                return mapping.findForward("insert-university-agreement");
            }
        }

        executeActivity(getProcess(request), "InsertMobilityQuota", bean);

        return prepareExecuteViewMobilityQuota(mapping, form, request, response, bean.getMobilityProgram());
    }
View Full Code Here

        return prepareExecuteViewMobilityQuota(mapping, form, request, response, bean.getMobilityProgram());
    }

    public ActionForward selectCountryForVacancyInsertion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        ErasmusVacancyBean bean = getErasmusVacancyBean();

        RenderUtils.invalidateViewState();

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

        if (!quota.getApplicationsSet().isEmpty()) {
            addActionMessage(request, "error.erasmus.vacancy.has.associated.candidacies");
            return prepareExecuteViewMobilityQuota(mapping, form, request, response);
        }

        executeActivity(getProcess(request), "RemoveMobilityQuota", new ErasmusVacancyBean(quota));

        return prepareExecuteViewMobilityQuota(mapping, form, request, response);
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.candidacyProcess.erasmus.ErasmusVacancyBean

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.