Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Lesson


        SummariesManagementBean bean = (SummariesManagementBean) viewState.getMetaObject().getObject();

        bean.setSummaryDate(null);
        bean.setLessonType(null);

        Lesson lesson = bean.getLesson();
        if (lesson != null && lesson.getShift().getCourseLoadsSet().size() == 1) {
            bean.setLessonType(lesson.getShift().getCourseLoadsSet().iterator().next().getType());
        }

        return goToSummaryManagementPageAgain(mapping, request, (DynaActionForm) form, bean);
    }
View Full Code Here


    public ActionForward viewAllLessonDates(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        final InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
        final Lesson lesson = infoLesson.getLesson();
        final Set<NextPossibleSummaryLessonsAndDatesBean> lessonDatesBean =
                new TreeSet<NextPossibleSummaryLessonsAndDatesBean>(
                        NextPossibleSummaryLessonsAndDatesBean.COMPARATOR_BY_DATE_AND_HOUR);

        for (final LessonInstance instance : infoLesson.getLesson().getLessonInstancesSet()) {
            final NextPossibleSummaryLessonsAndDatesBean bean =
                    new NextPossibleSummaryLessonsAndDatesBean(lesson, instance.getDay());
            bean.setRoom(instance.getRoom());
            bean.setTime(instance.getStartTime());
            lessonDatesBean.add(bean);
        }
        if (!lesson.wasFinished()) {
            for (final YearMonthDay yearMonthDay : lesson.getAllLessonDatesWithoutInstanceDates()) {
                final NextPossibleSummaryLessonsAndDatesBean bean =
                        new NextPossibleSummaryLessonsAndDatesBean(lesson, yearMonthDay);
                bean.setRoom(lesson.getSala());
                bean.setTime(lesson.getBeginHourMinuteSecond());
                lessonDatesBean.add(bean);
            }
        }

        request.setAttribute("lessonDates", lessonDatesBean);
View Full Code Here

            manageLessonForm.set("newEndDate", infoLesson.getLessonEnd().toString("dd/MM/yyyy"));
        }

        manageLessonForm.set("createLessonInstances", Boolean.TRUE);

        Lesson lesson = FenixFramework.getDomainObject(infoLesson.getExternalId());
        GenericPair<YearMonthDay, YearMonthDay> maxLessonsPeriod = lesson.getShift().getExecutionCourse().getMaxLessonsPeriod();
        if (maxLessonsPeriod != null) {
            request.setAttribute("executionDegreeLessonsStartDate", maxLessonsPeriod.getLeft().toString("dd/MM/yyyy"));
            request.setAttribute("executionDegreeLessonsEndDate", maxLessonsPeriod.getRight().toString("dd/MM/yyyy"));
        }
View Full Code Here

            String action = request.getParameter("action");

            final Shift shift;
            if (action != null && action.equals("edit")) {
                final Lesson lesson = FenixFramework.getDomainObject(infoLesson.getExternalId());
                shift = lesson.getShift();
            } else {
                shift = FenixFramework.getDomainObject(infoShift.getExternalId());
            }
            final GenericPair<YearMonthDay, YearMonthDay> maxLessonsPeriod = shift.getExecutionCourse().getMaxLessonsPeriod();
View Full Code Here

                    final Row row = spreadsheet.addRow();
                    final StringBuilder roomBuilder = new StringBuilder();
                    final StringBuilder scheduleBuilder = new StringBuilder();
                    if (!shift.getAssociatedLessonsSet().isEmpty()) {
                        for (Iterator<Lesson> iterator = shift.getAssociatedLessonsSet().iterator(); iterator.hasNext();) {
                            Lesson lesson = iterator.next();
                            scheduleBuilder.append(WeekDay.getWeekDay(lesson.getDiaSemana()).getLabelShort());
                            scheduleBuilder.append(" ");
                            scheduleBuilder.append(lesson.getBeginHourMinuteSecond().toString("HH:mm"));
                            scheduleBuilder.append(" - ");
                            scheduleBuilder.append(lesson.getEndHourMinuteSecond().toString("HH:mm"));
                            if (lesson.hasSala()) {
                                roomBuilder.append(lesson.getSala().getName());
                            }
                            if (iterator.hasNext()) {
                                scheduleBuilder.append(" ; ");
                                roomBuilder.append(" ; ");
                            }
View Full Code Here

    @Override
    public Object provide(Object source, Object currentValue) {

        SummariesManagementBean bean = (SummariesManagementBean) source;
        Lesson lesson = bean.getLesson();
        Summary summary = bean.getSummary();
        Set<ShiftType> shiftTypes = new HashSet<ShiftType>();

        if (summary != null && summary.getSummaryType() != null) {
            shiftTypes.add(summary.getSummaryType());
        }

        if (lesson != null) {
            shiftTypes.addAll(lesson.getShift().getTypes());
        }

        return shiftTypes;
    }
View Full Code Here

                    return new HtmlText();
                }

                Summary summary = (Summary) object;
                StringBuilder builder = new StringBuilder();
                Lesson lesson = null;

                builder.append(summary.getSummaryDateYearMonthDay().getDayOfMonth()).append("/");
                builder.append(summary.getSummaryDateYearMonthDay().getMonthOfYear()).append("/");
                builder.append(summary.getSummaryDateYearMonthDay().getYear());
                builder.append(" - ").append(RenderUtils.getResourceString("DEFAULT", "label.lesson") + ": ");

                if (summary.isExtraSummary()) {

                    builder.append(RenderUtils.getEnumString(SummaryType.EXTRA_SUMMARY, null)).append(" ");
                    builder.append(" (").append(summary.getSummaryHourHourMinuteSecond().getHour());
                    builder.append(":").append(summary.getSummaryHourHourMinuteSecond().getMinuteOfHour()).append(") ");

                } else {

                    lesson = summary.getLesson();
                    if (lesson != null) {

                        builder.append(lesson.getDiaSemana().toString()).append(" (");
                        builder.append(DateFormatUtil.format("HH:mm", lesson.getInicio().getTime()));
                        builder.append("-").append(DateFormatUtil.format("HH:mm", lesson.getFim().getTime()));
                        builder.append(") ");
                    }
                }
                if (lesson != null && lesson.hasSala()) {
                    builder.append(lesson.getSala().getName());
                }

                return new HtmlText(builder.toString());
            }
        };
View Full Code Here

                builder.append(" ").append(room.getName());
            }
            return builder.toString();
        }

        Lesson lesson = getLesson();
        LessonInstance lessonInstance = lesson.getLessonInstanceFor(getDate());
        return lessonInstance != null ? lessonInstance.prettyPrint() : lesson.prettyPrint();
    }
View Full Code Here

        if (isExtraLesson()) {
            return false;
        }

        Lesson lesson = getLesson();
        if (lesson.isDateValidToInsertSummary(getDate()) && lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), getDate())
                && !getWrittenSummary()) {
            return true;
        }

        return false;
View Full Code Here

        if (year == 0 || month == 0 || day == 0) {
            return null;
        }

        YearMonthDay date = new YearMonthDay(year, month, day);
        Lesson lesson = FenixFramework.getDomainObject(value.substring(8));
        NextPossibleSummaryLessonsAndDatesBean bean = new NextPossibleSummaryLessonsAndDatesBean(lesson, date);

        return bean;
    }
View Full Code Here

TOP

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

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.