Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Shift


        if (!strategy.checkStudentInGrouping(groupProperties, username)) {
            throw new NotAuthorizedException();
        }

        Shift shift = FenixFramework.getDomainObject(shiftCode);
        result = strategy.checkNumberOfGroups(groupProperties, shift);

        if (!result) {
            throw new InvalidArgumentsServiceException();
        }
View Full Code Here


                Set<Shift> shifts = executionCourse.getAssociatedShifts();
                Iterator<Shift> iterator = shifts.iterator();

                while (iterator.hasNext()) {

                    Shift shift = iterator.next();

                    if (shift.containsType(ShiftType.TEORICA)) {
                        theoreticalCapacity = Integer.valueOf(theoreticalCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.TEORICO_PRATICA)) {
                        theoPraticalCapacity = Integer.valueOf(theoPraticalCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.DUVIDAS)) {
                        doubtsCapacity = Integer.valueOf(doubtsCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.LABORATORIAL)) {
                        labCapacity = Integer.valueOf(labCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.PRATICA)) {
                        praticalCapacity = Integer.valueOf(praticalCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.RESERVA)) {
                        reserveCapacity = Integer.valueOf(reserveCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.SEMINARY)) {
                        semCapacity = Integer.valueOf(semCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.PROBLEMS)) {
                        probCapacity = Integer.valueOf(probCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.FIELD_WORK)) {
                        fieldCapacity = Integer.valueOf(fieldCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.TRAINING_PERIOD)) {
                        trainCapacity = Integer.valueOf(trainCapacity.intValue() + shift.getLotacao().intValue());

                    } else if (shift.containsType(ShiftType.TUTORIAL_ORIENTATION)) {
                        tutCapacity = Integer.valueOf(tutCapacity.intValue() + shift.getLotacao().intValue());
                    }
                }

                infoExecutionCourse = InfoExecutionCourse.newInfoFromDomain(executionCourse);
                List<Integer> capacities = new ArrayList<Integer>();
View Full Code Here

        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
        final SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());
        final Collection<Shift> shifts = schoolClass.getAssociatedShiftsSet();

        for (String externalId : shiftOIDs) {
            Shift shift = FenixFramework.getDomainObject(externalId);
            shifts.remove(shift);
        }

        return Boolean.TRUE;
    }
View Full Code Here

        if (newShiftId != null && newShiftId.isEmpty()) {
            return;
        }

        final Shift oldShift = FenixFramework.getDomainObject(oldShiftId);
        final Shift newShift = FenixFramework.getDomainObject(newShiftId);

        if (newShift != null) {
            if (oldShift == null || !oldShift.getTypes().containsAll(newShift.getTypes())
                    || !newShift.getTypes().containsAll(oldShift.getTypes())
                    || !oldShift.getExecutionCourse().equals(newShift.getExecutionCourse())) {
                throw new UnableToTransferStudentsException();
            }
        }

        final Set<Person> recievers = new HashSet<Person>();

        oldShift.getStudentsSet().removeAll(registrations);
        if (newShift != null) {
            newShift.getStudentsSet().addAll(registrations);
        }
        for (final Registration registration : registrations) {
            recievers.add(registration.getPerson());
        }
View Full Code Here

    public static InfoSiteStudentsAndGroups run(String groupPropertiesId, String shiftId) throws FenixServiceException {
        InfoSiteStudentsAndGroups infoSiteStudentsAndGroups = new InfoSiteStudentsAndGroups();

        Grouping groupProperties = FenixFramework.getDomainObject(groupPropertiesId);
        infoSiteStudentsAndGroups.setInfoGrouping(InfoGrouping.newInfoFromDomain(groupProperties));
        Shift shift = FenixFramework.getDomainObject(shiftId);

        if (groupProperties == null) {
            throw new ExistingServiceException();
        }
View Full Code Here

        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);

        final ExecutionSemester executionSemester =
                FenixFramework.getDomainObject(infoShift.getInfoDisciplinaExecucao().getInfoExecutionPeriod().getExternalId());

        final Shift shift = FenixFramework.getDomainObject(infoShift.getExternalId());

        Space room = null;
        if (infoRoomOccupation != null) {
            room =
                    infoRoomOccupation.getInfoRoom() != null ? SpaceUtils
View Full Code Here

        }
        if (registration.getPayedTuition() == null || registration.getPayedTuition().equals(Boolean.FALSE)) {
            throw new FenixServiceException("error.exception.notAuthorized.student.warningTuition");
        }

        final Shift shift = FenixFramework.getDomainObject(shiftId);
        if (shift == null) {
            throw new ShiftNotFoundServiceException();
        }

        shift.removeStudents(registration);
    }
View Full Code Here

        ServiceMonitoring.logService(this.getClass(), registration, shiftId);

        final ShiftEnrollmentErrorReport errorReport = new ShiftEnrollmentErrorReport();

        final Shift selectedShift = FenixFramework.getDomainObject(shiftId);

        if (selectedShift == null) {
            errorReport.getUnExistingShifts().add(shiftId);
            return errorReport;
        }

        if (registration == null || !selectedShift.getExecutionCourse().hasAttendsFor(registration.getStudent())) {
            throw new StudentNotFoundServiceException();
        }

        if (registration.getPayedTuition() == null || registration.getPayedTuition().equals(Boolean.FALSE)) {
            throw new FenixServiceException("error.exception.notAuthorized.student.warningTuition");
        }

        final Shift shiftFromStudent = findShiftOfSameTypeForSameExecutionCourse(registration, selectedShift);

        if (selectedShift != shiftFromStudent) {
            // Registration is not yet enroled, so let's reserve the shift...
            if (selectedShift.reserveForStudent(registration)) {
                if (shiftFromStudent != null) {
                    shiftFromStudent.removeStudents(registration);
                }
            } else {
                errorReport.getUnAvailableShifts().add(selectedShift);
            }
        }
View Full Code Here

public class RemoveClasses {

    @Atomic
    public static Boolean run(InfoShift infoShift, List<String> classOIDs) {
        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
        final Shift shift = FenixFramework.getDomainObject(infoShift.getExternalId());

        for (int i = 0; i < classOIDs.size(); i++) {
            final SchoolClass schoolClass = FenixFramework.getDomainObject(classOIDs.get(i));
            shift.getAssociatedClassesSet().remove(schoolClass);
            schoolClass.getAssociatedShiftsSet().remove(shift);
        }
        return Boolean.TRUE;
    }
View Full Code Here

        StudentGroup studentGroup = FenixFramework.getDomainObject(studentGroupCode);
        if (studentGroup == null) {
            throw new InvalidArgumentsServiceException();
        }

        Shift shift = FenixFramework.getDomainObject(newShiftCode);
        if (groupProperties.getShiftType() == null || studentGroup.getShift() != null
                || (!shift.containsType(groupProperties.getShiftType()))) {
            throw new InvalidStudentNumberServiceException();
        }

        Registration registration = Registration.readByUsername(username);
View Full Code Here

TOP

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

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.