Esempio n. 1
0
  /**
   * This method is to save committee schedule when the 'save' button on meeting detail page is
   * clicked.
   */
  public ActionForward save(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    MeetingFormBase meetingFormBase = (MeetingFormBase) form;
    CommitteeScheduleBase committeeSchedule =
        meetingFormBase.getMeetingHelper().getCommitteeSchedule();
    if (isValidToSave(meetingFormBase.getMeetingHelper(), meetingFormBase.isReadOnly())) {
      meetingFormBase.getMeetingHelper().populateAttendancePreSave();
      getMeetingService()
          .saveMeetingDetails(
              committeeSchedule, meetingFormBase.getMeetingHelper().getDeletedBos());
      meetingFormBase.getMeetingHelper().initDeletedList();
    }
    return mapping.findForward(Constants.MAPPING_BASIC);
  }
Esempio n. 2
0
  /** This method is for 'close' button. Confirmation of 'save' is performed. */
  public ActionForward close(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    MeetingFormBase meetingFormBase = (MeetingFormBase) form;
    MeetingFormBase meetingForm = meetingFormBase;
    Object question = request.getParameter(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME);
    if (question == null && meetingForm.getMeetingHelper().canModifySchedule()) {
      return performQuestionWithoutInput(
          mapping,
          form,
          request,
          response,
          CLOSE_QUESTION_ID,
          CLOSE_QUESTION,
          KRADConstants.CONFIRMATION_QUESTION,
          meetingFormBase.getMethodToCall(),
          "");
    } else if (meetingForm.getMeetingHelper().canModifySchedule()) {
      Object buttonClicked = request.getParameter(KRADConstants.QUESTION_CLICKED_BUTTON);
      if ((CLOSE_QUESTION_ID.equals(question)) && ConfirmationQuestion.YES.equals(buttonClicked)) {
        CommitteeScheduleBase committeeSchedule =
            meetingForm.getMeetingHelper().getCommitteeSchedule();
        if (isValidToSave(meetingFormBase.getMeetingHelper(), meetingFormBase.isReadOnly())) {
          meetingFormBase.getMeetingHelper().populateAttendancePreSave();
          getMeetingService()
              .saveMeetingDetails(
                  committeeSchedule, meetingFormBase.getMeetingHelper().getDeletedBos());
          meetingFormBase.getMeetingHelper().initDeletedList();
        } else {
          return mapping.findForward(Constants.MAPPING_BASIC);
        }
      }
    }

    return mapping.findForward(KRADConstants.MAPPING_PORTAL);
  }