Package org.fenixedu.academic.domain.studentCurriculum

Examples of org.fenixedu.academic.domain.studentCurriculum.CurriculumLine


            final DegreeModule degreeModule = curriculumModule.getDegreeModule();
            if (degreeModule != null) {
                degreeModule.getName();
            }
            if (curriculumModule.isCurriculumLine()) {
                final CurriculumLine curriculumLine = (CurriculumLine) curriculumModule;
                if (curriculumLine.isEnrolment()) {
                    final Enrolment enrolment = (Enrolment) curriculumLine;
                    for (final EnrolmentEvaluation enrolmentEvaluation : enrolment.getEvaluationsSet()) {
                        enrolmentEvaluation.getGrade();
                    }
                }
View Full Code Here


    private boolean isEnroledIn(IDegreeModuleToEvaluate degreeModuleToEvaluate, ExecutionSemester executionSemester) {
        if (degreeModuleToEvaluate.isLeaf()) {
            final EnroledCurriculumModuleWrapper curriculumModuleEnroledWrapper =
                    (EnroledCurriculumModuleWrapper) degreeModuleToEvaluate;
            final CurriculumLine curriculumLine = (CurriculumLine) (curriculumModuleEnroledWrapper).getCurriculumModule();

            if (curriculumLine.isEnrolment()) {
                return curriculumLine.getExecutionPeriod() == executionSemester;
            }

            return false;
        }
View Full Code Here

    }

    private void checkCurriculumLines(final DegreeModule degreeModule) {
        for (final CurriculumModule curriculumModule : degreeModule.getCurriculumModulesSet()) {
            if (curriculumModule.isCurriculumLine()) {
                final CurriculumLine curriculumLine = (CurriculumLine) curriculumModule;
                if (curriculumLine.hasExecutionPeriod()
                        && !degreeModule.hasAnyOpenParentContexts(curriculumLine.getExecutionPeriod())) {
                    throw new DomainException("error.Context.cannot.modify.begin.and.end.because.of.enroled.curriculumLines");
                }
            }
        }
    }
View Full Code Here

        check(this, StudentCurricularPlanPredicates.MOVE_CURRICULUM_LINES_WITHOUT_RULES);

        for (final CurriculumLineLocationBean curriculumLineLocationBean : moveCurriculumLinesBean.getCurriculumLineLocations()) {

            final CurriculumGroup destination = curriculumLineLocationBean.getCurriculumGroup();
            final CurriculumLine curriculumLine = curriculumLineLocationBean.getCurriculumLine();

            if (curriculumLine.getCurriculumGroup() != destination) {
                checkPermission(responsiblePerson, curriculumLineLocationBean);

                if (curriculumLine.hasExecutionPeriod()
                        && curriculumLine.getExecutionYear().isBefore(destination.getRegistration().getStartExecutionYear())) {
                    throw new DomainException(
                            "error.StudentCurricularPlan.cannot.move.curriculum.line.to.curriculum.group.invalid.period",
                            curriculumLine.getFullPath(), destination.getFullPath(), curriculumLine.getExecutionPeriod()
                                    .getQualifiedName(), destination.getRegistration().getStartExecutionYear().getQualifiedName());
                }

                curriculumLine.setCurriculumGroup(destination);
            }

            // if curriculum line is moved then change created by
            curriculumLine.setCreatedBy(responsiblePerson != null ? responsiblePerson.getUsername() : curriculumLine
                    .getCreatedBy());
        }
    }
View Full Code Here

        return curriculumLines.isEmpty() ? null : curriculumLines.last();
    }

    final public YearMonthDay getLastApprovementDate() {
        final CurriculumLine lastApprovement = getLastApprovement();
        return lastApprovement == null ? null : lastApprovement.getApprovementDate();
    }
View Full Code Here

        boolean runRules = false;
        Person responsible = AccessControl.getPerson();

        for (final CurriculumLineLocationBean curriculumLineLocationBean : moveCurriculumLinesBean.getCurriculumLineLocations()) {
            final CurriculumGroup destination = curriculumLineLocationBean.getCurriculumGroup();
            final CurriculumLine curriculumLine = curriculumLineLocationBean.getCurriculumLine();

            if (curriculumLine.getCurriculumGroup() != destination) {

                checkPermission(responsible, curriculumLineLocationBean);

                if (!destination.canAdd(curriculumLine)) {
                    throw new DomainException("error.StudentCurricularPlan.cannot.move.curriculum.line.to.curriculum.group",
                            curriculumLine.getFullPath(), destination.getFullPath());
                }

                if (curriculumLine.hasExecutionPeriod()
                        && curriculumLine.getExecutionYear().isBefore(destination.getRegistration().getStartExecutionYear())) {
                    throw new DomainException(
                            "error.StudentCurricularPlan.cannot.move.curriculum.line.to.curriculum.group.invalid.period",
                            curriculumLine.getFullPath(), destination.getFullPath(), curriculumLine.getExecutionPeriod()
                                    .getQualifiedName(), destination.getRegistration().getStartExecutionYear().getQualifiedName());
                }

                if (!destination.isExtraCurriculum()) {
                    runRules = true;
                }
                curriculumLine.setCurriculumGroup(destination);
            }

            // if curriculum line is moved then change created by

            curriculumLine.setCreatedBy(responsible != null ? responsible.getUsername() : curriculumLine.getCreatedBy());
        }

        runRules &= isBolonhaDegree();

        if (runRules) {
View Full Code Here

            if (newExtraCurriculumGroup == null) {
                throw new DomainException("error.invalid.newExtraCurriculumGroup");
            }
            for (final CurriculumModule curriculumModule : oldExtraCurriculumGroup.getCurriculumModulesSet()) {
                if (curriculumModule.isCurriculumLine()) {
                    final CurriculumLine curriculumLine = (CurriculumLine) curriculumModule;
                    if (!curriculumLine.hasExecutionPeriod()
                            || curriculumLine.getExecutionPeriod().isBefore(getExecutionPeriod())) {
                        continue;
                    }
                }

                curriculumModule.setCurriculumGroup(newExtraCurriculumGroup);
            }

            for (final CurriculumLine curriculumLine : newExtraCurriculumGroup.getAllCurriculumLines()) {
                if (curriculumLine.isDismissal()) {
                    final Dismissal dismissal = (Dismissal) curriculumLine;
                    dismissal.getCredits().setStudentCurricularPlan(newStudentCurricularPlan);
                }
            }
        }
View Full Code Here

    @Override
    public boolean isLeaf() {
        if (!getCurriculumModule().isLeaf()) {
            return false;
        }
        final CurriculumLine curriculumLine = (CurriculumLine) getCurriculumModule();
        return curriculumLine.isEnrolment();
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.studentCurriculum.CurriculumLine

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.