Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.SchoolClass


public class RemoveShifts {

    @Atomic
    public static Boolean run(final InfoClass infoClass, final List<String> shiftOIDs) {
        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);
        }
View Full Code Here


    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

public class AddShiftsToSchoolClass {

    @Atomic
    public static void run(InfoClass infoClass, List<String> shiftOIDs) throws FenixServiceException {
        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
        final SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());
        if (schoolClass == null) {
            throw new InvalidArgumentsServiceException();
        }

        for (final String shiftOID : shiftOIDs) {
            final Shift shift = FenixFramework.getDomainObject(shiftOID);
            if (shift == null) {
                throw new InvalidArgumentsServiceException();
            }
            schoolClass.associateShift(shift);
        }
    }
View Full Code Here

public class LerAulasDeTurma {

    @Atomic
    public static List<InfoLessonInstanceAggregation> run(InfoClass infoClass) {
        final SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());

        final Collection<Shift> shiftList = schoolClass.getAssociatedShiftsSet();

        final List<InfoLessonInstanceAggregation> infoLessonList = new ArrayList<InfoLessonInstanceAggregation>();
        for (final Shift shift : shiftList) {
            infoLessonList.addAll(InfoLessonInstanceAggregation.getAggregations(shift));
        }
View Full Code Here

    @Atomic
    public static Object run(final String externalId, final String className) throws ExistingServiceException {
        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);

        final SchoolClass classToEdit = FenixFramework.getDomainObject(externalId);
        classToEdit.edit(className);
        return InfoClass.newInfoFromDomain(classToEdit);
    }
View Full Code Here

        if (shift == null) {
            throw new InvalidArgumentsServiceException();
        }

        for (final String schoolClassOID : schoolClassOIDs) {
            final SchoolClass schoolClass = FenixFramework.getDomainObject(schoolClassOID);
            if (schoolClass == null) {
                throw new InvalidArgumentsServiceException();
            }

            shift.associateSchoolClass(schoolClass);
View Full Code Here

public class ReadClassByOID {

    @Atomic
    public static InfoClass run(String oid) throws FenixServiceException {
        InfoClass result = null;
        SchoolClass turma = FenixFramework.getDomainObject(oid);
        if (turma != null) {
            result = InfoClass.newInfoFromDomain(turma);
        }

        return result;
View Full Code Here

public class ReadShiftsByClass {

    @Atomic
    public static Object run(InfoClass infoClass) {
        check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
        SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());

        Collection<Shift> shifts = schoolClass.getAssociatedShiftsSet();

        return CollectionUtils.collect(shifts, new Transformer() {
            @Override
            public Object transform(Object arg0) {
                Shift shift = (Shift) arg0;
View Full Code Here

        if (schoolClassesToEnrol.isEmpty()) {
            return mapping.findForward("prepareShiftEnrollment");
        }

        final SchoolClass schoolClass = setSelectedSchoolClass(request, classIdSelected, schoolClassesToEnrol);

        final User userView = getUserView(request);

        final List<InfoShowOccupation> infoClasslessons =
                ReadClassTimeTableByStudent.runReadClassTimeTableByStudent(registration, schoolClass, executionCourse);
View Full Code Here

    }

    private SchoolClass setSelectedSchoolClass(HttpServletRequest request, final String classIdSelected,
            final List<SchoolClass> schoolClassesToEnrol) {

        final SchoolClass schoolClass =
                (classIdSelected != null) ? searchSchoolClassFrom(schoolClassesToEnrol, classIdSelected) : schoolClassesToEnrol
                        .iterator().next();
        request.setAttribute("selectedSchoolClass", schoolClass);

        return schoolClass;
View Full Code Here

TOP

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

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.