Examples of InfoLesson


Examples of org.fenixedu.academic.dto.InfoLesson

    @Override
    public StringBuilder lastRender(LessonSlot lessonSlot, String context) {
        StringBuilder strBuffer = new StringBuilder();
        InfoShowOccupation showOccupation = lessonSlot.getInfoLessonWrapper().getInfoShowOccupation();
        if (showOccupation instanceof InfoLesson) {
            InfoLesson lesson = (InfoLesson) showOccupation;
            strBuffer.append(getURL(lesson.getInfoShift().getShift(), context));
            strBuffer.append("<img src=\"").append(context).append("/images/").append(getImage()).append("\"/>").append("</a>");
        } else if (showOccupation instanceof InfoLessonInstanceAggregation) {
            final InfoLessonInstanceAggregation infoLessonInstanceAggregation = (InfoLessonInstanceAggregation) showOccupation;
            strBuffer.append(getURL(infoLessonInstanceAggregation.getShift(), context));
            strBuffer.append("<img src=\"").append(context).append("/images/").append(getImage()).append("\"/>").append("</a>");
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

        StringBuilder strBuffer = new StringBuilder();
        InfoShowOccupation showOccupation = lessonSlot.getInfoLessonWrapper().getInfoShowOccupation();

        if (showOccupation instanceof InfoLesson) {

            InfoLesson lesson = (InfoLesson) showOccupation;

            InfoExecutionCourse infoExecutionCourse = lesson.getInfoShift().getInfoDisciplinaExecucao();

            String siteUrl = infoExecutionCourse.getExecutionCourse().getSiteUrl();

            if (Strings.isNullOrEmpty(siteUrl)) {
                strBuffer.append(infoExecutionCourse.getSigla());
            } else {
                strBuffer.append(GenericChecksumRewriter.NO_CHECKSUM_PREFIX);
                strBuffer.append("<a href=\"").append(context);
                strBuffer.append(siteUrl);
                strBuffer.append("\">");
                strBuffer.append(infoExecutionCourse.getSigla()).append("</a>");
            }
            strBuffer.append("&nbsp;").append("&nbsp;(").append(lesson.getInfoShift().getShiftTypesCodePrettyPrint())
                    .append(")&nbsp;");

            if (lesson.getFrequency().equals(FrequencyType.BIWEEKLY)) {
                strBuffer.append("&nbsp;&nbsp;[Q]");
            }

        } else if (showOccupation instanceof InfoLessonInstance) {

            InfoLessonInstance lesson = (InfoLessonInstance) showOccupation;

            InfoExecutionCourse infoExecutionCourse = lesson.getInfoShift().getInfoDisciplinaExecucao();

            final String siteUrl = infoExecutionCourse.getExecutionCourse().getSiteUrl();

            if (Strings.isNullOrEmpty(siteUrl)) {
                strBuffer.append(infoExecutionCourse.getSigla());
            } else {
                strBuffer.append(GenericChecksumRewriter.NO_CHECKSUM_PREFIX);
                strBuffer.append("<a href=\"").append(context);
                strBuffer.append(siteUrl);
                strBuffer.append("\">");
                strBuffer.append(infoExecutionCourse.getSigla()).append("</a>");
            }
            strBuffer.append("&nbsp;").append("&nbsp;(").append(lesson.getInfoShift().getShiftTypesCodePrettyPrint())
                    .append(")&nbsp;");

        } else if (showOccupation instanceof InfoExam) {
            InfoExam infoExam = (InfoExam) showOccupation;
            for (int iterEC = 0; iterEC < infoExam.getAssociatedExecutionCourse().size(); iterEC++) {
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

            buffer = buffer.append("&nbsp;");
        } else {
            Iterator iterator = this.lessonViewList.iterator();
            while (iterator.hasNext()) {

                InfoLesson infoLesson = (InfoLesson) iterator.next();

                buffer = buffer.append(infoLesson.getInfoShift().getInfoDisciplinaExecucao().getSigla());
                buffer = buffer.append(" (").append(infoLesson.getInfoShift().getShiftTypesCodePrettyPrint());
                buffer = buffer.append(") ");
                final Space allocatableSpace = infoLesson.getAllocatableSpace();
                if (allocatableSpace != null) {
                    buffer = buffer.append(allocatableSpace.getName());
                }
                if (iterator.hasNext()) {
                    buffer.append("<br/>");
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

        // lessonSlot.getInfoLessonWrapper().getInfoLesson();
        InfoShowOccupation showOccupation = lessonSlot.getInfoLessonWrapper().getInfoShowOccupation();

        if (showOccupation instanceof InfoLesson) {

            InfoLesson lesson = (InfoLesson) showOccupation;

            strBuffer.append(lesson.getInfoShift().getShiftTypesCodePrettyPrint()).append("&nbsp;");
            if (lesson.getInfoSala() != null) {
                strBuffer.append("<a href='").append(context).append("/publico/");
                strBuffer.append("siteViewer.do?method=roomViewer&amp;roomName=");
                strBuffer.append(lesson.getInfoSala().getNome()).append("&amp;objectCode=");
                strBuffer.append(lesson.getInfoShift().getInfoDisciplinaExecucao().getInfoExecutionPeriod().getExternalId());
                strBuffer.append("&amp;executionPeriodOID=");
                strBuffer.append(lesson.getInfoShift().getInfoDisciplinaExecucao().getInfoExecutionPeriod().getExternalId())
                        .append("'>");
                strBuffer.append(lesson.getInfoSala().getNome()).append("</a>");
            }

            if (lesson.getFrequency().equals(FrequencyType.BIWEEKLY)) {
                strBuffer.append("&nbsp;&nbsp;[Q]");
            }

        } else if (showOccupation instanceof InfoLessonInstance) {

            InfoLessonInstance lesson = (InfoLessonInstance) showOccupation;

            strBuffer.append(lesson.getShiftTypeCodesPrettyPrint()).append("&nbsp;");
            final Space allocatableSpace = lesson.getAllocatableSpace();
            if (allocatableSpace != null) {
                strBuffer.append("<a href='").append(context).append("/publico/");
                strBuffer.append("siteViewer.do?method=roomViewer&amp;roomName=");
                strBuffer.append(allocatableSpace.getName()).append("&amp;objectCode=");
                strBuffer.append(lesson.getInfoShift().getInfoDisciplinaExecucao().getInfoExecutionPeriod().getExternalId());
                strBuffer.append("&amp;executionPeriodOID=");
                strBuffer.append(lesson.getInfoShift().getInfoDisciplinaExecucao().getInfoExecutionPeriod().getExternalId())
                        .append("'>");
                strBuffer.append(allocatableSpace.getName()).append("</a>");

            }
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

        StringBuilder strBuffer = new StringBuilder();
        InfoShowOccupation showOccupation = lessonSlot.getInfoLessonWrapper().getInfoShowOccupation();

        if (showOccupation instanceof InfoLesson) {

            InfoLesson lesson = (InfoLesson) showOccupation;
            final InfoExecutionCourse infoExecutionCourse = lesson.getInfoShift().getInfoDisciplinaExecucao();
            String siteUrl = infoExecutionCourse.getExecutionCourse().getSiteUrl();

            if (Strings.isNullOrEmpty(siteUrl)) {
                strBuffer.append(infoExecutionCourse.getSigla());
            } else {
                strBuffer.append(GenericChecksumRewriter.NO_CHECKSUM_PREFIX);
                strBuffer.append("<a href=\"").append(context);
                strBuffer.append(siteUrl);
                strBuffer.append("\">");
                strBuffer.append(infoExecutionCourse.getSigla()).append("</a>");
            }

            strBuffer.append("&nbsp;").append("&nbsp;(").append(lesson.getInfoShift().getShiftTypesCodePrettyPrint())
                    .append(")&nbsp;");

            final Space allocatableSpace = lesson.getAllocatableSpace();
            if (allocatableSpace != null) {
                strBuffer.append(allocatableSpace.getName());
            }

            return strBuffer;

        } else if (showOccupation instanceof InfoLessonInstance) {

            InfoLessonInstance lesson = (InfoLessonInstance) showOccupation;
            final InfoExecutionCourse infoExecutionCourse = lesson.getInfoShift().getInfoDisciplinaExecucao();
            String siteUrl = infoExecutionCourse.getExecutionCourse().getSiteUrl();

            if (Strings.isNullOrEmpty(siteUrl)) {
                strBuffer.append(infoExecutionCourse.getSigla());
            } else {
                strBuffer.append(GenericChecksumRewriter.NO_CHECKSUM_PREFIX);
                strBuffer.append("<a href=\"").append(context);
                strBuffer.append(siteUrl);
                strBuffer.append("\">");
                strBuffer.append(infoExecutionCourse.getSigla()).append("</a>");
            }
            strBuffer.append("&nbsp;").append("&nbsp;(").append(lesson.getShiftTypeCodesPrettyPrint()).append(")&nbsp;");

            if (lesson.getInfoRoomOccupation() != null) {
                strBuffer.append(lesson.getInfoRoomOccupation().getInfoRoom().getNome());
            }

            return strBuffer;

        } else if (showOccupation instanceof InfoLessonInstanceAggregation) {
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

    }

    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);
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

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

        DynaActionForm manageLessonForm = (DynaActionForm) form;

        InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);

        manageLessonForm.set("diaSemana", infoLesson.getDiaSemana().getDiaSemana().toString());
        manageLessonForm.set("horaInicio", "" + infoLesson.getInicio().get(Calendar.HOUR_OF_DAY));
        manageLessonForm.set("minutosInicio", "" + infoLesson.getInicio().get(Calendar.MINUTE));
        manageLessonForm.set("horaFim", "" + infoLesson.getFim().get(Calendar.HOUR_OF_DAY));
        manageLessonForm.set("minutosFim", "" + infoLesson.getFim().get(Calendar.MINUTE));

        final Space allocatableSpace = infoLesson.getAllocatableSpace();
        if (allocatableSpace != null) {
            manageLessonForm.set("nomeSala", "" + allocatableSpace.getName());
        }

        if (infoLesson.getFrequency().equals(FrequencyType.BIWEEKLY)) {
            manageLessonForm.set("quinzenal", Boolean.TRUE);
        }

        if (infoLesson.getLessonBegin() != null) {
            manageLessonForm.set("newBeginDate", infoLesson.getLessonBegin().toString("dd/MM/yyyy"));
        }
        if (infoLesson.getLessonEnd() != null) {
            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

Examples of org.fenixedu.academic.dto.InfoLesson

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

        final InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
        final Interval[] intervals = infoLesson.getLesson().getAllLessonIntervals().toArray(new Interval[0]);
        final List<Space> emptySpaces = SpaceUtils.allocatableSpace(null, true, intervals);
        Collections.sort(emptySpaces, SpaceUtils.COMPARATOR_BY_PRESENTATION_NAME);
        request.setAttribute("emptySpaces", emptySpaces);

        return mapping.findForward("ChangeRoom");
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

        return mapping.findForward("ChangeRoom");
    }

    public ActionForward changeRoom(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        final InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
        final Space space = getDomainObject(request, "spaceOID");

        try {
            EditLesson.run(infoLesson.getLesson(), space);
        } catch (final DomainException domainException) {
            final ActionErrors actionErrors = new ActionErrors();
            actionErrors.add(domainException.getMessage(),
                    new ActionError(domainException.getMessage(), domainException.getArgs()));
            saveErrors(request, actionErrors);
View Full Code Here

Examples of org.fenixedu.academic.dto.InfoLesson

                frequency = FrequencyType.BIWEEKLY;
            } else {
                frequency = FrequencyType.WEEKLY;
            }

            InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
            InfoShift infoShift = (InfoShift) request.getAttribute(PresentationConstants.SHIFT);

            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();

            YearMonthDay lessonNewBeginDate = getDateFromForm(manageLessonForm, "newBeginDate");
            YearMonthDay lessonEndDate = getDateFromForm(manageLessonForm, "newEndDate");

            List<InfoRoom> emptyRoomsList = null;

            if (lessonEndDate != null) {

                YearMonthDay executionDegreeLessonsBeginDate = maxLessonsPeriod.getLeft();
                YearMonthDay executionDegreeLessonsEndDate = maxLessonsPeriod.getRight();

                if (lessonNewBeginDate == null || lessonNewBeginDate.isAfter(lessonEndDate)
                        || lessonNewBeginDate.isBefore(executionDegreeLessonsBeginDate)) {
                    actionErrors.add("error.Lesson.invalid.new.begin.date",
                            new ActionError("error.Lesson.invalid.new.begin.date"));
                    saveErrors(request, actionErrors);
                    return mapping.getInputForward();
                }

                if (lessonEndDate.isAfter(executionDegreeLessonsEndDate)) {
                    actionErrors.add("error.Lesson.invalid.new.end.date", new ActionError("error.Lesson.invalid.new.end.date"));
                    saveErrors(request, actionErrors);
                    return mapping.getInputForward();
                }

                emptyRoomsList =
                        SpaceUtils.allocatableSpace(lessonNewBeginDate, lessonEndDate,
                                HourMinuteSecond.fromCalendarFields(inicio), HourMinuteSecond.fromCalendarFields(fim), weekDay,
                                null, frequency, true);

            } else if (action != null && action.equals("edit")) {
                actionErrors.add("error.Lesson.already.finished", new ActionError("error.Lesson.already.finished"));
                saveErrors(request, actionErrors);
                return mapping.getInputForward();

            } else {
                actionErrors.add("error.executionDegree.empty.lessonsPeriod", new ActionError(
                        "error.executionDegree.empty.lessonsPeriod"));
                saveErrors(request, actionErrors);
                return mapping.getInputForward();
            }

            if (emptyRoomsList == null || emptyRoomsList.isEmpty()) {
                actionErrors.add("search.empty.rooms.no.rooms", new ActionError("search.empty.rooms.no.rooms"));
                saveErrors(request, actionErrors);
                return mapping.getInputForward();
            }

            if (action != null && action.equals("edit")) {
                final InfoLesson il = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
                final Space allocatableSpace = il.getAllocatableSpace();
                if (allocatableSpace != null) {
                    emptyRoomsList.add(infoLesson.getInfoRoomOccupation().getInfoRoom());
                    manageLessonForm.set("nomeSala", infoLesson.getInfoRoomOccupation().getInfoRoom().getNome());
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.