コード例 #1
0
  /**
   * <br>
   * [機 能] アクションを実行する <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map ActionMapping
   * @param form ActionForm
   * @param req HttpServletRequest
   * @param res HttpServletResponse
   * @param con DB Connection
   * @return ActionForward
   * @throws Exception 実行時例外
   * @see jp.groupsession.v2.sml.AbstractSmlAction
   * @see #executeAction(org.apache.struts.action.ActionMapping,
   *     org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
   *     javax.servlet.http.HttpServletResponse, java.sql.Connection)
   */
  public ActionForward executeSmail(
      ActionMapping map,
      ActionForm form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws Exception {

    ActionForward forward = null;
    Sml140knForm thisform = (Sml140knForm) form;

    // 編集可能かを判定
    SmlCommonBiz cmnBiz = new SmlCommonBiz(getRequestModel(req));
    if ((!_checkAuth(map, req, con)) && thisform.getSml140AccountSid() > 0) {
      if (!cmnBiz.canEditAccount(
          con, thisform.getSml140AccountSid(), getSessionUserModel(req).getUsrsid())) {
        return map.findForward("gf_msg");
      }
    }

    // コマンドパラメータ取得
    String cmd = NullDefault.getString(req.getParameter("CMD"), "");
    cmd = cmd.trim();

    // 確定ボタン押下
    if (cmd.equals("delete")) {
      log__.debug("確定ボタン押下");
      forward = __doDelete(map, thisform, req, res, con);
      // 戻るボタン押下
    } else if (cmd.equals("back_syudo_input")) {
      log__.debug("戻るボタン押下");
      forward = map.findForward("back_syudo_input");
      // 初期表示処理
    } else {
      log__.debug("初期表示処理");
      forward = __doInit(map, thisform, req, res, con);
    }

    return forward;
  }
コード例 #2
0
  /**
   * <br>
   * [機 能] 確定ボタンクリック時 <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map ActionMapping
   * @param form フォーム
   * @param req リクエスト
   * @param res レスポンス
   * @param con コネクション
   * @return forward アクションフォワード
   * @throws Exception 実行時例外
   */
  public ActionForward __doDelete(
      ActionMapping map,
      Sml140knForm form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws Exception {

    ActionForward forward = null;

    if (!isTokenValid(req, true)) {
      log__.info("2重投稿");
      forward = getSubmitErrorPage(map, req);
      return forward;
    }

    con.setAutoCommit(false);
    boolean commit = false;
    RequestModel reqMdl = getRequestModel(req);

    try {

      Sml140knParamModel paramMdl = new Sml140knParamModel();
      paramMdl.setParam(form);
      Sml140knBiz biz = new Sml140knBiz(con);
      biz.updateSyudoDelSetting(reqMdl, paramMdl);
      paramMdl.setFormData(form);

      GsMessage gsMsg = new GsMessage(reqMdl);
      String delete = gsMsg.getMessage("cmn.delete");

      // ログ出力処理
      SmlAccountModel sacMdl = new SmlAccountModel();
      SmlAccountDao sacDao = new SmlAccountDao(con);
      sacMdl = sacDao.select(form.getSml140AccountSid());

      String accountName = sacMdl.getSacName();

      if (paramMdl.getSml140SelKbn() != GSConstSmail.ACCOUNT_SEL) {
        accountName = gsMsg.getMessage("wml.wml120.01");
      }

      SmlCommonBiz smlBiz = new SmlCommonBiz(con, reqMdl);
      smlBiz.outPutLog(
          map,
          reqMdl,
          delete,
          GSConstLog.LEVEL_INFO,
          "アカウント:"
              + accountName
              + "\n[value]"
              + form.getSml140JdelKbn()
              + "-"
              + form.getSml140JYear()
              + "-"
              + form.getSml140JMonth()
              + ", "
              + form.getSml140SdelKbn()
              + "-"
              + form.getSml140SYear()
              + "-"
              + form.getSml140SMonth()
              + ", "
              + form.getSml140WdelKbn()
              + "-"
              + form.getSml140WYear()
              + "-"
              + form.getSml140WMonth()
              + ", "
              + form.getSml140DdelKbn()
              + "-"
              + form.getSml140DYear()
              + "-"
              + form.getSml140DMonth());
      commit = true;

      forward = __doCompDsp(map, form, req, res);
      return forward;

    } catch (SQLException e) {
      log__.error("SQLException", e);
      throw e;
    } finally {
      if (commit) {
        con.commit();
      } else {
        JDBCUtil.rollback(con);
      }
    }
  }