Example #1
0
  public static List<ExecutionDegree> filterByAcademicInterval(AcademicInterval academicInterval) {
    AcademicCalendarEntry academicCalendarEntry = academicInterval.getAcademicCalendarEntry();
    while (!(academicCalendarEntry instanceof AcademicCalendarRootEntry)) {
      if (academicCalendarEntry instanceof AcademicYearCE) {
        ExecutionYear year = ExecutionYear.getExecutionYear((AcademicYearCE) academicCalendarEntry);
        List<ExecutionDegree> result = new ArrayList<ExecutionDegree>();
        result.addAll(year.getExecutionDegreesSet());
        return result;
      } else {
        academicCalendarEntry = academicCalendarEntry.getParentEntry();
      }
    }

    return Collections.emptyList();
  }
Example #2
0
 @Override
 public Object execute() {
   final ExecutionDegree executionDegree = getExecutionDegree();
   if (executionDegree == null) {
     final ExecutionYear executionYear = getExecutionYear();
     if (executionYear != null) {
       for (final ExecutionDegree otherExecutionDegree :
           executionYear.getExecutionDegreesSet()) {
         execute(otherExecutionDegree);
       }
     }
   } else {
     execute(executionDegree);
   }
   return null;
 }
Example #3
0
 public boolean isActiveForExecutionYear(final ExecutionYear executionYear) {
   for (final ExecutionSemester executionSemester : executionYear.getExecutionPeriodsSet()) {
     if (isActiveForExecutionPeriod(executionSemester)) {
       return true;
     }
   }
   return false;
 }
Example #4
0
  public static List<ExecutionDegree> getAllByExecutionYearAndDegreeType(
      String year, DegreeType... typeOfCourse) {

    if (year == null || typeOfCourse == null) {
      return Collections.emptyList();
    }

    final ExecutionYear executionYear = ExecutionYear.readExecutionYearByName(year);
    return getAllByExecutionYearAndDegreeType(executionYear, typeOfCourse);
  }
Example #5
0
  public static List<ExecutionDegree> getAllByDegreeAndExecutionYear(Degree degree, String year) {
    List<ExecutionDegree> result = new ArrayList<ExecutionDegree>();

    if (degree == null || year == null) {
      return result;
    }

    ExecutionYear executionYear = ExecutionYear.readExecutionYearByName(year);
    if (executionYear == null) {
      return result;
    }

    for (ExecutionDegree executionDegree : executionYear.getExecutionDegreesSet()) {
      if (degree.equals(executionDegree.getDegreeCurricularPlan().getDegree())) {
        result.add(executionDegree);
      }
    }

    return result;
  }
Example #6
0
  public static ExecutionDegree getByDegreeCurricularPlanNameAndExecutionYear(
      String degreeName, ExecutionYear executionYear) {
    if (degreeName == null) {
      return null;
    }

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

    for (ExecutionDegree executionDegree : executionYear.getExecutionDegreesSet()) {
      if (degreeName.equalsIgnoreCase(executionDegree.getDegreeCurricularPlan().getName())) {
        return executionDegree;
      }
    }

    return null;
  }
Example #7
0
  protected ExecutionDegree(
      DegreeCurricularPlan degreeCurricularPlan,
      ExecutionYear executionYear,
      Space campus,
      Boolean publishedExamMap) {
    this();

    if (degreeCurricularPlan == null || executionYear == null || campus == null) {
      throw new DomainException("execution.degree.null.args.to.constructor");
    }

    setDegreeCurricularPlan(degreeCurricularPlan);
    setExecutionYear(executionYear);
    setCampus(campus);

    if (publishedExamMap) {
      getPublishedExamMapsSet().addAll(executionYear.getExecutionPeriodsSet());
    }
  }
Example #8
0
  public static List<ExecutionDegree> getAllByExecutionYearAndDegreeType(
      ExecutionYear executionYear, DegreeType... typeOfCourse) {

    if (executionYear == null || typeOfCourse == null) {
      return Collections.emptyList();
    }

    final List<ExecutionDegree> result = new ArrayList<ExecutionDegree>();
    for (final ExecutionDegree executionDegree : executionYear.getExecutionDegreesSet()) {
      boolean match = false;
      for (DegreeType type : typeOfCourse) {
        match |= type.equals(executionDegree.getDegreeType());
      }
      if (!match) {
        continue;
      }

      result.add(executionDegree);
    }
    Collections.sort(result, COMPARATOR_BY_DEGREE_CURRICULAR_PLAN_ID_INTERNAL_DESC);

    return result;
  }