/*********************************************************************
 * All Rights reserved,Copyright (c) K-Opticom
 **********************************************************************
 *＜プログラム内容＞
 *   システム名      ：eo顧客基幹システム
 *   モジュール名    ：JKKPrintOpDataSaksei
 *   ソースファイル名：JKKPrintOpDataSaksei.java
 *   作成者          ：富士通
 *   日付            ：2012年09月21日
 *＜機能概要＞
 *   サービス層編集部品です。
 *＜修正履歴＞
 *   バージョン  修正日       修正者      修正内容
 *   v4.00.00    2012/09/21   FJ          新規作成
 *
 **********************************************************************/
package com.fujitsu.futurity.bp.custom.common;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import com.fujitsu.futurity.bp.x21.bpm.exception.RequestParameterException;
import com.fujitsu.futurity.bp.x21.bpm.parameter.IRequestParameterReadOnly;
import com.fujitsu.futurity.bp.x21.bpm.parameter.IRequestParameterReadWrite;
import com.fujitsu.futurity.common.x01.sc.AttachmentFileMapKeys;
import com.fujitsu.futurity.common.x01.sc.SCControlMapKeys;

import eo.common.util.JPCCommonUtil;
import eo.common.util.JZMAdOutputEdit;

public class JKKPrintOpDataSaksei
{
	/** ダブルクォーテーション */
	private static final char DBL_QUOT_STR = '\"';

	/** 区切り文字の定数*/
	private static final String DELIMITER_STR = ",";
	
	/** 空文字を定義 */
	private static final String BLANK = "";
	
	/** UTF-8 */
	private static final String UTF_8 = "UTF-8";
	
	/**
	 * eo光ネットオプション内容のご案内に印字するデータを作成する。
	 * 
	 * @param inMap
	 *            入力データ
	 * @param listKey
	 *            行データが設定されているキー文字
	 * 
	 * @return CSVデータのbyte[]値
	 * @throws UnsupportedEncodingException
	 */
	public static byte[] createEohntOpNyoGuidePrtData(HashMap inMap) throws UnsupportedEncodingException
	{
		StringBuilder buff = new StringBuilder();

		// 定義体の順番にファイルデータを追加
		
		// buff.append((String)inMap.get("sysdate"))).append(DELIMITER_STR) // システム日付
		buff.append((String)inMap.get("netkei_type")).append(DELIMITER_STR) // ネット契約タイプ
			.append((String)inMap.get("keisha_nm")).append(DELIMITER_STR) // 契約者名
			.append((String)inMap.get("netkei_type_prt")).append(DELIMITER_STR) // 文言用ネット契約タイプ
			.append((String)inMap.get("dokuji_domain")).append(DELIMITER_STR) // 独自ドメイン
			.append((String)inMap.get("pop_server")).append(DELIMITER_STR) // ＰＯＰサーバー
			.append((String)inMap.get("smtp_server")).append(DELIMITER_STR) // ＳＭＴＰサーバー
			.append((String)inMap.get("ml_krishayo_id")).append(DELIMITER_STR) // メール管理者ＩＤ
			.append((String)inMap.get("ml_krishayo_id_pwd")).append(DELIMITER_STR) // メール管理者ＩＤパスワード
			.append((String)inMap.get("mlbox_capa")).append(DELIMITER_STR) // メール蓄積容量
			.append((String)inMap.get("ml_account_cnt")).append(DELIMITER_STR) // メールアカウント数
			.append((String)inMap.get("ml_krishayo_pop_id")).append(DELIMITER_STR) // メール管理者ＰＯＰＩＤ
			.append((String)inMap.get("ml_krishayo_pop_id_pwd")).append(DELIMITER_STR) // メール管理者ＰＯＰＩＤパスワード
			.append((String)inMap.get("ml_krishayo_mlad")).append(DELIMITER_STR) // メール管理者メールアドレス
			.append((String)inMap.get("web_id")).append(DELIMITER_STR) // ＷｅｂＩＤ
			.append((String)inMap.get("web_id_pwd")).append(DELIMITER_STR) // ＷｅｂＩＤパスワード
			.append((String)inMap.get("hp_url")).append(DELIMITER_STR) // ホームページＵＲＬ
			.append((String)inMap.get("hp_capa")).append(DELIMITER_STR) // ホームページ蓄積容量
			.append((String)inMap.get("ftp_server")).append(DELIMITER_STR) // ＦＴＰサーバー
			.append((String)inMap.get("shk_folder")).append(DELIMITER_STR) // 初期フォルダ
			.append(System.getProperty("line.separator"));
		
		return buff.toString().getBytes(UTF_8);
	}
	
	/**
	 * "で括られた文字列を返す。
	 * 
	 * @param val
	 *            入力文字列
	 * 
	 * @return 編集後の文字列
	 */
	//	private static String String val)
	//	{
	//		if (val == null)
	//		{
	//		return BLANK;
	//		}
	//		StringBuilder result = new StringBuilder();
	//		result.append(DBL_QUOT_STR);
	//		for (int i = 0; i < val.length(); i++)
	//	{
	//		char oneCh = val.charAt(i);
	//		if (oneCh == DBL_QUOT_STR)
	//		{
	//			result.append(oneCh);
	//		}
	//		result.append(oneCh);
	//	}
	//	result.append(DBL_QUOT_STR);
	//	return result.toString();
	// }
	
	

}
