package net.sourceforge.fenixedu.domain.studentCurriculum; import java.util.Collection; import net.sourceforge.fenixedu.dataTransferObject.administrativeOffice.dismissal.ISCTEDismissalBean.DismissalType; import net.sourceforge.fenixedu.dataTransferObject.administrativeOffice.dismissal.ISCTEDismissalBean.SelectedCurriculumEntry; import net.sourceforge.fenixedu.dataTransferObject.administrativeOffice.dismissal.ISCTEDismissalBean.SelectedDismissalEntry; import net.sourceforge.fenixedu.domain.ExecutionPeriod; import net.sourceforge.fenixedu.domain.Grade; import net.sourceforge.fenixedu.domain.StudentCurricularPlan; import net.sourceforge.fenixedu.domain.degreeStructure.CourseGroup; import net.sourceforge.fenixedu.domain.exceptions.DomainException; import pt.iscte.ci.metadata.ISCTE; /** * * @author pacza * @author rjmvo * */ public class CurricularIntegration extends CurricularIntegration_Base { protected CurricularIntegration() { super(); } public CurricularIntegration(StudentCurricularPlan scp, Collection enrolments, Collection dismissals, ExecutionPeriod executionPeriod) { this(); init(scp, executionPeriod, enrolments, dismissals, calculateAverateForEnrolmentEntries(enrolments)); } public CurricularIntegration(StudentCurricularPlan scp, Collection enrolments, Collection dismissals, ExecutionPeriod executionPeriod, boolean checkGivenCredits) { this(); init(scp, executionPeriod, enrolments, dismissals, calculateAverateForEnrolmentEntries(enrolments), checkGivenCredits); } public CurricularIntegration(StudentCurricularPlan scp, ExecutionPeriod executionPeriod, Collection enrolments, Collection dismissals, Grade grade) { this(); init(scp, executionPeriod, enrolments, dismissals, grade); } public CurricularIntegration(StudentCurricularPlan scp, ExecutionPeriod executionPeriod, Collection enrolments, Collection dismissals, CourseGroup courseGroup, Double givenCredits, Double weight, Grade grade) { this(); init(scp, executionPeriod, enrolments, dismissals, courseGroup, givenCredits, weight, grade); } public CurricularIntegration(StudentCurricularPlan scp, ExecutionPeriod executionPeriod, Collection enrolments, CurriculumGroup curriculumGroup, Double credits, Grade grade) { this(); init(scp, executionPeriod, enrolments, curriculumGroup, credits, grade); } @Override public boolean isCurricularIntegration() { return true; } @Override protected boolean checkGrade() { return true; } @Override public void setGrade(Grade grade) { if (grade == null) { throw new DomainException("error.CurricularIntegration.grade.cannot.be.null"); } super.setGrade(grade); } public static Credits createDismissal(StudentCurricularPlan scp, CourseGroup courseGroup, CurriculumGroup curriculumGroup, Collection enrolments, Collection dismissals, ExecutionPeriod executionPeriod, Double givenCredits, Double weight, Grade givenGrade, DismissalType type) { switch (type) { case CURRICULAR_COURSE_CREDITS: return new CurricularIntegration(scp, executionPeriod, enrolments, dismissals, givenGrade); case CURRICULUM_GROUP_CREDITS: return new CurricularIntegration(scp, executionPeriod, enrolments, dismissals, courseGroup, givenCredits, weight, givenGrade); case NO_COURSE_GROUP_CURRICULUM_GROUP_CREDITS: return new CurricularIntegration(scp, executionPeriod, enrolments, curriculumGroup, givenCredits, givenGrade); } return null; } @ISCTE(author = "Nadir Amin") @Override public String getShortTypeDescription() { return "CI"; } }