@Atomic public static List run( String executionDegreeId, String executionPeriodId, Integer curricularYearInt) throws FenixServiceException { if (executionPeriodId == null) { throw new FenixServiceException("nullExecutionPeriodId"); } final ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionPeriodId); final List<ExecutionCourse> executionCourseList; if (executionDegreeId == null && curricularYearInt == null) { executionCourseList = executionSemester.getExecutionCoursesWithNoCurricularCourses(); } else { final ExecutionDegree executionDegree = findExecutionDegreeByID(executionSemester, executionDegreeId); final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan(); final CurricularYear curricularYear = CurricularYear.readByYear(curricularYearInt); executionCourseList = executionSemester .getExecutionCoursesByDegreeCurricularPlanAndSemesterAndCurricularYearAndName( degreeCurricularPlan, curricularYear, "%"); } final List infoExecutionCourseList = new ArrayList(executionCourseList.size()); for (final ExecutionCourse executionCourse : executionCourseList) { infoExecutionCourseList.add(InfoExecutionCourse.newInfoFromDomain(executionCourse)); } return infoExecutionCourseList; }
public List<InfoExecutionCourse> run( InfoExecutionPeriod infoExecutionPeriod, InfoExecutionDegree infoExecutionDegree, InfoCurricularYear infoCurricularYear, String executionCourseName) { List<InfoExecutionCourse> result = null; final ExecutionSemester executionSemester = FenixFramework.getDomainObject(infoExecutionPeriod.getExternalId()); ExecutionDegree executionDegree = null; if (infoExecutionDegree != null) { executionDegree = FenixFramework.getDomainObject(infoExecutionDegree.getExternalId()); } CurricularYear curricularYear = null; if (infoCurricularYear != null) { curricularYear = FenixFramework.getDomainObject(infoCurricularYear.getExternalId()); } List<ExecutionCourse> executionCourses = new ArrayList<ExecutionCourse>(); if (executionSemester != null) { executionCourses = executionSemester .getExecutionCoursesByDegreeCurricularPlanAndSemesterAndCurricularYearAndName( executionDegree.getDegreeCurricularPlan(), curricularYear, executionCourseName); } return fillInfoExecutionCourses(executionSemester.getAcademicInterval(), executionCourses); }