Package org.fenixedu.spaces.domain

Examples of org.fenixedu.spaces.domain.Space


        if (getLessonInstancesSet().contains(lessonInstance)) {
            removeLessonInstances(lessonInstance);
        }

        Space space = getSpace();
        //final ExecutionCourse executionCourse = lessonInstance.getLesson().getExecutionCourse();
        if (/*!space.isOccupiedByExecutionCourse(executionCourse, lessonInstance.getBeginDateTime(),
                lessonInstance.getEndDateTime())
                &&*//*!space.isFree(lessonInstance.getDay(), lessonInstance.getDay(), lessonInstance.getStartTime(),
                    lessonInstance.getEndTime(), lessonInstance.getDayOfweek(), null, null, null)*/
        !space.isFree(Lists.newArrayList(new Interval[] { new Interval(lessonInstance.getBeginDateTime(), lessonInstance
                .getEndDateTime()) }))) {

            throw new DomainException("error.LessonInstanceSpaceOccupation.room.is.not.free", space.getName(), lessonInstance
                    .getDay().toString("dd-MM-yy"));
        }

        addLessonInstances(lessonInstance);
    }
View Full Code Here


    }

    @Override
    public Space getCampus() {

        Space campus = super.getCampus();

        if (campus != null) {
            return campus;
        }
View Full Code Here

    public abstract Group getAccessGroup();

    public void checkPermissionsToManageSpaceOccupations() {
        User user = Authenticate.getUser();
        Space r = getSpace();
        if (SpaceUtils.personIsSpacesAdministrator(user.getPerson()) || r.getManagementGroupWithChainOfResponsability() != null
                && r.getManagementGroupWithChainOfResponsability().isMember(user)) {
            return;
        }

        final Group group = getAccessGroup();
        if (group != null && group.isMember(user)) {
View Full Code Here

        if (lessonGroup != null && lessonGroup.getMembers().size() > 0
                && (person == null || lessonGroup.isMember(person.getUser()))) {
            return true;
        }

        final Space parent = space.getParent();
        if (parent != null && parent.isActive() && (isRoom(parent) || isRoomSubdivision(parent))) {
            return isForEducation(parent, person);
        }

        return false;
View Full Code Here

            if ((isRoom(subSpace) || isRoomSubdivision(subSpace)) && subSpace.isActive() && isForEducation(subSpace)) {
                result.add(subSpace);
            }
        }
        for (Space subSpace : containedSpaces) {
            Space subSpaceSpace = subSpace;
            result.addAll(getAllActiveSubRoomsForEducation(subSpaceSpace));
        }
        return result;
    }
View Full Code Here

    }

    public static List<Space> getRoomSubdivisions(Space space) {
        List<Space> result = new ArrayList<Space>();
        for (Space subSpaceSpace : space.getChildren()) {
            Space subSpace = subSpaceSpace;
            if (isRoomSubdivision(subSpace)) {
                result.add(subSpace);
            }
        }
        return result;
View Full Code Here

    }

    public static List<Space> getSpaceFullPath(Space space) {
        List<Space> result = new ArrayList<Space>();
        result.add(space);
        Space suroundingSpace = space.getParent();
        while (suroundingSpace != null) {
            result.add(0, suroundingSpace);
            suroundingSpace = suroundingSpace.getParent();
        }
        return result;
    }
View Full Code Here

                            continue;
                        }
                    }

                    if (building != null) {
                        Space spaceBuilding = getSpaceBuilding(space);
                        if (spaceBuilding == null || !spaceBuilding.equals(building)) {
                            continue;
                        }
                    } else if (campus != null) {
                        Space spaceCampus = getSpaceCampus(space);
                        if (spaceCampus == null || !spaceCampus.equals(campus)) {
                            continue;
                        }
                    }

                    result.add(space);
View Full Code Here

        final String enrollmentPeriodEnd = end == null ? null : end.toString("yyyy-MM-dd HH:mm:ss");

        Set<ExecutionCourse> courses = new HashSet<>();
        String writtenEvaluationId = writtenEvaluation.getExternalId();
        if (student != null) {
            Space assignedRoom = null;
            for (ExecutionCourse executionCourse : writtenEvaluation.getAssociatedExecutionCoursesSet()) {
                final Registration registration = executionCourse.getRegistration(student.getPerson());
                final Attends attendsByStudent = executionCourse.getAttendsByStudent(student);
                if (registration != null || attendsByStudent != null) {
                    courses.add(executionCourse);
View Full Code Here

    @Produces(JSON_UTF8)
    @Path("spaces/{id}")
    @FenixAPIPublic
    public FenixSpace spacesByOid(@PathParam("id") String oid, @QueryParam("day") String day) {

        Space space = getDomainObject(oid, Space.class);
        if (SpaceUtils.isRoom(space)) {
            return getFenixRoom(space, getRoomDay(day));
        }
        return FenixSpace.getSpace(space);
    }
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.