Package org.fenixedu.academic.domain.exceptions

Examples of org.fenixedu.academic.domain.exceptions.DomainException


                new Student(process.getPersonalDetails().getPerson(), null);
                RoleType.grant(RoleType.PERSON, process.getPersonalDetails().getPerson().getUser());
                RoleType.grant(RoleType.CANDIDATE, process.getPersonalDetails().getPerson().getUser());

                if (StringUtils.isEmpty(process.getPersonalDetails().getPerson().getUsername())) {
                    throw new DomainException("error.erasmus.create.user", new String[] { null, "User not created" });
                }

            }

            return process;
View Full Code Here


        protected MobilityIndividualApplicationProcess executeActivity(MobilityIndividualApplicationProcess process,
                User userView, Object object) {
            String eidentifier = (String) object;

            if (StringUtils.isEmpty(eidentifier)) {
                throw new DomainException("error.erasmus.candidacy.eidentifer.must.not.be.empty");
            }

            MobilityApplicationProcess parentProcess = (MobilityApplicationProcess) process.getCandidacyProcess();

            if (parentProcess.getOpenChildProcessByEidentifier(eidentifier) != null) {
                throw new DomainException("error.erasmus.candidacy.already.exists.with.eidentifier");
            }

            process.getPersonalDetails().getPerson().setEidentifier(eidentifier);
            return process;
        }
View Full Code Here

    }

    @Override
    public ActionForward prepareCreateNewProcess(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        throw new DomainException("error.permission.denied");
    }
View Full Code Here

        new StandaloneCandidacyPeriod(this, executionSemester, start, end);
    }

    private void checkParameters(final ExecutionInterval executionInterval, final DateTime start, final DateTime end) {
        if (executionInterval == null) {
            throw new DomainException("error.StandaloneCandidacyProcess.invalid.executionInterval");
        }

        if (start == null || end == null || start.isAfter(end)) {
            throw new DomainException("error.StandaloneCandidacyProcess.invalid.interval");
        }
    }
View Full Code Here

        if (!StringUtils.isEmpty(degreeCurricularPlanId)) {
            degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanId);
        }
        try {
            if (degreeCurricularPlan == null) {
                throw new DomainException("error.selection.noDegree");
            }
            request.setAttribute("degreeCurricularPlanName",
                    degreeCurricularPlan.getPresentationName(executionPeriod.getExecutionYear()));
            request.setAttribute("degreeCurricularPlan", degreeCurricularPlan);
            String executionCourseId = RequestUtils.getAndSetStringToRequest(request, "executionCourseId");
View Full Code Here

        String country;
        if (person.getCountry() != null) {
            country = person.getCountry().getCountryNationality().getContent(getLanguage()).toLowerCase();
        } else {
            throw new DomainException("error.personWithoutParishOfBirth");
        }

        Degree degree = ((RegistryDiplomaRequest) getDocumentRequest()).getDegree();
        ExecutionYear year = ((RegistryDiplomaRequest) getDocumentRequest()).getConclusionYear();
View Full Code Here

            res.append(" ").append(request.getPhdIndividualProgramProcess().getPhdProgram().getName().getContent(getLanguage()));

            return res.toString();
        }

        throw new DomainException("docs.academicAdministrativeOffice.RegistryDiploma.degreeDescription.invalid.request");
    }
View Full Code Here

        if (!hasCredits) {
            professorshipToDelete.delete();
        } else {
            if (hasCredits) {
                throw new DomainException("error.remove.professorship");
            }
        }
        return Boolean.TRUE;
    }
View Full Code Here

        new MobilityApplicationPeriod(this, executionYear, start, end);
    }

    public void delete() {
        if (getChildProcessesSet().size() > 0) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.has.individual.application");
        }
        if (getCoordinatorsSet().size() > 0) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.has.coordinators");
        }
        if (getCandidacyPeriod() != null) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.defined.period");
        }
        if (getErasmusCandidacyProcessExecutedActionSet().size() > 0) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.has.executed.actions");
        }
        if (getErasmusCandidacyProcessReportsSet().size() > 0) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.has.reports");
        }
        if (getProcessLogsSet().size() > 0) {
            throw new DomainException("error.mobiliy.application.proccess.cant.be.deleted.it.has.logs");
        }
        setForSemester(null);
        setRootDomainObject(null);
        deleteDomainObject();
    }
View Full Code Here

        deleteDomainObject();
    }

    public void resetConfigurations() {
        if (getChildProcessesSet().size() > 0) {
            throw new DomainException("error.mobility.application.process.cant.delete.configurations.it.has.applications");
        }
        for (MobilityQuota quota : getCandidacyPeriod().getMobilityQuotasSet()) {
            quota.delete();
        }
        for (MobilityCoordinator coord : getCoordinatorsSet()) {
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.exceptions.DomainException

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.