Package org.fenixedu.academic.domain.exceptions

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


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

        PhdRegistryDiplomaRequest phdRequest = getDocumentRequest();

        String secondParagraph =
View Full Code Here


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

        String nationality = BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "diploma.nationality");
        addParameter("birthLocale", MessageFormat.format(nationality, country));
    }
View Full Code Here

            case GRADUATION:
                importGraduationTables(executionInterval, level, file);
                break;
            }
        } catch (IOException e) {
            throw new DomainException("error.ects.table.unableToReadTablesFile");
        }
    }
View Full Code Here

        for (String line : file.split("\n")) {
            if (!line.startsWith(BundleUtil.getString(Bundle.GEP, "label.externalId"))) {
                String[] parts = fillArray(line.split(SEPARATOR), 15);
                Degree degree = FenixFramework.getDomainObject(parts[0]);
                if (!degree.getDegreeType().getLocalizedName().equals(parts[1])) {
                    throw new DomainException("error.ects.invalidLine.nonMatchingCourse", parts[0], parts[1], degree
                            .getDegreeType().getLocalizedName());
                }
                if (!degree.getName().equals(parts[2])) {
                    throw new DomainException("error.ects.invalidLine.nonMatchingCourse", parts[0], parts[2], degree.getName());
                }
                CurricularYear year = CurricularYear.readByYear(Integer.parseInt(parts[3]));
                EctsDegreeByCurricularYearConversionTable.createConversionTable(degree, executionInterval, year,
                        Arrays.copyOfRange(parts, 4, 15));
            }
View Full Code Here

        for (String line : file.split("\n")) {
            if (!line.startsWith(BundleUtil.getString(Bundle.GEP, "label.externalId"))) {
                String[] parts = fillArray(line.split(SEPARATOR), 26);
                Degree degree = FenixFramework.getDomainObject(parts[0]);
                if (!degree.getDegreeType().getLocalizedName().equals(parts[1])) {
                    throw new DomainException("error.ects.invalidLine.nonMatchingCourse", parts[0], parts[1], degree
                            .getDegreeType().getLocalizedName());
                }
                if (!degree.getName().equals(parts[2])) {
                    throw new DomainException("error.ects.invalidLine.nonMatchingCourse", parts[0], parts[2], degree.getName());
                }
                CycleType cycle;
                try {
                    cycle = CycleType.getSortedValues().toArray(new CycleType[0])[Integer.parseInt(parts[3]) - 1];
                } catch (NumberFormatException e) {
View Full Code Here

        this();

        final CourseGroup courseGroup = findCourseGroup(curriculumGroup);
        String[] args = {};
        if (courseGroup == null) {
            throw new DomainException("error.CreditsDismissalLog.invalid.courseGroup", args);
        }

        init(action, registration, courseGroup, executionSemester, who);
        setCredits(BigDecimal.valueOf(credits.getGivenCredits()));
        setSourceDescription(buildSourceDescription(credits));
View Full Code Here

            final OptionalCurricularCourse optionalCurricularCourse, final Credits credits, final Double ectsCredits,
            final ExecutionSemester executionSemester, final String who) {
        this();
        String[] args = {};
        if (optionalCurricularCourse == null) {
            throw new DomainException("error.OptionalDismissalLog.invalid.optionalCurricularCourse", args);
        }
        init(action, registration, optionalCurricularCourse, executionSemester, who);
        setCredits(BigDecimal.valueOf(ectsCredits));
        setSourceDescription(buildSourceDescription(credits));
    }
View Full Code Here

            final ExecutionSemester executionSemester, final String who) {

        this();
        String[] args = {};
        if (optionalCurricularCourse == null) {
            throw new DomainException("error.OptionalEnrolmentLog.invalid.optionalCurricularCourse", args);
        }
        init(action, registration, curricularCourse, executionSemester, who);
        setOptionalCurricularCourse(optionalCurricularCourse);
    }
View Full Code Here

        final SortedSet<CurriculumLine> curriculumLines =
                new TreeSet<CurriculumLine>(CurriculumLine.COMPARATOR_BY_APPROVEMENT_DATE_AND_ID);
        curriculumLines.addAll(getApprovedCurriculumLines());

        if (curriculumLines.isEmpty()) {
            throw new DomainException("Registration.has.no.approved.curriculum.lines");
        }

        return curriculumLines.last();
    }
View Full Code Here

    }

    public BigDecimal getDiscountPercentage(final Event event) {
        PaymentPlan paymentPlan = getPaymentPlan(event);
        if (paymentPlan == null) {
            throw new DomainException("error.event.not.associated.paymentPlan", event.getClass().getName());
        }
        return ((GratuityEventWithPaymentPlan) event).calculateDiscountPercentage(paymentPlan.calculateBaseAmount(event));
    }
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.