Exemple #1
0
  public static List<Professorship> readByDegreeCurricularPlansAndExecutionYearAndBasic(
      List<DegreeCurricularPlan> degreeCurricularPlans,
      ExecutionYear executionYear,
      Boolean basic) {

    Set<Professorship> professorships = new HashSet<Professorship>();
    for (DegreeCurricularPlan degreeCurricularPlan : degreeCurricularPlans) {
      for (CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCourses()) {
        if (curricularCourse.getBasic() == null || curricularCourse.getBasic().equals(basic)) {
          if (executionYear != null) {
            for (ExecutionCourse executionCourse :
                curricularCourse.getExecutionCoursesByExecutionYear(executionYear)) {
              professorships.addAll(executionCourse.getProfessorships());
            }
          } else {
            for (ExecutionCourse executionCourse :
                curricularCourse.getAssociatedExecutionCourses()) {
              professorships.addAll(executionCourse.getProfessorships());
            }
          }
        }
      }
    }
    return new ArrayList<Professorship>(professorships);
  }
Exemple #2
0
 public Set<Shift> findAvailableShifts(
     final CurricularYear curricularYear, final ExecutionSemester executionSemester) {
   final DegreeCurricularPlan degreeCurricularPlan = getDegreeCurricularPlan();
   final Set<Shift> shifts = new HashSet<Shift>();
   for (final CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCoursesSet()) {
     if (curricularCourse.hasScopeInGivenSemesterAndCurricularYearInDCP(
         curricularYear, degreeCurricularPlan, executionSemester)) {
       for (final ExecutionCourse executionCourse :
           curricularCourse.getAssociatedExecutionCoursesSet()) {
         if (executionCourse.getExecutionPeriod() == executionSemester) {
           shifts.addAll(executionCourse.getAssociatedShifts());
         }
       }
     }
   }
   return shifts;
 }
Exemple #3
0
  public static List<Professorship> readByDegreeCurricularPlanAndExecutionPeriod(
      DegreeCurricularPlan degreeCurricularPlan, ExecutionSemester executionSemester) {

    Set<Professorship> professorships = new HashSet<Professorship>();
    for (CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCourses()) {
      for (ExecutionCourse executionCourse :
          curricularCourse.getExecutionCoursesByExecutionPeriod(executionSemester)) {
        professorships.addAll(executionCourse.getProfessorships());
      }
    }
    return new ArrayList<Professorship>(professorships);
  }
Exemple #4
0
  public static ExecutionDegree getByDegreeCurricularPlanAndExecutionYear(
      DegreeCurricularPlan degreeCurricularPlan, ExecutionYear executionYear) {
    if (degreeCurricularPlan == null || executionYear == null) {
      return null;
    }

    for (ExecutionDegree executionDegree : degreeCurricularPlan.getExecutionDegreesSet()) {
      if (executionYear == executionDegree.getExecutionYear()) {
        return executionDegree;
      }
    }

    return null;
  }
Exemple #5
0
  public static ExecutionDegree getByDegreeCurricularPlanAndExecutionYear(
      DegreeCurricularPlan degreeCurricularPlan, String executionYear) {
    if (degreeCurricularPlan == null) {
      return null;
    }

    if (executionYear == null) {
      return null;
    }

    for (ExecutionDegree executionDegree : degreeCurricularPlan.getExecutionDegreesSet()) {
      if (executionYear.equalsIgnoreCase(executionDegree.getExecutionYear().getYear())) {
        return executionDegree;
      }
    }

    return null;
  }