Package org.fenixedu.academic.domain.exceptions

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


        for (final CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCoursesSet()) {
            if (curricularCourse == this) {
                continue;
            }
            if (curricularCourse.getName().equals(name) && curricularCourse.getCode().equals(code)) {
                throw new DomainException("error.curricularCourseWithSameNameAndCode");
            }
            if (curricularCourse.getAcronym().equals(acronym)) {
                throw new DomainException("error.curricularCourseWithSameAcronym");
            }
        }
    }
View Full Code Here


    // BEGIN: Only for enrollment purposes
    // -------------------------------------------------------------

    public boolean hasRestrictionDone(final CurricularCourse precedence) {
        if (!isBolonhaDegree()) {
            throw new DomainException("CurricularCourse.method.only.appliable.to.bolonha.structure");
        }

        final ExecutionSemester currentExecutionPeriod = ExecutionSemester.readActualExecutionSemester();

        for (final CurricularRule curricularRule : getCurricularRulesSet()) {
View Full Code Here

            final Double ectsCredits = super.getEctsCredits();
            return (ectsCredits == null || ectsCredits == 0.0) ? ECTS_CREDITS_FOR_PRE_BOLONHA : ectsCredits;
        }

        throw new DomainException("CurricularCourse.with.no.ects.credits");
    }
View Full Code Here

    public MarkSheet rectifyEnrolmentEvaluation(MarkSheet markSheet, EnrolmentEvaluation enrolmentEvaluation,
            Date evaluationDate, Grade grade, String reason, Person person) {

        if (markSheet == null || evaluationDate == null || grade.isEmpty()) {
            throw new DomainException("error.markSheet.invalid.arguments");
        }

        if (!markSheet.getEnrolmentEvaluationsSet().contains(enrolmentEvaluation)) {
            throw new DomainException("error.no.student.in.markSheet");
        }

        if (markSheet.isNotConfirmed()) {
            throw new DomainException("error.markSheet.must.be.confirmed");
        }

        if (enrolmentEvaluation.getRectification() != null) {
            throw new DomainException("error.markSheet.student.alreadyRectified", enrolmentEvaluation.getEnrolment()
                    .getStudentCurricularPlan().getRegistration().getNumber().toString());
        }

        enrolmentEvaluation.setEnrolmentEvaluationState(EnrolmentEvaluationState.TEMPORARY_OBJ);
        // enrolmentEvaluation.setWhenDateTime(new DateTime());
View Full Code Here

    public MarkSheet rectifyOldEnrolmentEvaluation(EnrolmentEvaluation enrolmentEvaluation, MarkSheetType markSheetType,
            Date evaluationDate, Grade newGrade, String reason, Person person) {

        if (enrolmentEvaluation == null || evaluationDate == null || newGrade.isEmpty()) {
            throw new DomainException("error.markSheet.invalid.arguments");
        }

        if (enrolmentEvaluation.getRectification() != null) {
            throw new DomainException("error.markSheet.student.alreadyRectified", enrolmentEvaluation.getEnrolment()
                    .getStudentCurricularPlan().getRegistration().getNumber().toString());
        }

        enrolmentEvaluation.setEnrolmentEvaluationState(EnrolmentEvaluationState.TEMPORARY_OBJ);
View Full Code Here

        Collection<ExecutionCourse> executionCourses = getAssociatedExecutionCoursesSet();

        for (ExecutionCourse executionCourse : executionCourses) {
            if (associatedExecutionCourses != executionCourse
                    && executionCourse.getExecutionPeriod() == associatedExecutionCourses.getExecutionPeriod()) {
                throw new DomainException("error.executionCourse.curricularCourse.already.associated");
            }
        }
        super.addAssociatedExecutionCourses(associatedExecutionCourses);
    }
View Full Code Here

        if (isResponsiblePersonManager()) {
            return;
        }

        if (!hasRegistrationInValidState()) {
            throw new DomainException("error.StudentCurricularPlan.cannot.enrol.with.registration.inactive");
        }

        if (getStudent().isAnyGratuityOrAdministrativeOfficeFeeAndInsuranceInDebt()) {
            throw new DomainException("error.StudentCurricularPlan.cannot.enrol.with.debts.for.previous.execution.years");
        }

        if (areModifiedCyclesConcluded()) {
            checkUpdateRegistrationAfterConclusion();
        }
View Full Code Here

        for (final CurriculumModule curriculumModule : enrolmentContext.getToRemove()) {
            if (curriculumModule instanceof Enrolment) {
                final Enrolment enrolment = (Enrolment) curriculumModule;
                enrolment.unEnrollImprovement(getExecutionSemester());
            } else {
                throw new DomainException(
                        "StudentCurricularPlanImprovementOfApprovedEnrolmentManager.can.only.manage.enrolment.evaluations.of.enrolments");
            }
        }
    }
View Full Code Here

                    final Enrolment enrolment = (Enrolment) moduleEnroledWrapper.getCurriculumModule();
                    result.put(degreeModuleToEvaluate,
                            Collections.<ICurricularRule> singleton(new ImprovementOfApprovedEnrolment(enrolment)));

                } else {
                    throw new DomainException(
                            "StudentCurricularPlanImprovementOfApprovedEnrolmentManager.can.only.manage.enrolment.evaluations.of.enrolments");
                }
            }
        }
View Full Code Here

                    if (moduleEnroledWrapper.getCurriculumModule() instanceof Enrolment) {
                        final Enrolment enrolment = (Enrolment) moduleEnroledWrapper.getCurriculumModule();
                        toCreate.add(enrolment);
                    } else {
                        throw new DomainException(
                                "StudentCurricularPlanImprovementOfApprovedEnrolmentManager.can.only.manage.enrolment.evaluations.of.enrolments");
                    }
                }
            }
        }
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.