コード例 #1
0
 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");
 }
コード例 #2
0
ファイル: ExecutionDegree.java プロジェクト: afesteves/fenix
  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();
  }
コード例 #3
0
  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;
    }
  }
コード例 #4
0
 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();
 }
コード例 #5
0
  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);
  }
コード例 #6
0
 public boolean isActiveForAcademicInterval(AcademicInterval academicInterval) {
   return isActiveForCalendarEntry(academicInterval.getAcademicCalendarEntry());
 }