package net.sourceforge.fenixedu.presentationTier.renderers.providers; import java.util.Collections; import pt.ist.fenixWebFramework.renderers.DataProvider; import pt.ist.fenixWebFramework.renderers.components.converters.Converter; import net.sourceforge.fenixedu.presentationTier.renderers.converters.DomainObjectKeyConverter; public class CurricularYearsSelectSearchStudentsWithEnrolmentsByDepartment implements DataProvider { public Object provide(Object source, Object currentValue) { /* CurricularPeriodType curricularPeriodType = null; if (source instanceof RegistrationCurricularYearBean) { final RegistrationCurricularYearBean bean = (RegistrationCurricularYearBean) source; final Registration registration = bean.getRegistration(); final StudentCurricularPlan studentCurricularPlan = registration.getStudentCurricularPlan(bean.getExecutionYear()); curricularPeriodType = studentCurricularPlan.getDegreeCurricularPlan().getDegreeStructure().getPeriodType(); } else if (source instanceof SearchStudentsWithEnrolmentsByDepartment) { final SearchStudentsWithEnrolmentsByDepartment bean = (SearchStudentsWithEnrolmentsByDepartment) source; if (bean.getExecutionYear() != null && bean.getDegree() != null) { curricularPeriodType = bean.getDegree().getDegreeCurricularPlansForYear(bean.getExecutionYear()).iterator() .next().getDegreeStructure().getPeriodType(); } } if (curricularPeriodType == null) { return Collections.EMPTY_LIST; } List curricularYears = new ArrayList(); int years = Float.valueOf(curricularPeriodType.getWeight()).intValue(); for (int i = 1; i <= years; i++) { curricularYears.add(RootDomainObject.getInstance().readCurricularYearByOID(i)); } return curricularYears;*/ return Collections.EMPTY_LIST; } public Converter getConverter() { return new DomainObjectKeyConverter(); } }