private YearSelection getYearSelection(HttpServletRequest request) {
   String intervalString = request.getParameter("academicInterval");
   if (intervalString == null) {
     intervalString = (String) request.getAttribute("academicInterval");
   }
   if (intervalString != null) {
     AcademicInterval academicInterval =
         AcademicInterval.getAcademicIntervalFromResumedString(intervalString);
     return new YearSelection(academicInterval);
   }
   return getRenderedObject("yearSelection");
 }
Beispiel #2
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();
  }
  public static class YearSelection implements Serializable {
    private AcademicInterval executionYear =
        AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.YEAR).getNextAcademicInterval();

    public YearSelection() {}

    public YearSelection(AcademicInterval executionYear) {
      this.executionYear = executionYear;
    }

    public AcademicInterval getExecutionYear() {
      return executionYear;
    }

    public void setExecutionYear(AcademicInterval executionYear) {
      this.executionYear = executionYear;
    }
  }
 public TutorshipIntentionSelector(
     Teacher teacher,
     Department department,
     DegreeCurricularPlan dcp,
     AcademicInterval academicInterval) {
   this.teacher = teacher;
   this.department = department;
   this.dcp = dcp;
   this.academicInterval = academicInterval;
   TutorshipIntention intention =
       TutorshipIntention.readByDcpAndTeacherAndInterval(dcp, teacher, academicInterval);
   if (intention == null) {
     intending = false;
     deletable = true;
   } else {
     intending = true;
     deletable = intention.isDeletable();
   }
   previousParticipations =
       teacher.getActiveTutorships(academicInterval.getPreviousAcademicInterval()).size();
 }
  public ActionForward prepareTutorSelection(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    AcademicInterval current = AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.YEAR);
    AcademicInterval next =
        AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.YEAR).getNextAcademicInterval();

    if (next == null) {
      request.setAttribute("academicInterval", current.getResumedRepresentationInStringFormat());
    } else {
      request.setAttribute("academicInterval", next.getResumedRepresentationInStringFormat());
    }
    return selectYear(mapping, actionForm, request, response);
  }
 public boolean isActiveForAcademicInterval(AcademicInterval academicInterval) {
   return isActiveForCalendarEntry(academicInterval.getAcademicCalendarEntry());
 }