Package org.fenixedu.spaces.domain

Examples of org.fenixedu.spaces.domain.Space


    }

    private static InfoSiteRoomTimeTable run(RoomKey roomKey, Calendar someDay, String executionPeriodID) throws Exception {
        final Calendar day = new DateTime(someDay.getTimeInMillis()).withField(DateTimeFieldType.dayOfWeek(), 1).toCalendar(null);
        final ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionPeriodID);
        Space room = SpaceUtils.findAllocatableSpaceForEducationByName(roomKey.getNomeSala());
        return RoomSiteComponentBuilder.getInfoSiteRoomTimeTable(day, room,
                executionSemester != null ? executionSemester : ExecutionSemester.readActualExecutionSemester());
    }
View Full Code Here


        FindSpacesBean bean = getRenderedObject("beanWithLabelToSearchID");
        if (bean != null) {

            String labelToSearch = bean.getLabelToSearch();
            Space campus = bean.getCampus();
            Space building = bean.getBuilding();

            if (campus != null && building == null && (labelToSearch == null || StringUtils.isEmpty(labelToSearch.trim()))) {
                addActionMessage(request, "error.findSpaces.empty.building");
                request.setAttribute("bean", bean);
                return mapping.findForward("listFoundSpaces");
View Full Code Here

    }

    public ActionForward viewSpace(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        Space space = getSpaceFromParameter(request);
        if (space != null) {
            setBlueprintTextRectangles(request, space);
            List<Space> containedSpaces =
                    space.getChildren().stream().sorted(SpaceUtils.COMPARATOR_BY_PRESENTATION_NAME).collect(Collectors.toList());
            request.setAttribute("containedSpaces", containedSpaces);
            request.setAttribute("selectedSpace",
                    new FindSpacesBean(space, AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.SEMESTER)));
        }
View Full Code Here

        BigDecimal scalePercentage = getScalePercentage(request);

        DateTime now = new DateTime();

        Space space = getDomainObject(request, "spaceId");

        response.setContentType("text/plain");
        response.setHeader("Content-disposition", "attachment; filename=blueprint.jpeg");
        final ServletOutputStream writer = response.getOutputStream();
View Full Code Here

    }

    private void setBlueprintTextRectangles(HttpServletRequest request, Space space) throws IOException {
        DateTime now = new DateTime();

        Space spaceWithBlueprint = getSuroundingSpaceMostRecentBlueprint(space);

        BlueprintFile mostRecentBlueprint = spaceWithBlueprint.getBlueprintFile().get();

        if (mostRecentBlueprint != null) {

            final byte[] blueprintBytes = mostRecentBlueprint.getContent();
            final InputStream inputStream = new ByteArrayInputStream(blueprintBytes);
View Full Code Here

        String[] availableRoomsId = (String[]) roomSearchForm.get("availableRoomsId");
        String sortParameter = request.getParameter("sortParameter");
        List<InfoRoom> availableRooms = new ArrayList<InfoRoom>();
        for (String element : availableRoomsId) {
            final Space room = FenixFramework.getDomainObject(element);
            availableRooms.add(InfoRoom.newInfoFromDomain(room));
        }
        if ((sortParameter != null) && (sortParameter.length() != 0)) {
            if (sortParameter.equals("name")) {
                Collections.sort(availableRooms, new BeanComparator("nome"));
View Full Code Here

        }

        public void register(final Lesson lesson) {
            final LessonSpaceOccupation lessonSpaceOccupation = lesson.getLessonSpaceOccupation();
            if (lessonSpaceOccupation != null) {
                final Space allocatableSpace = lessonSpaceOccupation.getRoom();
                if (allocatableSpace != null) {
                    final boolean[][] slots = get(allocatableSpace);
                    final int weekDayOffSet = lesson.getDiaSemana().getDiaSemana().intValue() - 2;
                    final int startOffSet = getHourOffSet(lesson.getBeginHourMinuteSecond());
                    final int endOffSet = getHourOffSet(lesson.getEndHourMinuteSecond());
                    for (int i = startOffSet; i < endOffSet; slots[weekDayOffSet][i++] = true) {
                        ;
                    }
                }
            }
            for (final LessonInstance lessonInstance : lesson.getLessonInstancesSet()) {
                final Space allocatableSpace = lessonInstance.getRoom();
                if (allocatableSpace != null) {
                    final boolean[][] slots = get(allocatableSpace);
                    final int weekDayOffSet = lessonInstance.getBeginDateTime().getDayOfWeek() - 1;
                    final int startOffSet = getHourOffSet(lessonInstance.getBeginDateTime());
                    final int endOffSet = getHourOffSet(lessonInstance.getEndDateTime());
View Full Code Here

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

    }

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

                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

Related Classes of org.fenixedu.spaces.domain.Space

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.