示例#1
0
  /**
   * Insert WML_ADM_CONF Data Bindding JavaBean
   *
   * @param bean WML_ADM_CONF Data Bindding JavaBean
   * @throws SQLException SQL実行例外
   */
  public void insert(WmlAdmConfModel bean) throws SQLException {

    PreparedStatement pstmt = null;
    Connection con = null;
    con = getCon();

    try {
      // SQL文
      SqlBuffer sql = new SqlBuffer();
      sql.addSql(" insert ");
      sql.addSql(" into ");
      sql.addSql(" WML_ADM_CONF(");
      sql.addSql("   WAD_ACNT_MAKE,");
      sql.addSql("   WAD_ACCT_SENDFORMAT,");
      sql.addSql("   WAD_ACCT_LOG_REGIST,");
      sql.addSql("   WAD_PERMIT_KBN,");
      sql.addSql("   WAD_AUTO_RECEIVE_TIME,");
      sql.addSql("   WAD_DISK,");
      sql.addSql("   WAD_DISK_SIZE,");
      sql.addSql("   WAD_DISK_COMP,");
      sql.addSql("   WAD_DELRECEIVE,");
      sql.addSql("   WAD_AUTORECEIVE,");
      sql.addSql("   WAD_SEND_HOST,");
      sql.addSql("   WAD_SEND_PORT,");
      sql.addSql("   WAD_SEND_SSL,");
      sql.addSql("   WAD_RECEIVE_HOST,");
      sql.addSql("   WAD_RECEIVE_PORT,");
      sql.addSql("   WAD_RECEIVE_SSL,");
      sql.addSql("   WAD_CHECK_ADDRESS,");
      sql.addSql("   WAD_CHECK_FILE,");
      sql.addSql("   WAD_COMPRESS_FILE,");
      sql.addSql("   WAD_TIMESENT,");
      sql.addSql("   WAD_SEND_LIMIT,");
      sql.addSql("   WAD_SEND_LIMIT_SIZE,");
      sql.addSql("   WAD_FWLIMIT,");
      sql.addSql("   WAD_BCC,");
      sql.addSql("   WAD_BCC_TH,");
      sql.addSql("   WAD_WARN_DISK,");
      sql.addSql("   WAD_WARN_DISK_TH,");
      sql.addSql("   WAD_SETTING_SERVER,");
      sql.addSql("   WAD_PROXY_USER,");
      sql.addSql("   WAD_COMPRESS_FILE_DEF,");
      sql.addSql("   WAD_TIMESENT_DEF");
      sql.addSql(" )");
      sql.addSql(" values");
      sql.addSql(" (");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?");
      sql.addSql(" )");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getWadAcntMake());
      sql.addIntValue(bean.getWadAcctSendformat());
      sql.addIntValue(bean.getWadAcctLogRegist());
      sql.addIntValue(bean.getWadPermitKbn());
      sql.addIntValue(bean.getWadAutoReceiveTime());
      sql.addIntValue(bean.getWadDisk());
      sql.addIntValue(bean.getWadDiskSize());
      sql.addIntValue(bean.getWadDiskComp());
      sql.addIntValue(bean.getWadDelreceive());
      sql.addIntValue(bean.getWadAutoreceive());
      sql.addStrValue(bean.getWadSendHost());
      sql.addIntValue(bean.getWadSendPort());
      sql.addIntValue(bean.getWadSendSsl());
      sql.addStrValue(bean.getWadReceiveHost());
      sql.addIntValue(bean.getWadReceivePort());
      sql.addIntValue(bean.getWadReceiveSsl());
      sql.addIntValue(bean.getWadCheckAddress());
      sql.addIntValue(bean.getWadCheckFile());
      sql.addIntValue(bean.getWadCompressFile());
      sql.addIntValue(bean.getWadTimesent());
      sql.addIntValue(bean.getWadSendLimit());
      sql.addIntValue(bean.getWadSendLimitSize());
      sql.addIntValue(bean.getWadFwlimit());
      sql.addIntValue(bean.getWadBcc());
      sql.addIntValue(bean.getWadBccTh());
      sql.addIntValue(bean.getWadWarnDisk());
      sql.addIntValue(bean.getWadWarnDiskTh());
      sql.addIntValue(bean.getWadSettingServer());
      sql.addIntValue(bean.getWadProxyUser());
      sql.addIntValue(bean.getWadCompressFileDef());
      sql.addIntValue(bean.getWadTimesentDef());

      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
  }
示例#2
0
  /**
   * アカウント設定を更新する
   *
   * @param bean WML_ADM_CONF Data Bindding JavaBean
   * @return 更新件数
   * @throws SQLException SQL実行例外
   */
  public int updateAdmConf(WmlAdmConfModel bean) throws SQLException {

    PreparedStatement pstmt = null;
    int count = 0;
    Connection con = null;
    con = getCon();
    boolean receiveUpFlg = bean.getWadAutoreceive() == GSConstWebmail.MAIL_AUTO_RSV_ON;

    try {
      // SQL文
      SqlBuffer sql = new SqlBuffer();
      sql.addSql(" update");
      sql.addSql("   WML_ADM_CONF");
      sql.addSql(" set ");
      sql.addSql("   WAD_ACNT_MAKE=?,");
      sql.addSql("   WAD_ACCT_SENDFORMAT=?,");
      sql.addSql("   WAD_ACCT_LOG_REGIST=?,");
      sql.addSql("   WAD_PERMIT_KBN=?,");
      if (receiveUpFlg) {
        sql.addSql("   WAD_AUTO_RECEIVE_TIME=?,");
      }
      sql.addSql("   WAD_DISK=?,");
      sql.addSql("   WAD_DISK_SIZE=?,");
      sql.addSql("   WAD_DISK_COMP=?,");
      sql.addSql("   WAD_DELRECEIVE=?,");
      sql.addSql("   WAD_AUTORECEIVE=?,");
      sql.addSql("   WAD_SEND_HOST=?,");
      sql.addSql("   WAD_SEND_PORT=?,");
      sql.addSql("   WAD_SEND_SSL=?,");
      sql.addSql("   WAD_RECEIVE_HOST=?,");
      sql.addSql("   WAD_RECEIVE_PORT=?,");
      sql.addSql("   WAD_RECEIVE_SSL=?,");
      sql.addSql("   WAD_CHECK_ADDRESS=?,");
      sql.addSql("   WAD_CHECK_FILE=?,");
      sql.addSql("   WAD_COMPRESS_FILE=?,");
      sql.addSql("   WAD_TIMESENT=?,");
      sql.addSql("   WAD_SEND_LIMIT=?,");
      sql.addSql("   WAD_SEND_LIMIT_SIZE=?,");
      sql.addSql("   WAD_FWLIMIT=?,");
      sql.addSql("   WAD_BCC=?,");
      sql.addSql("   WAD_BCC_TH=?,");
      sql.addSql("   WAD_WARN_DISK=?,");
      sql.addSql("   WAD_WARN_DISK_TH=?,");
      sql.addSql("   WAD_SETTING_SERVER=?,");
      sql.addSql("   WAD_PROXY_USER=?,");
      sql.addSql("   WAD_COMPRESS_FILE_DEF=?,");
      sql.addSql("   WAD_TIMESENT_DEF=?");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getWadAcntMake());
      sql.addIntValue(bean.getWadAcctSendformat());
      sql.addIntValue(bean.getWadAcctLogRegist());
      sql.addIntValue(bean.getWadPermitKbn());
      if (receiveUpFlg) {
        sql.addIntValue(bean.getWadAutoReceiveTime());
      }
      sql.addIntValue(bean.getWadDisk());
      sql.addIntValue(bean.getWadDiskSize());
      sql.addIntValue(bean.getWadDiskComp());
      sql.addIntValue(bean.getWadDelreceive());
      sql.addIntValue(bean.getWadAutoreceive());
      sql.addStrValue(bean.getWadSendHost());
      sql.addIntValue(bean.getWadSendPort());
      sql.addIntValue(bean.getWadSendSsl());
      sql.addStrValue(bean.getWadReceiveHost());
      sql.addIntValue(bean.getWadReceivePort());
      sql.addIntValue(bean.getWadReceiveSsl());
      sql.addIntValue(bean.getWadCheckAddress());
      sql.addIntValue(bean.getWadCheckFile());
      sql.addIntValue(bean.getWadCompressFile());
      sql.addIntValue(bean.getWadTimesent());
      sql.addIntValue(bean.getWadSendLimit());
      sql.addIntValue(bean.getWadSendLimitSize());
      sql.addIntValue(bean.getWadFwlimit());
      sql.addIntValue(bean.getWadBcc());
      sql.addIntValue(bean.getWadBccTh());
      sql.addIntValue(bean.getWadWarnDisk());
      sql.addIntValue(bean.getWadWarnDiskTh());
      sql.addIntValue(bean.getWadSettingServer());
      sql.addIntValue(bean.getWadProxyUser());
      sql.addIntValue(bean.getWadCompressFileDef());
      sql.addIntValue(bean.getWadTimesentDef());

      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      count = pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
    return count;
  }
示例#3
0
  /**
   * <br>
   * [機 能] 送信メール情報を取得する <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param con コネクション
   * @param reqMdl リクエスト情報
   * @param tempRootDir テンポラリルートディレクトリ
   * @return パラメータ情報
   * @throws SQLException SQL実行時例外
   * @throws IOToolsException 送信メール情報の読み込みに失敗
   */
  public Wml012ParamModel getInitData(Connection con, RequestModel reqMdl, String tempRootDir)
      throws SQLException, IOToolsException {
    File sendMailDataPath = __getSaveFilePath(reqMdl, tempRootDir);
    Wml012ParamModel paramMdl = null;
    if (sendMailDataPath.exists()) {
      ObjectFile objFile = new ObjectFile(sendMailDataPath.getParent(), sendMailDataPath.getName());

      paramMdl = (Wml012ParamModel) objFile.load();
      Map<String, String> domainMap = new HashMap<String, String>();
      domainType__ = 0;
      paramMdl.setWml012ToList(__createAddressList(paramMdl.getWml010sendAddressTo(), domainMap));
      paramMdl.setWml012CcList(__createAddressList(paramMdl.getWml010sendAddressCc(), domainMap));
      paramMdl.setWml012BccList(__createAddressList(paramMdl.getWml010sendAddressBcc(), domainMap));

      paramMdl.setWml012ViewBody(paramMdl.getWml010svSendContent());
      if (paramMdl.getWml010sendMailHtml() != Wml010Const.SEND_HTMLMAIL_HTML) {
        paramMdl.setWml012ViewBody(
            StringUtilHtml.transToHTmlForTextArea(paramMdl.getWml012ViewBody()));
      }

      GsMessage gsMsg = new GsMessage(reqMdl);
      String sendPlanDate = null;

      int sendAccountSid = paramMdl.getWml010sendAccount();
      if (paramMdl.getSendMailPlanType() == Wml010Form.SENDMAILPLAN_TYPE_LATER) {
        sendPlanDate =
            gsMsg.getMessage(
                "cmn.view.date",
                new String[] {
                  paramMdl.getWml010sendMailPlanDateYear(),
                  paramMdl.getWml010sendMailPlanDateMonth(),
                  paramMdl.getWml010sendMailPlanDateDay(),
                  paramMdl.getWml010sendMailPlanDateHour(),
                  paramMdl.getWml010sendMailPlanDateMinute()
                });
      } else {
        int timeSendMinute = 0;

        boolean timsentImm = paramMdl.getWml010sendMailPlanImm() == Wml010Const.SENDPLAN_IMM;
        WmlAdmConfDao admConfDao = new WmlAdmConfDao(con);
        WmlAdmConfModel wmlAdmConf = admConfDao.selectAdmData();

        if (wmlAdmConf.getWadPermitKbn() == GSConstWebmail.PERMIT_ADMIN) {
          // 管理者設定 時間差送信 = 有効 に設定されている
          // かつ、画面上で"即時送信"が選択されていない場合
          if (wmlAdmConf.getWadTimesent() == GSConstWebmail.WAC_TIMESENT_LATER
              || (wmlAdmConf.getWadTimesent() == GSConstWebmail.WAC_TIMESENT_INPUT
                  && !timsentImm)) {
            timeSendMinute = 5;
          }
        } else {
          WmlAccountDao wacDao = new WmlAccountDao(con);
          WmlAccountModel wacMdl = wacDao.select(sendAccountSid);
          if (wacMdl.getWacTimesent() == GSConstWebmail.WAC_TIMESENT_INPUT) {
            if (!timsentImm) {
              timeSendMinute = 5;
            }
          } else {
            WmlBiz wmlBiz = new WmlBiz();
            timeSendMinute = wmlBiz.getTimeSentMinute(con, sendAccountSid);
          }
        }

        if (timeSendMinute > 0) {
          sendPlanDate =
              gsMsg.getMessage("wml.242", new String[] {Integer.toString(timeSendMinute)});
        } else {
          sendPlanDate = gsMsg.getMessage("wml.wml012.01");
        }
      }
      paramMdl.setWml012SendPlanDate(sendPlanDate);

      paramMdl.setWml012TempfileList(__getSendMailFileData(tempRootDir, reqMdl));

      // [宛先、添付ファイルの確認]を設定
      setAccountSendConf(con, paramMdl, sendAccountSid);
    }

    return paramMdl;
  }