package net.sourceforge.fenixedu.presentationTier.Action.vigilancy; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import net.sourceforge.fenixedu.domain.Department; import net.sourceforge.fenixedu.domain.DomainReference; import net.sourceforge.fenixedu.domain.ExecutionCourse; import net.sourceforge.fenixedu.domain.organizationalStructure.CompetenceCourseGroupUnit; import net.sourceforge.fenixedu.domain.organizationalStructure.Unit; import net.sourceforge.fenixedu.domain.vigilancy.VigilantGroup; public class VigilancyCourseGroupBean implements Serializable { private List> courses; private List> coursesToAdd; private DomainReference externalCourse; private DomainReference selectedUnit; private DomainReference selectedDepartment; private DomainReference selectedGroup; private DomainReference selectedCompetenceCourseGroupUnit; public VigilancyCourseGroupBean() { setSelectedUnit(null); setSelectedVigilantGroup(null); setSelectedDepartment(null); setSelectedCompetenceCourseGroupUnit(null); setExternalCourse(null); courses = new ArrayList>(); coursesToAdd = new ArrayList>(); } public ExecutionCourse getExternalCourse() { return externalCourse.getObject(); } public void setExternalCourse(ExecutionCourse course) { externalCourse = new DomainReference(course); } public VigilantGroup getSelectedVigilantGroup() { return this.selectedGroup.getObject(); } public void setSelectedVigilantGroup(VigilantGroup group) { this.selectedGroup = new DomainReference(group); } public Unit getSelectedUnit() { return selectedUnit.getObject(); } public void setSelectedUnit(Unit unit) { this.selectedUnit = new DomainReference(unit); } public CompetenceCourseGroupUnit getSelectedCompetenceCourseGroupUnit() { return selectedCompetenceCourseGroupUnit.getObject(); } public void setSelectedCompetenceCourseGroupUnit(CompetenceCourseGroupUnit unit) { this.selectedCompetenceCourseGroupUnit = new DomainReference(unit); } public Department getSelectedDepartment() { return selectedDepartment.getObject(); } public void setSelectedDepartment(Department department) { this.selectedDepartment = new DomainReference(department); } public List getCourses() { List courses = new ArrayList(); for (DomainReference reference : this.courses) { courses.add((ExecutionCourse) reference.getObject()); } return courses; } public void setCourses(List courses) { this.courses = new ArrayList>(); for (ExecutionCourse course : courses) { this.courses.add(new DomainReference(course)); } } public List getCoursesToAdd() { List courses = new ArrayList(); for (DomainReference reference : this.coursesToAdd) { courses.add((ExecutionCourse) reference.getObject()); } return courses; } public void setCoursesToAdd(List courses) { this.coursesToAdd = new ArrayList>(); for (ExecutionCourse course : courses) { this.coursesToAdd.add(new DomainReference(course)); } } }