Package org.fenixedu.academic.dto

Examples of org.fenixedu.academic.dto.InfoSiteShiftsAndGroups


        String username = userView.getUsername();

        List<InfoExportGrouping> infoExportGroupings = ReadExportGroupingsByGrouping.run(groupPropertiesCodeString);
        request.setAttribute("infoExportGroupings", infoExportGroupings);

        InfoSiteShiftsAndGroups infoSiteShiftsAndGroups;

        try {
            infoSiteShiftsAndGroups = (InfoSiteShiftsAndGroups) ReadShiftsAndGroups.run(groupPropertiesCodeString, username);

        } catch (InvalidSituationServiceException e) {
View Full Code Here


    public InfoSiteStudentGroupAndStudents getInfoSiteStudentGroupAndStudents(InfoSiteStudentGroupAndStudents component,
            String groupPropertiesCode, String shiftCode) throws FenixServiceException {
        List infoSiteStudentsAndShiftByStudentGroupList = readStudentGroupAndStudents(groupPropertiesCode, shiftCode);
        component.setInfoSiteStudentsAndShiftByStudentGroupList(infoSiteStudentsAndShiftByStudentGroupList);

        InfoSiteShiftsAndGroups infoSiteShiftsAndGroups = readShiftAndGroups(groupPropertiesCode, shiftCode);
        component.setInfoSiteShiftsAndGroups(infoSiteShiftsAndGroups);
        return component;
    }
View Full Code Here

    }

    private InfoSiteShiftsAndGroups readShiftAndGroups(String groupPropertiesCode, String shiftCode) throws ExcepcaoInexistente,
            FenixServiceException {

        InfoSiteShiftsAndGroups infoSiteShiftsAndGroups = new InfoSiteShiftsAndGroups();

        Grouping grouping = FenixFramework.getDomainObject(groupPropertiesCode);
        if (grouping == null) {
            return null;
        }

        Shift shift = FenixFramework.getDomainObject(shiftCode);

        List<InfoSiteGroupsByShift> infoSiteGroupsByShiftList = new ArrayList<InfoSiteGroupsByShift>();
        InfoSiteShift infoSiteShift = new InfoSiteShift();
        infoSiteShift.setInfoShift(InfoShift.newInfoFromDomain(shift));

        List allStudentGroups = grouping.readAllStudentGroupsBy(shift);

        if (grouping.getDifferentiatedCapacity()) {
            Integer vagas = shift.getShiftGroupingProperties().getCapacity();
            infoSiteShift.setNrOfGroups(vagas);
        } else {
            if (grouping.getGroupMaximumNumber() != null) {
                int vagas = grouping.getGroupMaximumNumber().intValue() - allStudentGroups.size();
                infoSiteShift.setNrOfGroups(Integer.valueOf(vagas));
            } else {
                infoSiteShift.setNrOfGroups("Sem limite");
            }
        }
        InfoSiteGroupsByShift infoSiteGroupsByShift = new InfoSiteGroupsByShift();
        infoSiteGroupsByShift.setInfoSiteShift(infoSiteShift);

        List<InfoSiteStudentGroup> infoSiteStudentGroupsList = null;
        if (allStudentGroups.size() != 0) {
            infoSiteStudentGroupsList = new ArrayList<InfoSiteStudentGroup>();
            Iterator iterGroups = allStudentGroups.iterator();
            while (iterGroups.hasNext()) {
                InfoSiteStudentGroup infoSiteStudentGroup = new InfoSiteStudentGroup();
                InfoStudentGroup infoStudentGroup = new InfoStudentGroup();
                infoStudentGroup = InfoStudentGroup.newInfoFromDomain((StudentGroup) iterGroups.next());
                infoSiteStudentGroup.setInfoStudentGroup(infoStudentGroup);
                infoSiteStudentGroupsList.add(infoSiteStudentGroup);
            }
            Collections.sort(infoSiteStudentGroupsList, InfoSiteStudentGroup.COMPARATOR_BY_NUMBER);
        }
        infoSiteGroupsByShift.setInfoSiteStudentGroupsList(infoSiteStudentGroupsList);

        infoSiteGroupsByShiftList.add(infoSiteGroupsByShift);
        infoSiteShiftsAndGroups.setInfoSiteGroupsByShiftList(infoSiteGroupsByShiftList);

        return infoSiteShiftsAndGroups;
    }
View Full Code Here

    }

    @Atomic
    public static InfoSiteShiftsAndGroups run(Grouping grouping) {
        checkPermissions(grouping);
        final InfoSiteShiftsAndGroups infoSiteShiftsAndGroups = new InfoSiteShiftsAndGroups();

        final List<InfoSiteGroupsByShift> infoSiteGroupsByShiftList = new ArrayList<InfoSiteGroupsByShift>();
        infoSiteShiftsAndGroups.setInfoSiteGroupsByShiftList(infoSiteGroupsByShiftList);
        infoSiteShiftsAndGroups.setInfoGrouping(InfoGrouping.newInfoFromDomain(grouping));

        final IGroupEnrolmentStrategyFactory enrolmentGroupPolicyStrategyFactory = GroupEnrolmentStrategyFactory.getInstance();
        final IGroupEnrolmentStrategy strategy = enrolmentGroupPolicyStrategyFactory.getGroupEnrolmentStrategyInstance(grouping);

        if (strategy.checkHasShift(grouping)) {
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.InfoSiteShiftsAndGroups

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.