Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.CurricularCourse


*/
public class ReadCurricularCourseByID {

    @Atomic
    public static InfoCurricularCourse run(String curricularCourseID) throws FenixServiceException {
        CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseID);

        if (curricularCourse == null) {
            throw new NonExistingServiceException();
        }

View Full Code Here


                ExecutionSemester executionSemester) {
            List<DegreeModuleToEnrol> coursesToEnrol = curriculumModuleBean.getCurricularCoursesToEnrol();
            Collections.sort(coursesToEnrol, new BeanComparator("context"));

            for (DegreeModuleToEnrol degreeModuleToEnrol : coursesToEnrol) {
                CurricularCourse curricularCourse = (CurricularCourse) degreeModuleToEnrol.getContext().getChildDegreeModule();

                HtmlTableRow htmlTableRow = groupTable.createRow();
                HtmlTableCell cellName = htmlTableRow.createCell();
                cellName.setClasses(getCurricularCourseNameClasses());
                cellName.setBody(new HtmlText(curricularCourse.getName()));

                // Year
                final HtmlTableCell yearCell = htmlTableRow.createCell();
                yearCell.setClasses(getCurricularCourseYearClasses());
                yearCell.setColspan(2);

                final StringBuilder year = new StringBuilder();
                year.append(degreeModuleToEnrol.getContext().getCurricularPeriod().getFullLabel());
                yearCell.setBody(new HtmlText(year.toString()));

                if (!curricularCourse.isOptionalCurricularCourse()) {
                    // Ects
                    final HtmlTableCell ectsCell = htmlTableRow.createCell();
                    ectsCell.setClasses(getCurricularCourseEctsClasses());

                    final StringBuilder ects = new StringBuilder();
                    ects.append(curricularCourse.getEctsCredits()).append(" ")
                            .append(BundleUtil.getString(Bundle.ACADEMIC, "credits.abbreviation"));
                    ectsCell.setBody(new HtmlText(ects.toString()));

                    HtmlTableCell checkBoxCell = htmlTableRow.createCell();
                    checkBoxCell.setClasses(getCurricularCourseCheckBoxClasses());
View Full Code Here

public class ReadStudentListByCurricularCourse {

    protected List run(final User userView, final String curricularCourseID, final String executionYear)
            throws FenixServiceException {

        final CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseID);
        return (executionYear != null) ? cleanList(curricularCourse.getEnrolmentsByYear(executionYear)) : cleanList(curricularCourse
                .getEnrolments());
    }
View Full Code Here

        }
    }

    private static void fixEnrolmentCurricularCourse(final StudentCurricularPlan studentCurricularPlan, final Enrolment enrollment) {
        if (enrollment.getCurricularCourse().getDegreeCurricularPlan() != studentCurricularPlan.getDegreeCurricularPlan()) {
            CurricularCourse curricularCourse =
                    studentCurricularPlan.getDegreeCurricularPlan().getCurricularCourseByCode(
                            enrollment.getCurricularCourse().getCode());
            if (curricularCourse != null) {
                enrollment.setCurricularCourse(curricularCourse);
            }
View Full Code Here

            ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);

            // For all Associated Curricular Courses
            Iterator curricularCourseIterator = executionCourse.getAssociatedCurricularCoursesSet().iterator();
            while (curricularCourseIterator.hasNext()) {
                CurricularCourse curricularCourse = (CurricularCourse) curricularCourseIterator.next();

                // Read All Execution Degrees for this Degree Curricular
                // Plan

                Collection executionDegrees = curricularCourse.getDegreeCurricularPlan().getExecutionDegreesSet();

                // Check if the Coordinator is the logged one
                Iterator executionDegreesIterator = executionDegrees.iterator();
                while (executionDegreesIterator.hasNext()) {
                    ExecutionDegree executionDegree = (ExecutionDegree) executionDegreesIterator.next();
View Full Code Here

    private void fillCurricularStructure(String courseGroupBeingReported, List<Context> contextsWithCurricularCourses,
            final Spreadsheet spreadsheet) throws FenixServiceException {
        Set<Unit> scientificAreaUnits = new HashSet<Unit>();

        for (final Context contextWithCurricularCourse : contextsWithCurricularCourses) {
            CurricularCourse curricularCourse = (CurricularCourse) contextWithCurricularCourse.getChildDegreeModule();

            if (!curricularCourse.isOptional()
                    && !scientificAreaUnits.contains(curricularCourse.getCompetenceCourse().getScientificAreaUnit())) {
                final Row row = spreadsheet.addRow();

                if (rootWasClicked && !this.getCourseGroup().getSortedChildContextsWithCourseGroups().isEmpty()) {
                    row.setCell(courseGroupBeingReported);
                }
                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit().getName());
                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit().getAcronym());
                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit()
                        .getScientificAreaUnitEctsCredits(contextsWithCurricularCourses).toString());

                scientificAreaUnits.add(curricularCourse.getCompetenceCourse().getScientificAreaUnit());
            }
        }
    }
View Full Code Here

        for (final CurricularRuleType curricularRuleType : CurricularRuleType.values()) {
            switch (curricularRuleType) {

            case CREDITS_LIMIT:
                if (getDegreeModule().isLeaf()) {
                    final CurricularCourse curricularCourse = (CurricularCourse) getDegreeModule();
                    if (curricularCourse.isOptionalCurricularCourse()) {
                        result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                                curricularRuleType.getName())));
                        break;
                    }
                }

            case DEGREE_MODULES_SELECTION_LIMIT:
                if (!getDegreeModule().isLeaf()) {
                    result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                            curricularRuleType.getName())));
                }
                break;
            case PRECEDENCY_BETWEEN_DEGREE_MODULES:
                result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                        curricularRuleType.getName())));
                break;

            case PRECEDENCY_APPROVED_DEGREE_MODULE:
            case PRECEDENCY_ENROLED_DEGREE_MODULE:
            case RESTRICTION_NOT_ENROLED_DEGREE_MODULE:
            case ENROLMENT_TO_BE_APPROVED_BY_COORDINATOR:
                if (getDegreeModule().isLeaf()) {
                    result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                            curricularRuleType.getName())));
                }
                break;

            case EXCLUSIVENESS:
                result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                        curricularRuleType.getName())));
                break;

            case ANY_CURRICULAR_COURSE:
                if (getDegreeModule().isLeaf()) {
                    final CurricularCourse curricularCourse = (CurricularCourse) getDegreeModule();
                    if (curricularCourse.isOptionalCurricularCourse()) {
                        result.add(new SelectItem(curricularRuleType.getName(), BundleUtil.getString(Bundle.ENUMERATION,
                                curricularRuleType.getName())));
                    }
                }
                break;
View Full Code Here

    }

    private void fillStudiesPlan(List<Context> contextsWithCurricularCourses, final Spreadsheet spreadsheet)
            throws FenixServiceException {
        for (final Context contextWithCurricularCourse : contextsWithCurricularCourses) {
            CurricularCourse curricularCourse = (CurricularCourse) contextWithCurricularCourse.getChildDegreeModule();
            CurricularPeriod curricularPeriod = contextWithCurricularCourse.getCurricularPeriod();
            String parentCourseGroupName = getContextPaths().get(contextWithCurricularCourse);

            fillCurricularCourse(spreadsheet, curricularCourse, curricularPeriod, parentCourseGroupName);
            if (curricularCourse.isAnual()) {
                fillCurricularCourse(spreadsheet, curricularCourse, curricularPeriod.getNext(), parentCourseGroupName);
            }
        }
    }
View Full Code Here

    static public CurricularCourseByExecutionSemesterBean buildFrom(final String key) {
        if (key == null || key.isEmpty()) {
            return null;
        }
        final String[] values = key.split(":");
        final CurricularCourse course = FenixFramework.getDomainObject(values[0]);
        final ExecutionSemester semester = FenixFramework.getDomainObject(values[1]);
        return new CurricularCourseByExecutionSemesterBean(course, semester);
    }
View Full Code Here

            InfoExam infoExam =
                    InfoExamWithRoomOccupationsAndScopesWithCurricularCoursesWithDegreeAndSemesterAndYear.newInfoFromDomain(exam);
            int numberOfStudentsForExam = 0;
            Set<CurricularCourse> checkedCurricularCourses = new HashSet<CurricularCourse>();
            for (DegreeModuleScope degreeModuleScope : exam.getDegreeModuleScopes()) {
                CurricularCourse curricularCourse = degreeModuleScope.getCurricularCourse();
                if (!checkedCurricularCourses.contains(curricularCourse)) {
                    checkedCurricularCourses.add(curricularCourse);
                    ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionPeriodId);
                    int numberEnroledStudentsInCurricularCourse =
                            curricularCourse.countEnrolmentsByExecutionPeriod(executionSemester);
                    numberOfStudentsForExam += numberEnroledStudentsInCurricularCourse;
                }

                boolean isCurricularYearEqual = degreeModuleScope.getCurricularYear().equals(wantedCurricularYear);
                DegreeCurricularPlan degreeCurricularPlanFromScope =
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.CurricularCourse

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.