Example #1
0
 /**
  * Create WML_ADM_CONF Data Bindding JavaBean From ResultSet
  *
  * @param rs ResultSet
  * @return created WmlAdmConfModel
  * @throws SQLException SQL実行例外
  */
 private WmlAdmConfModel __getWmlAdmConfFromRs(ResultSet rs) throws SQLException {
   WmlAdmConfModel bean = new WmlAdmConfModel();
   bean.setWadAcntMake(rs.getInt("WAD_ACNT_MAKE"));
   bean.setWadAcctSendformat(rs.getInt("WAD_ACCT_SENDFORMAT"));
   bean.setWadAcctLogRegist(rs.getInt("WAD_ACCT_LOG_REGIST"));
   bean.setWadPermitKbn(rs.getInt("WAD_PERMIT_KBN"));
   bean.setWadAutoReceiveTime(rs.getInt("WAD_AUTO_RECEIVE_TIME"));
   bean.setWadDisk(rs.getInt("WAD_DISK"));
   bean.setWadDiskSize(rs.getInt("WAD_DISK_SIZE"));
   bean.setWadDiskComp(rs.getInt("WAD_DISK_COMP"));
   bean.setWadDelreceive(rs.getInt("WAD_DELRECEIVE"));
   bean.setWadAutoreceive(rs.getInt("WAD_AUTORECEIVE"));
   bean.setWadSendHost(rs.getString("WAD_SEND_HOST"));
   bean.setWadSendPort(rs.getInt("WAD_SEND_PORT"));
   bean.setWadSendSsl(rs.getInt("WAD_SEND_SSL"));
   bean.setWadReceiveHost(rs.getString("WAD_RECEIVE_HOST"));
   bean.setWadReceivePort(rs.getInt("WAD_RECEIVE_PORT"));
   bean.setWadReceiveSsl(rs.getInt("WAD_RECEIVE_SSL"));
   bean.setWadCheckAddress(rs.getInt("WAD_CHECK_ADDRESS"));
   bean.setWadCheckFile(rs.getInt("WAD_CHECK_FILE"));
   bean.setWadCompressFile(rs.getInt("WAD_COMPRESS_FILE"));
   bean.setWadTimesent(rs.getInt("WAD_TIMESENT"));
   bean.setWadSendLimit(rs.getInt("WAD_SEND_LIMIT"));
   bean.setWadSendLimitSize(rs.getInt("WAD_SEND_LIMIT_SIZE"));
   bean.setWadFwlimit(rs.getInt("WAD_FWLIMIT"));
   bean.setWadBcc(rs.getInt("WAD_BCC"));
   bean.setWadBccTh(rs.getInt("WAD_BCC_TH"));
   bean.setWadWarnDisk(rs.getInt("WAD_WARN_DISK"));
   bean.setWadWarnDiskTh(rs.getInt("WAD_WARN_DISK_TH"));
   bean.setWadSettingServer(rs.getInt("WAD_SETTING_SERVER"));
   bean.setWadProxyUser(rs.getInt("WAD_PROXY_USER"));
   bean.setWadCompressFileDef(rs.getInt("WAD_COMPRESS_FILE_DEF"));
   bean.setWadTimesentDef(rs.getInt("WAD_TIMESENT_DEF"));
   return bean;
 }
Example #2
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);
    }
  }
Example #3
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;
  }
Example #4
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;
  }