<%@ page language="java" contentType="text/html;charset=euc-kr"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="com.eactive.eai.batch.telegram.TelegramManager"%>
<%@ page import="com.eactive.eai.batch.telegram.TelegramVO"%>

<%
    
    TelegramManager manager  = TelegramManager.getInstance();

    HashMap<String, TelegramVO>map = manager.getAllTelegrams();
    String[] keyNames = (String[])map.keySet().toArray();

    String selectedName = request.getParameter("groupName");
    if (selectedName == null && map.size() > 1) 
        selectedName = (String)keyNames[0];
    
    TelegramVO vo = null;
      
    if (selectedName != null) {
        vo = map.get(selectedName);       
    }
    
%>
<html>
    <head>
        <title>
            Properties Informations
        </title>
        <script>
        function doAction() {
            document.frm.submit();
        }
        
        function doUpdate() {
            document.frm.flag.value="U";
            document.frm.submit();
        }
        
        function doRemove() {
            document.frm.flag.value="D";
            document.frm.submit();
        }

        </script>
    </head>
    <body>
        <p style="font-size:12pt;">
        <b>Properties Informations</b> <br><br>
        </p>

        <form name="frm" action="">
        <table border='0'>
        <tr>
        <td align='left'>
        <table border=0 bgcolor='black' cellpadding="1" cellspacing="1">
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">Adapter Group : &nbsp;</td>
            <td align='left'>&nbsp;<select name="groupName" onchange="doAction();">
            <%
                for(int i=0;i < keyNames.length; i++) {
            %>
                <option value="<%= keyNames[i] %>" <%= (keyNames[i].equals(selectedName)) ? "selected" : "" %>><%= keyNames[i] %>
            <%           
                }
            %></select>
            </td>
        </tr>
        </table>
        </td>
        </tr>
        </table><br>
        
        <%
            if (selectedName != null) {
            }
        %>
        
        <table border=0 bgcolor='black' cellpadding="1" cellspacing="1">
        <tr bgcolor='white'>
            <td bgcolor="#003366">&nbsp;<font color="yellow">Key</font></td>
            <td bgcolor="#003366">&nbsp;<font color="yellow">Value</font></td>
        </tr>
        <%
            if (selectedName != null) {
//                String[] keys = grpVO.keys();
//                for ( int inx=0; inx < keys.length; inx++){
//                    String value = grpVO.getProperty(keys[inx]);
        %>

        <!-- 
        <tr bgcolor='white'>
            <td align='left'><%
            //=keys[inx]
            %></td>
            <td align='left'><%
            //=value
            %></td>
        </tr>        
         -->
        
        <%
                }
//            }
        %>
        </table>
        </form>
    </body>
</html>