コード例 #1
0
  public ActionForward showExecutionDegrees(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    DynaValidatorForm personExecutionCourseForm = (DynaValidatorForm) form;

    String personId = (String) personExecutionCourseForm.get("teacherId");
    Person person = Person.readPersonByUsername(personId);
    setChoosedExecutionPeriod(
        request, ReadNotClosedExecutionPeriods.run(), personExecutionCourseForm);
    InfoExecutionPeriod infoExecutionPeriod =
        (InfoExecutionPeriod) request.getAttribute("infoExecutionPeriod");
    final ExecutionSemester executionPeriod = infoExecutionPeriod.getExecutionPeriod();
    if (executionPeriod.getSemester().intValue() == 2
        && executionPeriod.getExecutionYear().getYear().equals("2010/2011")) {
    } else {
      if (person.getTeacher() == null
          || (person.getTeacher().getTeacherAuthorization(executionPeriod) == null
              && !person.hasRole(RoleType.TEACHER))) {
        request.setAttribute("notAuth", true);
        return showExecutionYearExecutionPeriods(
            mapping, personExecutionCourseForm, request, response);
      }
    }

    prepareSecondStep(personExecutionCourseForm, request);
    personExecutionCourseForm.set("page", new Integer(2));
    return mapping.findForward("second-step");
  }
コード例 #2
0
  private void prepareFirstStep(
      DynaValidatorForm personExecutionCourseForm, HttpServletRequest request)
      throws FenixServiceException {
    prepareConstants(personExecutionCourseForm, request);

    List executionPeriodsNotClosed = ReadNotClosedExecutionPeriods.run();

    setChoosedExecutionPeriod(request, executionPeriodsNotClosed, personExecutionCourseForm);

    BeanComparator initialDateComparator = new BeanComparator("beginDate");
    Collections.sort(executionPeriodsNotClosed, new ReverseComparator(initialDateComparator));

    request.setAttribute("executionPeriods", executionPeriodsNotClosed);
  }