Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.OccupationPeriod


                addMessage(request, actionMessages, "error.evaluationDateNotInExamsPeriod");
            }

        } else if (!executionDegree.isEvaluationDateInExamPeriod(evaluationDate, executionSemester, markSheetType)) {

            OccupationPeriod occupationPeriod = executionDegree.getOccupationPeriodFor(executionSemester, markSheetType);
            if (occupationPeriod == null) {
                addMessage(request, actionMessages, "error.evaluationDateNotInExamsPeriod");
            } else {
                addMessage(request, actionMessages, "error.evaluationDateNotInExamsPeriodWithDates", occupationPeriod
                        .getStartYearMonthDay().toString("dd/MM/yyyy"),
                        occupationPeriod.getEndYearMonthDay().toString("dd/MM/yyyy"));
            }
        }
    }
View Full Code Here


                    .getAcademicInterval());
        }

        public Date getBegginingOfLessonPeriod(final ExecutionSemester executionSemester, final ExecutionDegree executionDegree) {
            if (executionSemester != null) {
                OccupationPeriod op = executionDegree.getPeriodLessons(executionSemester);
                return op.getStartYearMonthDay().toDateMidnight().toDate();
            } else {
                throw new DomainException("unsupported.execution.period.semester");
            }
        }
View Full Code Here

            }
        }

        public Date getEndOfExamsPeriod(final ExecutionSemester executionSemester, final ExecutionDegree executionDegree) {
            if (executionSemester != null) {
                OccupationPeriod op = executionDegree.getPeriodLessons(executionSemester);
                return op.getEndYearMonthDay().toDateMidnight().toDate();
            } else {
                throw new DomainException("unsupported.execution.period.semester");
            }
        }
View Full Code Here

        final Space campus = (Space) FenixFramework.getDomainObject(campusID);
        if (campus == null) {
            throw new FenixServiceException("error.noCampus");
        }

        final OccupationPeriod periodLessonsFirstSemester =
                getOccupationPeriod(periodLessonsFirstSemesterBegin, periodLessonsFirstSemesterEnd);
        final OccupationPeriod periodLessonsSecondSemester =
                getOccupationPeriod(periodLessonsSecondSemesterBegin, periodLessonsSecondSemesterEnd);

        final OccupationPeriod periodExamsFirstSemester =
                getOccupationPeriod(periodExamsFirstSemesterBegin, periodExamsFirstSemesterEnd);
        final OccupationPeriod periodExamsSecondSemester =
                getOccupationPeriod(periodExamsSecondSemesterBegin, periodExamsSecondSemesterEnd);
        final OccupationPeriod periodExamsSpecialSeason =
                getOccupationPeriod(periodExamsSpecialSeasonBegin, periodExamsSpecialSeasonEnd);

        final OccupationPeriod gradeSubmissionNormalSeason1 =
                getOccupationPeriod(periodExamsFirstSemesterBegin, gradeSubmissionNormalSeason1EndDate);
        final OccupationPeriod gradeSubmissionNormalSeason2 =
                getOccupationPeriod(periodExamsSecondSemesterBegin, gradeSubmissionNormalSeason2EndDate);
        final OccupationPeriod gradeSubmissionSpecialSeason =
                getOccupationPeriod(periodExamsSpecialSeasonBegin, gradeSubmissionSpecialSeasonEndDate);

        executionDegree.edit(executionYear, campus, publishedExamMap, periodLessonsFirstSemester, periodExamsFirstSemester,
                periodLessonsSecondSemester, periodExamsSecondSemester, periodExamsSpecialSeason, gradeSubmissionNormalSeason1,
                gradeSubmissionNormalSeason2, gradeSubmissionSpecialSeason);
View Full Code Here

                gradeSubmissionNormalSeason2, gradeSubmissionSpecialSeason);
    }

    private static OccupationPeriod getOccupationPeriod(final Date startDate, final Date endDate) {

        OccupationPeriod occupationPeriod =
                OccupationPeriod.readOccupationPeriod(YearMonthDay.fromDateFields(startDate),
                        YearMonthDay.fromDateFields(endDate));
        if (occupationPeriod == null) {
            occupationPeriod = new OccupationPeriod(startDate, endDate);
            occupationPeriod.setNextPeriod(null);
        }
        return occupationPeriod;
    }
View Full Code Here

        consolidateReferences();

        // The occupation period is shared by multiple types, a new one must be
        // created!
        if (this.occupationPeriod.getExecutionDegreesSet().size() != getReferences().size()) {
            this.occupationPeriod = new OccupationPeriod(intervals.iterator());

            // Period has changed, lets change the references so they point to
            // the new period.
            consolidateReferences();
        } else {
View Full Code Here

    @Atomic
    public void create(String intervalsStr, String courses) {

        Iterable<Interval> intervals = extractIntervals(intervalsStr);

        this.occupationPeriod = new OccupationPeriod(intervals.iterator());

        updateCourses(courses);

    }
View Full Code Here

        check(RolePredicates.MANAGER_OR_OPERATOR_PREDICATE);

        final ExecutionYear executionYear = FenixFramework.getDomainObject(executionYearID);
        final Space campus = readCampusByName(campusName);

        final OccupationPeriod lessonSeason1 = getOccupationPeriod(lessonSeason1BeginDate, lessonSeason1EndDate);
        final OccupationPeriod lessonSeason2 =
                OccupationPeriod.getOccupationPeriod(lessonSeason2BeginDate, lessonSeason2EndDate, lessonSeason2BeginDatePart2,
                        lessonSeason2EndDatePart2);
        final OccupationPeriod examsSeason1 = getOccupationPeriod(examsSeason1BeginDate, examsSeason1EndDate);
        final OccupationPeriod examsSeason2 = getOccupationPeriod(examsSeason2BeginDate, examsSeason2EndDate);
        final OccupationPeriod examsSpecialSeason = getOccupationPeriod(examsSpecialSeasonBeginDate, examsSpecialSeasonEndDate);
        final OccupationPeriod gradeSubmissionNormalSeason1 =
                getOccupationPeriod(examsSeason1BeginDate, gradeSubmissionNormalSeason1EndDate);
        final OccupationPeriod gradeSubmissionNormalSeason2 =
                getOccupationPeriod(examsSeason2BeginDate, gradeSubmissionNormalSeason2EndDate);
        final OccupationPeriod gradeSubmissionSpecialSeason =
                getOccupationPeriod(examsSpecialSeasonBeginDate, gradeSubmissionSpecialSeasonEndDate);

        final Set<String> allDegreeCurricularPlanIDs = new HashSet<String>();
        if (degreeCurricularPlansIDs != null && degreeCurricularPlansIDs.length > 0) {
            allDegreeCurricularPlanIDs.addAll(Arrays.asList(degreeCurricularPlansIDs));
View Full Code Here

        }
        return null;
    }

    private static OccupationPeriod getOccupationPeriod(final Calendar startDate, final Calendar endDate) {
        OccupationPeriod occupationPeriod =
                OccupationPeriod.readOccupationPeriod(YearMonthDay.fromCalendarFields(startDate),
                        YearMonthDay.fromCalendarFields(endDate));
        if (occupationPeriod == null) {
            occupationPeriod = new OccupationPeriod(startDate.getTime(), endDate.getTime());
            occupationPeriod.setNextPeriod(null);
        }
        return occupationPeriod;
    }
View Full Code Here

        return result;
    }

    private void obtainExamSeasonInfo(InfoExamsMap result, Integer wantedSemester, ExecutionDegree executionDegree)
            throws ExamsPeriodUndefined {
        OccupationPeriod period = null;
        if (wantedSemester.equals(Integer.valueOf(1))) {
            period = executionDegree.getPeriodExamsFirstSemester();
        } else {
            period = executionDegree.getPeriodExamsSecondSemester();
        }

        if (period == null) {
            throw new ExamsPeriodUndefined();
        }

        Calendar startSeason1 = period.getStartDate();
        if (startSeason1.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
            // The calendar must start at a monday
            int shiftDays = Calendar.MONDAY - startSeason1.get(Calendar.DAY_OF_WEEK);
            startSeason1.add(Calendar.DATE, shiftDays);
        }
        result.setStartSeason1(startSeason1);
        result.setEndSeason1(null);
        result.setStartSeason2(null);

        Calendar endSeason2 = period.getEndDateOfComposite();
        result.setEndSeason2(endSeason2);
    }
View Full Code Here

TOP

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

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.