public class CurriculumGroupsProviderForMoveCurriculumLines implements DataProvider {
@Override
public Object provide(Object source, Object currentValue) {
final CurriculumLineLocationBean bean = (CurriculumLineLocationBean) source;
final Student student = bean.getStudent();
final Set<CurriculumGroup> result = new HashSet<CurriculumGroup>();
for (final Registration registration : student.getRegistrationsSet()) {
if (!registration.isBolonha()) {
result.addAll(registration.getLastStudentCurricularPlan().getAllCurriculumGroups());
continue;
}
final StudentCurricularPlan studentCurricularPlan = registration.getLastStudentCurricularPlan();
result.addAll(studentCurricularPlan.getNoCourseGroupCurriculumGroups());
for (final CycleCurriculumGroup cycle : studentCurricularPlan.getCycleCurriculumGroups()) {
if (bean.isWithRules() && isConcluded(student, cycle)) {
continue;
}
result.addAll(cycle.getAllCurriculumGroups());
}