<%@ page import="java.util.*,com.sun.im.portal.provider.IMProvider" %>
<%@ taglib uri="/tld/im.tld" prefix="im" %>
<%@ taglib uri="/tld/jx.tld" prefix="jx" %>
<%@ taglib uri="/tld/desktop.tld" prefix="dt" %>
<%@ taglib uri="/tld/desktopProviderContext.tld" prefix="dtpc" %>
<dt:obtainChannel channel="$JSPProvider">
<jx:declare id="JSPProvider" type="com.sun.im.portal.provider.IMProvider"/>
<dtpc:getStringProperty id="fontFace" key="fontFace1"/>
<jx:declare id="fontFace" type="java.lang.String"/>

<table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<%-- ------------------- Channel Display Information ---------------- --%>
<tr>
  <td width="100%" bgcolor="#333366" colspan="3">
    <font size="+1" face="<%=fontFace%>" color="#ffffff"><b>
Channel Display Information
    </b></font></td>
</tr>
<tr>
<td colspan="2" width="70%"></td>
<td valign="top" rowspan="3">
  <table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#eeeeee">
  <tbody>
  <tr>
    <td valign="top" bgcolor="#dcdcdc" height="15">
      <font face="<%=fontFace%>"><b>
Why?
      </b></font>
    </td>
  </tr>
  <tr>
    <td valign="top">
      <font face="<%=fontFace%>" size="-1">
The Instant Messenger channel displays presence information about the contacts 
in the contact list you enter here. 
      </font>
    </td>
  </tr>
  </tbody></table>
</td>
</tr>

<tr>
  <im:getContactGroups id="groups"/>
  <% if (pageContext.getAttribute("groups") == null) { %>
      <td colspan="2">
      <i><font color="red">Error</font>: Unable to contact the Instant Messaging server to get your list of contact groups.</i>
      </td>
  <% }
     else {
  %>
      <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
        <label for="commonname"><b>
Contact List:
        </b></label></font><br>
      </td>
      <td valign="middle">
        <select name="contactGroup">
         <dtpc:getStringProperty id="cg" key="contactGroup"/>
          <jx:declare id="cg" type="java.lang.String"/>
          <jx:forEach var="group" items="$groups">
            <jx:declare id="group" type="java.lang.String"/>
            <option value="<%=group%>" <%= cg.equals(group) ? "selected" : "" %>><%=group%></option>
          </jx:forEach>
          <option value="__ALL__" <%= cg.equals("") ? "selected" : "" %>>All Contacts</option>
        </select>
      </td>
  <% } %>
</tr>
<tr><td colspan="2"></td></tr>

<%-- ------------------- Instant Messenger Launch Information ---------------- --%>

<tr>
  <td width="100%" bgcolor="#333366" colspan="3">
    <font size="+1" face="<%=fontFace%>" color="#ffffff"><b>
Instant Messenger Launch Information
    </b></font></td>
</tr>
<tr>
<td colspan="2" width="70%"></td>
<td valign="top" rowspan="3">
  <table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#eeeeee">
  <tbody>
  <tr>
    <td valign="top" bgcolor="#dcdcdc" height="15">
      <font face="<%=fontFace%>"><b>
Why?
      </b></font>
    </td>
  </tr>
  <tr>
    <td valign="top">
      <font face="<%=fontFace%>" size="-1">
The Instant Messenger program can either run in your browser (Java plugin), 
or it can be installed on your computer using Java Web Start.
      </font>
    </td>
  </tr>
  </tbody></table>
</td>
</tr>

<tr>
  <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
    <label for="commonname"><b>
Launch Method:
    </b></label></font><br>
  </td>
  <td valign="middle">
    <select name="clientRunMode">
      <dtpc:getStringProperty id="crm" key="clientRunMode"/>
      <option value="plugin" <jx:if test="$crm == 'plugin'">selected</jx:if>>Java Plugin</option>
      <option value="jnlp" <jx:if test="$crm == 'jnlp'">selected</jx:if>>Java Web Start</option>
    </select>
  </td>
</tr>
<tr><td colspan="2"></td></tr>

<%-- ------------------- Instant Messaging Server Information ---------------- --%>

<tr>
  <td width="100%" bgcolor="#333366" colspan="3">
    <font size="+1" face="<%=fontFace%>" color="#ffffff"><b>
Instant Messaging Server Information
    </b></font></td>
</tr>
<tr>
<td colspan="2" width="70%"></td>
<td valign="top" rowspan="5">
  <table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#eeeeee">
  <tbody>
  <tr>
    <td valign="top" bgcolor="#dcdcdc" height="15">
      <font face="<%=fontFace%>"><b>
Why?
      </b></font>
    </td>
  </tr>
  <tr>
    <td valign="top">
      <font face="<%=fontFace%>" size="-1">
In order to access a Instant Messaging server, you must enter the
information needed to contact the server.
      </font>
    </td>
  </tr>
  </tbody></table>
</td>
</tr>

<tr>
  <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
    <label for="commonname"><b>
Server:
    </b></label></font><br>
  </td>
  <td valign="middle">
    <input type="text" name="server" size="25" maxlength="40" 
     value="<dtpc:getStringProperty key="server"/>">
  </td>
</tr>

<tr>
  <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
    <label for="commonname"><b>
Server Port:
    </b></label></font><br>
  </td>
  <td valign="middle">
    <input type="text" name="port" size="25" maxlength="40" 
     value="<dtpc:getStringProperty key="port"/>">
  </td>
</tr>

<tr>
  <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
    <label for="commonname"><b>
Multiplexor:
    </b></label></font><br>
  </td>
  <td valign="middle">
    <input type="text" name="mux" size="25" maxlength="40" 
     value="<dtpc:getStringProperty key="mux"/>">
  </td>
</tr>

<tr>
  <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
    <label for="commonname"><b>
Multiplexor Port:
    </b></label></font><br>
  </td>
  <td valign="middle">
    <input type="text" name="muxport" size="25" maxlength="40" 
     value="<dtpc:getStringProperty key="muxport"/>">
  </td>
</tr>

<dtpc:getStringProperty id="authMethod" key="authMethod"/>
<jx:if test="$authMethod == 'ldap'">
  <tr>
    <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
      <label for="commonname"><b>
  Username:
      </b></label></font><br>
    </td>
    <td valign="middle">
      <input type="text" name="username" size="25" maxlength="40" 
       value="<dtpc:getStringProperty key="username"/>">
    </td>
  </tr>
  
  <tr>
    <td valign="middle" align="right"><font face="<%=fontFace%>" color="#000000">
      <label for="commonname"><b>
  Password:
      </b></label></font><br>
    </td>
    <td valign="middle">
      <input type="password" name="password" size="25" maxlength="40" 
       value="<%= JSPProvider.getDummyPassword() %>">
  </td>
  </tr>
</jx:if>

<tr><td colspan="2"></td></tr>

</tbody>
</table>
</dt:obtainChannel>
