Package org.fenixedu.academic.domain.exceptions

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


        init(executionYear);
    }

    private void checkParameters(ExecutionYear executionYear) {
        if (executionYear == null) {
            throw new DomainException("error.candidacy.degree.ShiftDistribution.executionYear.cannot.be.null");
        }
    }
View Full Code Here


    }

    protected void init(ExecutionYear executionYear) {
        checkParameters(executionYear);
        if (executionYear.getShiftDistribution() != null) {
            throw new DomainException("error.candidacy.degree.ShiftDistribution.executionYear.already.has.a.shiftDistribution");
        }
        super.setExecutionYear(executionYear);
    }
View Full Code Here

        return result;
    }

    @Override
    public void setExecutionYear(ExecutionYear executionYear) {
        throw new DomainException("error.candidacy.degree.ShiftDistribution.cannot.modify.executionYear");
    }
View Full Code Here

            if (!StringUtils.isEmpty(destinationExecutionCourseIdString)
                    && StringUtils.isNumeric(destinationExecutionCourseIdString)) {
                destinationExecutionCourseId = destinationExecutionCourseIdString;
            } else {
                throw new DomainException("error.selection.noDestinationExecutionCourse");
            }

            ExecutionCourse destinationExecutionCourse =
                    SeperateExecutionCourse.run(executionCourseId, destinationExecutionCourseId, shiftIdsToTransfer,
                            curricularCourseIdsToTransfer);
View Full Code Here

                    candidacyPeriod.getEmailTemplateFor(MobilityEmailTemplateType.MISSING_SHIFTS);
            if (emailTemplateFor == null) {
                for (MobilityProgram mobilityProgram : candidacyPeriod.getMobilityPrograms()) {
                    for (MobilityEmailTemplate mobilityEmailTemplate : mobilityProgram.getEmailTemplatesSet()) {
                        if (mobilityEmailTemplate.getType().equals(MobilityEmailTemplateType.MISSING_SHIFTS)) {
                            throw new DomainException("error.missing.shifts.template.not.found", mobilityProgram.getName()
                                    .getContent());
                        }
                    }
                }
            }
View Full Code Here

    }

    private static void addMark(List<AttendsMark> result, StudentMark studentMark, Attends attend,
            List<DomainException> exceptionList) {
        if (studentMark.mark.length() - studentMark.mark.indexOf('.') - 1 > 2) {
            exceptionList.add(new DomainException("error.mark.more.than.two.decimals", studentMark.studentNumber));
        } else {
            result.add(new AttendsMark(attend.getExternalId(), studentMark.mark));
        }
    }
View Full Code Here

        if (activeAttends.size() == 1) {
            return activeAttends.iterator().next();
        }

        if (activeAttends.isEmpty()) {
            exceptionList.add(new DomainException("errors.student.without.active.attends", studentNumber));
        } else {
            exceptionList.add(new DomainException("errors.student.with.several.active.attends", studentNumber));
        }

        return null;
    }
View Full Code Here

            final Attends attend = findAttend(executionCourse, entry.attendId);
            final String markValue = entry.mark;

            if (attend.getEnrolment() != null && attend.getEnrolment().isImpossible()) {
                exceptionList.add(new DomainException("errors.student.with.impossible.enrolment", attend.getRegistration()
                        .getStudent().getNumber().toString()));
            } else {
                final Mark mark = attend.getMarkByEvaluation(evaluation);

                if (isToDeleteMark(markValue)) {
View Full Code Here

        this.setDegree(degree);
    }

    private void check(final MobilityApplicationProcess applicationProcess, final Teacher teacher, final Degree degree) {
        if (applicationProcess == null) {
            throw new DomainException("error.erasmus.coordinator.candidacyProcess.must.not.be.null");
        }

        if (teacher == null) {
            throw new DomainException("error.erasmus.coordinator.teacher.must.not.be.null");
        }

        if (degree == null) {
            throw new DomainException("error.erasmus.coordinator.degree.must.not.be.null");
        }

        if (applicationProcess.isTeacherErasmusCoordinatorForDegree(teacher, degree)) {
            throw new DomainException("error.erasmus.coordinator.teacher.is.assigned.for.process.and.degree");
        }
    }
View Full Code Here

        if (StringUtils.isEmpty(infoExecutionCourse.getSigla())) {
            errors.append(errorStringBuilder("label.code"));
        }
        if (errors.length() > 0) {
            //ugly hack to simulate a form validator and its error messages
            throw new DomainException(errors.toString());
        }
    }
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.