Examples of OccupationPeriodReference


Examples of org.fenixedu.academic.domain.OccupationPeriodReference

        Map<ExecutionDegree, CurricularYearList> degreeMap = extractCourses(parameter);

        // Step 1, Remove non-existing references
        for (Iterator<OccupationPeriodReference> references = getReferences().iterator(); references.hasNext();) {
            OccupationPeriodReference reference = references.next();
            if (!degreeMap.containsKey(reference.getExecutionDegree())) {
                reference.delete();
                references.remove();
            }
        }

        // Step 2, Add new references, and update old ones
        for (final Entry<ExecutionDegree, CurricularYearList> entry : degreeMap.entrySet()) {
            OccupationPeriodReference reference = null;

            for (OccupationPeriodReference ref : getReferences()) {
                if (ref.getExecutionDegree().equals(entry.getKey())) {
                    reference = ref;
                    break;
                }
            }

            if (reference == null) {
                references.add(new OccupationPeriodReference(occupationPeriod, entry.getKey(), occupationPeriodType, semester,
                        entry.getValue()));
            } else {
                reference.setOccupationPeriod(occupationPeriod);
                reference.setPeriodType(occupationPeriodType);
                reference.setSemester(semester);
                reference.setCurricularYears(entry.getValue());
            }

        }

    }
View Full Code Here

Examples of org.fenixedu.academic.domain.OccupationPeriodReference

        newBean.setIntervals(intervals);
        newBean.setOccupationPeriod(occupationPeriod);
        newBean.setSemester(semester);

        for (OccupationPeriodReference reference : references) {
            newBean.addReference(new OccupationPeriodReference(reference.getOccupationPeriod(), reference.getExecutionDegree(),
                    newPeriodType, semester, reference.getCurricularYears()));
        }

        return newBean;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.