Esempio n. 1
0
  /**
   * <br>
   * [機 能] 経路に追加ボタン押下時処理を行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map アクションマッピング
   * @param form アクションフォーム
   * @param req リクエスト
   * @param res レスポンス
   * @param con コネクション
   * @throws Exception 実行時例外
   * @return ActionForward
   */
  private ActionForward __doSetChannel(
      ActionMapping map,
      Rng020Form form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws Exception {

    GsMessage gsMsg = new GsMessage();
    String msg2 = gsMsg.getMessage(req, "rng.25");

    // 経路が選択されていない場合はエラーメッセージを表示
    if (form.getRng020rctSid() < 0) {
      ActionErrors errors = new ActionErrors();
      ActionMessage msg = new ActionMessage("error.select.required.text", msg2);
      StrutsUtil.addMessage(errors, msg, "rng020rctSid");
      addErrors(req, errors);
    } else {
      Rng020ParamModel paramMdl = new Rng020ParamModel();
      paramMdl.setParam(form);
      Rng020Biz biz = new Rng020Biz(con, getRequestModel(req));
      biz.setChannelForTemplate(paramMdl, getSessionUserSid(req));
      paramMdl.setFormData(form);
    }

    return __doDsp(map, form, req, res, con);
  }
Esempio n. 2
0
  /**
   * <br>
   * [機 能] 再表示処理 <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map ActionMapping
   * @param form Rng020Form
   * @param req HttpServletRequest
   * @param res HttpServletResponse
   * @param con DB Connection
   * @return ActionForward
   * @throws Exception 実行時例外
   */
  public ActionForward __doDsp(
      ActionMapping map,
      Rng020Form form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws Exception {

    con.setAutoCommit(true);
    Rng020ParamModel paramMdl = new Rng020ParamModel();
    paramMdl.setParam(form);
    Rng020Biz biz = new Rng020Biz(con, getRequestModel(req));
    biz.setInitData(req, paramMdl, getAppRootPath(), _getRingiDir(req), getSessionUserModel(req));
    paramMdl.setFormData(form);

    // トランザクショントークン設定
    saveToken(req);
    con.setAutoCommit(false);
    return map.getInputForward();
  }
Esempio n. 3
0
  /**
   * <br>
   * [機 能] 添付ファイルダウンロードの処理 <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map アクションマッピング
   * @param form アクションフォーム
   * @param req リクエスト
   * @param res レスポンス
   * @param con コネクション
   * @throws SQLException SQL実行例外
   * @throws Exception 実行時例外
   * @return ActionForward
   */
  private ActionForward __doDownLoad(
      ActionMapping map,
      Rng020Form form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws SQLException, Exception {

    RequestModel reqMdl = getRequestModel(req);
    CommonBiz cmnBiz = new CommonBiz();
    String tempDir = cmnBiz.getTempDir(getTempPath(req), RngConst.PLUGIN_ID_RINGI, reqMdl);
    Rng020Biz biz = new Rng020Biz(reqMdl);
    tempDir = biz.getTemplateFileDir(tempDir);
    String fileId = form.getRng020TemplateFileId();

    // オブジェクトファイルを取得
    ObjectFile objFile = new ObjectFile(tempDir, fileId.concat(GSConstCommon.ENDSTR_OBJFILE));
    Object fObj = objFile.load();
    Cmn110FileModel fMdl = (Cmn110FileModel) fObj;
    // 添付ファイル保存用のパスを取得する(フルパス)
    String filePath = tempDir + fileId.concat(GSConstCommon.ENDSTR_SAVEFILE);
    filePath = IOTools.replaceFileSep(filePath);

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

    // ログ出力処理
    RngBiz rngBiz = new RngBiz(con);
    rngBiz.outPutLog(map, msg, GSConstLog.LEVEL_INFO, fMdl.getFileName(), reqMdl);

    // 時間のかかる処理の前にコネクションを破棄
    JDBCUtil.closeConnectionAndNull(con);
    // ファイルをダウンロードする
    TempFileUtil.downloadAtachment(req, res, filePath, fMdl.getFileName(), Encoding.UTF_8);

    return null;
  }
Esempio n. 4
0
  /**
   * <br>
   * [機 能] 稟議情報登録処理を行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map アクションマッピング
   * @param form アクションフォーム
   * @param req リクエスト
   * @param res レスポンス
   * @param con コネクション
   * @param mode 登録モード 0:申請 1:草稿に保存
   * @throws Exception 実行時例外
   * @return ActionForward
   */
  private ActionForward __doEntry(
      ActionMapping map,
      Rng020Form form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con,
      int mode)
      throws Exception {

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

    // 入力チェックを行う
    ActionErrors errors = null;
    if (mode == 0) {
      errors = form.validateCheck(Rng020Form.CHECKTYPE_REQUEST, req);
    } else if (mode == 1) {
      errors = form.validateCheck(Rng020Form.CHECKTYPE_DRAFT, req);
    }
    if (errors != null && !errors.isEmpty()) {
      addErrors(req, errors);
      return __doDsp(map, form, req, res, con);
    }

    // 新規作成の場合、確認画面へ遷移する。
    if (mode == 0) {
      return map.findForward("rng020kn");
    }
    ActionForward forward = null;
    boolean commit = false;
    PluginConfig pconfig = getPluginConfigForMain(getPluginConfig(req), con);
    CommonBiz cmnBiz = new CommonBiz();
    boolean smailPluginUseFlg = cmnBiz.isCanUsePlugin(GSConstMain.PLUGIN_ID_SMAIL, pconfig);

    try {
      RequestModel reqMdl = getRequestModel(req);
      Rng020ParamModel paramMdl = new Rng020ParamModel();
      paramMdl.setParam(form);
      Rng020Biz biz = new Rng020Biz(con, reqMdl, getSessionUserSid(req));
      biz.entryRingiData(
          paramMdl,
          getCountMtController(req),
          getAppRootPath(),
          _getRingiDir(req),
          mode,
          getPluginConfig(req),
          smailPluginUseFlg,
          getRequestModel(req));
      paramMdl.setFormData(form);

      forward = __setCompPageParam(map, req, form);

      GsMessage gsMsg = new GsMessage(reqMdl);
      String msg = gsMsg.getMessage("cmn.entry");
      String msg2 = gsMsg.getMessage("cmn.save.draft");

      // ログ出力処理
      RngBiz rngBiz = new RngBiz(con);
      String opCode = msg;

      rngBiz.outPutLog(map, opCode, GSConstLog.LEVEL_TRACE, msg2, reqMdl);

      con.commit();
      commit = true;

      // テンポラリディレクトリの削除
      IOTools.deleteDir(_getRingiDir(req));
    } catch (Exception e) {
      log__.error("稟議情報の登録に失敗", e);
      throw e;
    } finally {
      if (!commit) {
        con.rollback();
      }
    }

    return forward;
  }