//package com.eactive.eai.admin;
//
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.Iterator;
//import java.util.LinkedHashMap;
//import java.util.Vector;
//
//import com.eactive.eai.common.b2badaptermapping.B2BAdapterMapDAO;
//import com.eactive.eai.common.b2bservice.B2BServiceDAO;
//import com.eactive.eai.common.dao.DAOException;
//import com.eactive.eai.common.dao.DAOFactory;
//import com.eactive.eai.common.property.PropertyDAO;
//import com.eactive.eai.common.server.EAIServerDAO;
//import com.eactive.eai.common.server.EAIServerVO;
//
//
//public class AdminUtil {
//	/*
//	/**
//	* Common 생성자 주석.
//	*/
//	public AdminUtil() {
//		super();
//	}
//	/*****************************************************************************
//	* 서버리스트 생성 
//	*****************************************************************************/
//	public static String getServerList() throws Exception {
//	
//		Vector dv = new Vector(); 
//		try {
//		
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			EAIServerDAO dao = null;
//			EAIServerVO ev = null;
//			dao = (EAIServerDAO)daoFactory.create(EAIServerDAO.class); 
//			dv = dao.getServerNm(); 
//			StringBuffer sb = new StringBuffer();
//			for(int i = 0; i < dv.size(); i++){ 
//			sb.append("<option value = ");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append(">");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append("</option>\n"); 
//		} 
//			return sb.toString(); 
//		
//		} catch(DAOException e) {
//			System.out.println("This is Dao Exception!!!! \n");
//			throw new Exception(e.getMessage());
//	} 
//} 
//
//	/*****************************************************************************
//	* 서버리스트 생성 - ALL제외 
//	*****************************************************************************/
//	public static String getServerListExceptALL() throws Exception {
//	
//		Vector dv = new Vector(); 
//		try {
//		
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			EAIServerDAO dao = null;
//			EAIServerVO ev = null;
//			dao = (EAIServerDAO)daoFactory.create(EAIServerDAO.class); 
//			dv = dao.getServerNmExceptALL(); 
//			StringBuffer sb = new StringBuffer();
//			for(int i = 0; i < dv.size(); i++){ 
//			sb.append("<option value = ");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append(">");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append("</option>\n"); 
//		} 
//			return sb.toString(); 
//		
//		} catch(DAOException e) {
//			System.out.println("This is Dao Exception!!!! \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	public static String getServerList(String selectBoxNm) throws Exception {
//
//		Vector dv = new Vector(); 
//		try {
//		
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			EAIServerDAO dao = null;
//			EAIServerVO ev = null;
//			dao = (EAIServerDAO)daoFactory.create(EAIServerDAO.class); 
//			dv = dao.getServerNm(); 
//			
//			StringBuffer sb = new StringBuffer();
//			
//			sb.append("<select name=\"");
//			sb.append(selectBoxNm);
//			sb.append("\">\n"); 
//			
//			for(int i = 0; i < dv.size(); i++){ 
//			sb.append("<option value = ");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append(">");
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append("</option>\n"); 
//			} 
//			sb.append("<option>없음</option>\n"); 
//			sb.append("</select>\n");
//			return sb.toString(); 
//		
//		} catch(DAOException e) {
//			System.out.println("This is Dao Exception!!!! \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	public static String getServerList(String svrNm, String selectBoxNm) throws Exception {
//	
//		Vector dv = new Vector(); 
//		try {
//		
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			EAIServerDAO dao = null;
//			EAIServerVO ev = null;
//			dao = (EAIServerDAO)daoFactory.create(EAIServerDAO.class); 
//			dv = dao.getServerNm(); 
//			
//			StringBuffer sb = new StringBuffer();
//			sb.append("<select name=\"");
//			sb.append(selectBoxNm);
//			sb.append("\">\n");
//			
//			for(int i = 0; i < dv.size(); i++){ 
//			String dbSvrNm = ((EAIServerVO)dv.elementAt(i)).getName(); 
//			
//			sb.append("<option value = ");
//			sb.append(dbSvrNm);
//			//입력 받은 서버명이 리스트의 항목과 일치되면 그 값을 디폴트 값으로 디스플레이 한다.
//			if(dbSvrNm.equals(svrNm)){ 
//			sb.append(" selected>");
//			}else{
//			sb.append(">");
//			} 
//			sb.append(((EAIServerVO)dv.elementAt(i)).getName());
//			sb.append("</option>\n"); 
//			} 
//			
//			//입력 서버명이 없을시 "없음" 표기
//			if(svrNm.equals("") || svrNm == null){
//			sb.append("<option value = \"\" selected>없음</option>\n");
//			}else{
//			sb.append("<option value = \"\">없음</option>\n");
//			} 
//			
//			sb.append("</select>\n");
//			return sb.toString(); 
//		
//		} catch(DAOException e) {
//			System.out.println("This is Dao Exception!!!! \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	public static ArrayList getPropertyGroupList() throws Exception {
//		try {
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			PropertyDAO dao = (PropertyDAO)daoFactory.create(PropertyDAO.class); 
//			return dao.getAllPropertyGroups();
//		} catch(DAOException e) {
//			System.out.println("This is Dao Exception!!!! \n");
//			throw new Exception(e.getMessage());
//		} 
//	}
//
////	public static String getSvcSeq()throws Exception{
////		try{
////			DAOFactory daoFactory = DAOFactory.newInstance();
////			CapHeaderDAO dao = (CapHeaderDAO)daoFactory.create(CapHeaderDAO.class);
////			HashMap hm = dao.getServiceSeq();
////			
////			Iterator it = hm.keySet().iterator();
////			String svc = "";
////			ArrayList seq = null;
////			StringBuffer sb = new StringBuffer();
////			String chk= "false";
////			while(it.hasNext()){
////			svc = (String)it.next();
////			
////			if(chk.equals("false")){
////			sb.append("if(obj == \"").append(svc).append("\") {\n"); 
////			}else{
////			sb.append("else if(obj == \"").append(svc).append("\") {\n"); 
////			}
////			seq = (ArrayList)hm.get(svc);
////			for(int i = 0; i < seq.size(); i++){
////			System.out.println("seq.get("+i+") >> " +seq.get(i));
////			sb.append(" objTarget.length++;\n");
////			sb.append(" objTarget.options[").append(i).append("].text = \"").append(seq.get(i)).append("\";\n");
////			sb.append(" objTarget.options[").append(i).append("].value = \"").append(seq.get(i)).append("\";\n");
////			} 
////			sb.append("}");
////			chk = "true"; 
////			}
////			
////			return sb.toString();
////		
////		}catch(DAOException e) {
////			System.out.println("This is DAO Exception \n");
////			throw new Exception(e.getMessage());
////		} 
////	} 
//	
//	/****
//	/* option에 "선택"을 추가
//	****/
////	public static String getSvcSeqWithChoice(String svcName, String seqNum)throws Exception{
////		try{
////			DAOFactory daoFactory = DAOFactory.newInstance();
////			CapHeaderDAO dao = (CapHeaderDAO)daoFactory.create(CapHeaderDAO.class);
////			HashMap hm = dao.getServiceSeq();
////			
////			Iterator it = hm.keySet().iterator();
////			String svc = "";
////			ArrayList seq = null;
////			StringBuffer sb = new StringBuffer();
////			String chk= "false";
////			sb.append("if(obj == \"\") {\n");
////			sb.append(" objTarget.length++;\n");
////			sb.append(" objTarget.options[0].text =\"선택\";\n");
////			sb.append(" objTarget.options[0].value =\"\";\n");
////			sb.append("}");
////			
////			while(it.hasNext()){
////			svc = (String)it.next();
////			
////			sb.append("else if(obj == \"").append(svc).append("\") {\n"); 
////			sb.append(" objTarget.length++;\n");
////			sb.append(" objTarget.options[0].text =\"선택\";\n");
////			sb.append(" objTarget.options[0].value =\"\";\n");
////			seq = (ArrayList)hm.get(svc);
////			for(int i = 0; i < seq.size(); i++){ 
////			sb.append(" objTarget.length++;\n");
////			sb.append(" objTarget.options[").append(i+1).append("].text = \"").append(seq.get(i)).append("\";\n");
////			sb.append(" objTarget.options[").append(i+1).append("].value = \"").append(seq.get(i)).append("\";\n");
////			if(svcName.equals(svc) && seqNum.equals(seq.get(i))){
////			sb.append(" objTarget.options[").append(i+1).append("].selected = \"selected\";\n"); 
////			
////			}
////			} 
////			sb.append("}");
////			chk = "true"; 
////			}
////			
////			return sb.toString();
////		
////		}catch(DAOException e) {
////			System.out.println("This is DAO Exception \n");
////			throw new Exception(e.getMessage());
////		} 
////	} 
//
////	public static String getSvcSeq(String svcName, String seqNum)throws Exception{
////		try{
////			DAOFactory daoFactory = DAOFactory.newInstance();
////			CapHeaderDAO dao = (CapHeaderDAO)daoFactory.create(CapHeaderDAO.class);
////			LinkedHashMap hm = dao.getServiceSeq();
////			
////			Iterator it = hm.keySet().iterator();
////			
////			ArrayList seq = null;
////			String svc = "";
////			StringBuffer sb = new StringBuffer();
////			String chk= "false";
////			
////			while(it.hasNext()){
////				svc = (String)it.next();
////				
////				if(chk.equals("false")){
////					sb.append("if(obj == \"").append(svc).append("\") {\n"); 
////				}else{
////					sb.append("else if(obj == \"").append(svc).append("\") {\n"); 
////				}
////				seq = (ArrayList)hm.get(svc);
////				//EAI 서비스 코드 체크
////				
////				for(int i = 0; i < seq.size(); i++){ 
////					sb.append(" objTarget.length++;\n");
////					sb.append(" objTarget.options[").append(i).append("].text = \"").append(seq.get(i)).append("\";\n");
////					sb.append(" objTarget.options[").append(i).append("].value = \"").append(seq.get(i)).append("\";\n");
////					if(svcName.equals(svc) && seqNum.equals(seq.get(i))){
////						sb.append(" objTarget.options[").append(i).append("].selected = \"selected\";\n"); 
////					}
////				} 
////
////				sb.append("}");
////				chk = "true"; 
////			}
////
////			return sb.toString();
////		
////		}catch(DAOException e) {
////			System.out.println("This is DAO Exception \n");
////			throw new Exception(e.getMessage());
////		} 
////	} 
//
//	/****
//	* EAI서비스 코드를 조회하여 Select Box생성
//	****/
//	public static String getSvcNameNInstiCd(String svcName)throws Exception{
//		try{
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			B2BServiceDAO dao = (B2BServiceDAO)daoFactory.create(B2BServiceDAO.class);
//			LinkedHashMap hm = dao.getB2BSvcNIdnfiName();
//			
//			Iterator it = hm.keySet().iterator();
//			String svc = "";
//			ArrayList seq = null;
//			StringBuffer sb = new StringBuffer(); 
//			sb.append("<option value=\"\">선택</option>\n"); 
//			while(it.hasNext()){
//				svc = (String)it.next();
//				if(svc.equals(svcName)){
//					sb.append("<option value=\"").append(svc).append("\" selected>").append(svc).append("</option>\n"); 
//				}else{
//					sb.append("<option value=\"").append(svc).append("\">").append(svc).append("</option>\n"); 
//				}
//			
//			} 
//			return sb.toString();
//		
//		}catch(DAOException e) {
//			System.out.println("This is DAO Exception \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	/****
//	/* EAI서비스 코드 인자를 조건으로 기관 코드를 조회하여 Select Box생성
//	****/
//	public static String getIdnfiName(String svcName, String idnfiName)throws Exception{
//		try{
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			B2BServiceDAO dao = (B2BServiceDAO)daoFactory.create(B2BServiceDAO.class);
//			LinkedHashMap hm = dao.getSvcNIdnfiName();
//			
//			Iterator it = hm.keySet().iterator();
//			String svc = "";
//			ArrayList seq = null;
//			StringBuffer sb = new StringBuffer();
//			String chk= "false";
//			sb.append("if(obj == \"\") {\n");
//			sb.append(" objTarget.length++;\n");
//			sb.append(" objTarget.options[0].text =\"DEFAULT\";\n");
//			sb.append(" objTarget.options[0].value =\"DEFAULT\";\n");
//			sb.append("}");
//			
//			while(it.hasNext()){
//				svc = (String)it.next();
//				
//				sb.append("else if(obj == \"").append(svc).append("\") {\n"); 
//				sb.append(" objTarget.length++;\n");
//				sb.append(" objTarget.options[0].text =\"DEFAULT\";\n");
//				sb.append(" objTarget.options[0].value =\"DEFAULT\";\n");
//				seq = (ArrayList)hm.get(svc);
//				for(int i = 0; i < seq.size(); i++){ 
//					if(! "DEFAULT".equals(seq.get(i))) {
//						sb.append(" objTarget.length++;\n");
//						sb.append(" objTarget.options[").append(i+1).append("].text = \"").append(seq.get(i)).append("\";\n");
//						sb.append(" objTarget.options[").append(i+1).append("].value = \"").append(seq.get(i)).append("\";\n");
//						if(svcName.equals(svc) && idnfiName.equals(seq.get(i))){
//							sb.append(" objTarget.options[").append(i+1).append("].selected = \"selected\";\n"); 
//						}
//					}
//				}
//				sb.append("}");
//				chk = "true"; 
//			}
//			
//			return sb.toString();
//		
//		}catch(DAOException e) {
//			System.out.println("This is DAO Exception \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//
//	/****
//	* option에 "선택"을 추가
//	****/
////	public static String getSvcNameWithChoice(String svcName)throws Exception{
////		try{
////			DAOFactory daoFactory = DAOFactory.newInstance();
////			CapHeaderDAO dao = (CapHeaderDAO)daoFactory.create(CapHeaderDAO.class);
////			LinkedHashMap hm = dao.getServiceSeq();
////			
////			Iterator it = hm.keySet().iterator();
////			String svc = "";
////			ArrayList seq = null;
////			StringBuffer sb = new StringBuffer(); 
////			sb.append("<option value=\"\">선택</option>\n"); 
////			while(it.hasNext()){
////				svc = (String)it.next();
////				if(svc.equals(svcName)){
////					sb.append("<option value=\"").append(svc).append("\" selected>").append(svc).append("</option>\n"); 
////				}else{
////					sb.append("<option value=\"").append(svc).append("\">").append(svc).append("</option>\n"); 
////				}
////			
////			}
////			
////			return sb.toString();
////		
////		}catch(DAOException e) {
////			System.out.println("This is DAO Exception \n");
////			throw new Exception(e.getMessage());
////		} 
////	} 
//
////	public static String getSvcName()throws Exception{
////		try{
////			DAOFactory daoFactory = DAOFactory.newInstance();
////			CapHeaderDAO dao = (CapHeaderDAO)daoFactory.create(CapHeaderDAO.class);
////			LinkedHashMap hm = dao.getServiceSeq();
////			
////			Iterator it = hm.keySet().iterator();
////			String svc = "";
////			ArrayList seq = null;
////			StringBuffer sb = new StringBuffer(); 
////			String chk= "false"; 
////			while(it.hasNext()){
////				svc = (String)it.next();
////				if(chk.equals("false")){
////					sb.append("<option value=\"").append(svc).append("\" selected>").append(svc).append("</option>\n"); 
////				}else{
////					sb.append("<option value=\"").append(svc).append("\">").append(svc).append("</option>\n"); 
////				}
////			
////			}
////			
////			return sb.toString();
////		
////		}catch(DAOException e) {
////			System.out.println("This is DAO Exception \n");
////			throw new Exception(e.getMessage());
////		} 
////	} 
// 
//	public static String getSvcMsgIDBox(ArrayList msgIDList, String parMsgID)throws Exception{
//		try{
//		
//		
//			StringBuffer sb = new StringBuffer();
//			
//			if(parMsgID == null || parMsgID.equals("")){parMsgID = " _";}
//			sb.append("<option value=\"\">").append("선택").append("</option>\n"); 
//			if(msgIDList != null) {
//				for(int i = 0; i < msgIDList.size(); i++){ 
//				
//					if(parMsgID.equals(msgIDList.get(i))){ 
//						sb.append("<option value=\"").append(msgIDList.get(i)).append("\" selected>").append(msgIDList.get(i)).append("</option>\n"); 
//					}else{
//						sb.append("<option value=\"").append(msgIDList.get(i)).append("\">").append(msgIDList.get(i)).append("</option>\n"); 
//					}
//				} 
//			} 
//			return sb.toString(); 
//		
//		}catch(Exception e) { 
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	/****
//	* Adapter그룹및 업무이름을 가져와 Select Box 생성
//	****/
//	public static String getAdptGrpBox(String adptGrp)throws Exception{
//		try{
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			B2BAdapterMapDAO dao = (B2BAdapterMapDAO)daoFactory.create(B2BAdapterMapDAO.class);
//			LinkedHashMap hm = dao.getAdptData();
//			
//			Iterator it = hm.keySet().iterator();
//			String adpt = "";
//			ArrayList seq = null;
//			StringBuffer sb = new StringBuffer(); 
//			sb.append("<option value=\"\">선택</option>\n"); 
//			while(it.hasNext()){
//				adpt = (String)it.next();
//				if(adpt.equals(adptGrp)){
//					sb.append("<option value=\"").append(adpt).append("\" selected>").append(adpt).append("</option>\n"); 
//				}else{
//					sb.append("<option value=\"").append(adpt).append("\">").append(adpt).append("</option>\n"); 
//				}
//			
//			}
//			
//			return sb.toString();
//		
//		}catch(DAOException e) {
//			System.out.println("This is DAO Exception \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//
//	/****
//	* Adapter그룹및 업무이름을 가져와 Select Box 생성
//	****/
//	public static String getAdptNameBox(String adptGrp, String adptNm)throws Exception{
//		try{
//			DAOFactory daoFactory = DAOFactory.newInstance();
//			B2BAdapterMapDAO dao = (B2BAdapterMapDAO)daoFactory.create(B2BAdapterMapDAO.class);
//			HashMap hm = dao.getAdptData();
//			
//			Iterator it = hm.keySet().iterator();
//			String adpt = "";
//			ArrayList nm = null;
//			StringBuffer sb = new StringBuffer();
//			String chk= "false";
//			sb.append("if(obj == \"DEFAULT\") {\n");
//			sb.append(" objTarget.length++;\n");
//			sb.append(" objTarget.options[0].text =\"DEFAULT\";\n");
//			sb.append(" objTarget.options[0].value =\"DEFAULT\";\n");
//			sb.append("}");
//			
//			while(it.hasNext()){
//				adpt = (String)it.next();
//				
//				sb.append("else if(obj == \"").append(adpt).append("\") {\n"); 
//				sb.append(" objTarget.length++;\n");
//				sb.append(" objTarget.options[0].text =\"DEFAULT\";\n");
//				sb.append(" objTarget.options[0].value =\"DEFAULT\";\n");
//				nm = (ArrayList)hm.get(adpt);
//				for(int i = 0; i < nm.size(); i++){ 
//					sb.append(" objTarget.length++;\n");
//					sb.append(" objTarget.options[").append(i+1).append("].text = \"").append(nm.get(i)).append("\";\n");
//					sb.append(" objTarget.options[").append(i+1).append("].value = \"").append(nm.get(i)).append("\";\n");
//					
//					if(adptGrp.equals(adpt) && adptNm.equals(nm.get(i))){ 
//						sb.append(" objTarget.options[").append(i+1).append("].selected = \"selected\";\n"); 
//					
//					}
//				} 
//				sb.append("}");
//				chk = "true"; 
//			}
//			
//			return sb.toString();
//		
//		}catch(DAOException e) {
//			System.out.println("This is DAO Exception \n");
//			throw new Exception(e.getMessage());
//		} 
//	} 
//}