Package org.fenixedu.academic.service.services.exceptions

Examples of org.fenixedu.academic.service.services.exceptions.FenixServiceException


        final List<Degree> degrees = Degree.readNotEmptyDegrees();

        for (Degree degree : degrees) {
            if (degree.getSigla().equalsIgnoreCase(acronym)) {
                throw new FenixServiceException("error.existing.degree.acronym");
            }
            ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();

            if ((degree.getNameFor(currentExecutionYear).getContent(MultiLanguageString.pt).equalsIgnoreCase(name) || degree
                    .getNameFor(currentExecutionYear).getContent(MultiLanguageString.en).equalsIgnoreCase(nameEn))
                    && degree.getDegreeType().equals(degreeType)) {
                throw new FenixServiceException("error.existing.degree.name.and.type");
            }
        }

        new Degree(name, nameEn, acronym, degreeType, ectsCredits, gradeScale, prevailingScientificArea, administrativeOffice);
    }
View Full Code Here


    protected Boolean run(String infoExecutionDegreeId, String oldCurriculumId, String curricularCourseCode,
            InfoCurriculum newInfoCurriculum, String username, String language) throws FenixServiceException {
        Boolean result = new Boolean(false);

        if (oldCurriculumId == null) {
            throw new FenixServiceException("nullCurriculumCode");
        }
        if (curricularCourseCode == null) {
            throw new FenixServiceException("nullCurricularCourseCode");
        }
        if (newInfoCurriculum == null) {
            throw new FenixServiceException("nullCurriculum");
        }
        if (username == null) {
            throw new FenixServiceException("nullUsername");
        }

        CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseCode);
        if (curricularCourse == null) {
            throw new NonExistingServiceException("noCurricularCourse");
View Full Code Here

            throw new InvalidArgumentsServiceException();
        }

        final Person creator = AccessControl.getPerson();
        if (creator == null) {
            throw new FenixServiceException("error.degreeCurricularPlan.non.existing.creator");
        }

        final Degree degree = FenixFramework.getDomainObject(degreeId);
        if (degree == null) {
            throw new FenixServiceException("error.degreeCurricularPlan.non.existing.degree");
        }

        degree.createBolonhaDegreeCurricularPlan(name, gradeScale, creator);
    }
View Full Code Here

    public static Boolean run(String executionDegreeCode, String curricularCourseCode, String username)
            throws FenixServiceException {
        Boolean result = new Boolean(false);

        if (executionDegreeCode == null) {
            throw new FenixServiceException("nullExecutionDegreeCode");
        }
        if (curricularCourseCode == null) {
            throw new FenixServiceException("nullCurricularCourseCode");
        }
        if (username == null) {
            throw new FenixServiceException("nullUsername");
        }

        final Person person = Person.readPersonByUsername(username);
        ExecutionDegree executionDegree = FenixFramework.getDomainObject(executionDegreeCode);
        ExecutionYear executionYear = executionDegree.getExecutionYear();
View Full Code Here

            throws FenixServiceException {
        check(RolePredicates.COORDINATOR_PREDICATE);
        InfoCurriculum infoCurriculum = null;

        if (curricularCourseCode == null) {
            throw new FenixServiceException("nullCurricularCourse");
        }
        if (stringExecutionYear == null || stringExecutionYear.length() == 0) {
            throw new FenixServiceException("nullExecutionYearName");
        }
        CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseCode);
        if (curricularCourse == null) {
            throw new NonExistingServiceException("noCurricularCourse");
        }
View Full Code Here

    public static void run(String executionDegreeId, List<String> coordinatorsToBeResponsibleIDs) throws FenixServiceException {
        check(RolePredicates.MANAGER_OR_OPERATOR_PREDICATE);

        final ExecutionDegree executionDegree = FenixFramework.getDomainObject(executionDegreeId);
        if (executionDegree == null) {
            throw new FenixServiceException("error.noExecutionDegree");
        }

        for (final Coordinator coordinator : executionDegree.getCoordinatorsListSet()) {
            coordinator.setResponsible(coordinatorsToBeResponsibleIDs.contains(coordinator.getExternalId()));
        }
View Full Code Here

    @Atomic
    public static InfoCurriculum run(String executionDegreeCode, String curricularCourseCode) throws FenixServiceException {
        check(RolePredicates.COORDINATOR_PREDICATE);

        if (curricularCourseCode == null) {
            throw new FenixServiceException("nullCurricularCourse");
        }

        CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseCode);
        if (curricularCourse == null) {
            throw new NonExistingServiceException();
View Full Code Here

    public List<ExecutionCourse> run(String degreeCurricularPlanID, String executionPeriodID, String curricularYearID)
            throws FenixServiceException {

        final ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionPeriodID);
        if (executionSemester == null) {
            throw new FenixServiceException("error.no.executionPeriod");
        }

        final DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanID);
        if (degreeCurricularPlan == null) {
            throw new FenixServiceException("error.coordinator.noDegreeCurricularPlan");
        }

        CurricularYear curricularYear = null;
        if (curricularYearID != null) {
            curricularYear = FenixFramework.getDomainObject(curricularYearID);
            if (curricularYear == null) {
                throw new FenixServiceException("error.no.curYear");
            }
        }

        final List<ExecutionCourse> result = new ArrayList<ExecutionCourse>();
        for (final ExecutionCourse executionCourse : executionSemester.getAssociatedExecutionCoursesSet()) {
View Full Code Here

            // assert unique degree code and unique pair name/type
            for (Degree degree : degrees) {
                if (degree != degreeToEdit) {
                    if (degree.getSigla().equalsIgnoreCase(acronym)) {
                        throw new FenixServiceException("error.existing.degree.acronym");
                    }
                    if ((degree.getNameFor(executionYear).getContent(MultiLanguageString.pt).equalsIgnoreCase(name) || degree
                            .getNameFor(executionYear).getContent(MultiLanguageString.en).equalsIgnoreCase(nameEn))
                            && degree.getDegreeType().equals(degreeType)) {
                        throw new FenixServiceException("error.existing.degree.name.and.type");
                    }
                }
            }
        }
View Full Code Here

            throw new InvalidArgumentsServiceException();
        }

        final DegreeCurricularPlan dcpToEdit = FenixFramework.getDomainObject(dcpId);
        if (dcpToEdit == null) {
            throw new FenixServiceException("error.degreeCurricularPlan.no.existing.degreeCurricularPlan");
        }

        final ExecutionYear executionYear =
                (executionYearID == null) ? null : FenixFramework.<ExecutionYear> getDomainObject(executionYearID);
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.service.services.exceptions.FenixServiceException

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.