protected List<SelectItem> readExecutionYearItems() { final List<SelectItem> result = new ArrayList<SelectItem>(); final Collection<ExecutionDegree> executionDegrees = getDegreeCurricularPlan().getExecutionDegreesSet(); if (executionDegrees.isEmpty()) { final ExecutionYear executionYear = getDegreeCurricularPlan().getRoot().getMinimumExecutionPeriod().getExecutionYear(); result.add(new SelectItem(executionYear.getExternalId(), executionYear.getYear())); return result; } for (ExecutionDegree executionDegree : executionDegrees) { result.add( new SelectItem( executionDegree.getExecutionYear().getExternalId(), executionDegree.getExecutionYear().getYear())); } if (getExecutionYearID() == null) { setExecutionYearID( getDegreeCurricularPlan() .getMostRecentExecutionDegree() .getExecutionYear() .getExternalId()); } return result; }
private ExecutionDegree getExecutionDegree() { if (this.executionDegree == null) { for (final ExecutionDegree executionDegree : getDegreeCurricularPlan().getExecutionDegreesSet()) { if (executionDegree.getExecutionYear() == getExecutionPeriod().getExecutionYear()) { return (this.executionDegree = executionDegree); } } } return this.executionDegree; }
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; }
public static List<ExecutionDegree> getAllByExecutionYear(String year) { if (year == null) { return Collections.emptyList(); } final List<ExecutionDegree> result = new ArrayList<ExecutionDegree>(); for (ExecutionDegree executionDegree : Bennu.getInstance().getExecutionDegreesSet()) { if (year.equals(executionDegree.getExecutionYear().getYear())) { result.add(executionDegree); } } Collections.sort(result, COMPARATOR_BY_DEGREE_CURRICULAR_PLAN_ID_INTERNAL_DESC); return result; }
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; }
@Override public int compare(ExecutionDegree o1, ExecutionDegree o2) { return o1.getExecutionYear().compareTo(o2.getExecutionYear()); }
@Override public int compareTo(ExecutionDegree executionDegree) { final ExecutionYear executionYear = executionDegree.getExecutionYear(); return getExecutionYear().compareTo(executionYear); }