Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Portal Server 6 2005Q1 Desktop Customization Guide 

Chapter 6
Customizing Instant Messaging

This chapter contains the following sections:


Disabling the User from Editing Instant Messaging Server Information

When a site has only a single Sun Java System Instant Messaging server, there is no need for the end-users to be able to edit the server information in the channel edit page. The server information can be removed by editing the IMEdit.jsp file so that part of the page is not displayed.

Code Example 6-1 contains the Instant Messaging Server Information (snippet) in the IMEdit.jsp file.

Code Example 6-1  Instant Messaging Server Information in IMEdit.jsp File  

...

<%-- ------------------- 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 Sun Java System 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>

...

The change to this file depends on the type of authentication that is being used for the channel. With Sun Java System Access Manager software authentication (authMethod=idsvr), the entire Instant Messaging server Information section can be removed. With LDAP authentication (authMethod=ldap), the username and password fields are still necessary. So, remove only the server and port fields and keep the rest of the Instant Messaging Server Information section.


Automatically Closing the Instant Messaging Invite Window

The invite.jsp file generates the content for the popup window that is created when a user is invited to a conference in an instant messaging client that is already running. It is necessary to open this window (the window is opened before the server checks if the instant messaging client is running), but the window can be closed automatically. The invite.jsp file has the Javascript code for doing this commented out (see Code Example 6-2). Merely uncomment this Javascript code (shown in Code Example 6-2 in bold) to cause the window to close automatically.

Code Example 6-2  Instant Messaging invite.jsp File  

<%@ taglib uri="/tld/jx.tld" prefix="jx" %>

<%@ taglib uri="/tld/im.tld" prefix="im" %>

<%@ taglib uri="/tld/desktop.tld" prefix="dt" %>

<%@ taglib uri="/tld/desktopProviderContext.tld" prefix="dtpc" %>

<dt:obtainChannel channel="$JSPProvider">

<html>

    <head>

        <title>Sun Java System Instant Messenger</title>

    </head>

    <body bgcolor="#ffffff">

        <p>

            User <%= request.getParameter("username") %> is being invited to join a conference using the IM client that you already have running.

        <p>

            <center>

                <form>

                    <input type=button value="Ok" onClick="window.close();">

                </form>

            </center>

        <%-- uncomment this script if you want the window to close automatically

            <script>window.close();</script>

        --%>


Customizing Display of Instant Messaging Contacts

By default, the IMContent.jsp file only displays presence information for on-line contacts. There is code in the JSP file for displaying presence information for all contacts in the selected contact group(s). If you wish to display all of this information, uncomment the code (shown in Code Example 6-3) in IMContent.jsp file.

Code Example 6-3  Instant Messaging Offline Contact Information in IMContent.jsp File  

...

<%--Offline States - Uncomment this if you want users to see offline contacts -

<jx:when test="$p==’CLOSED’">

<jx:expr value="$anchortag"/>

    <img src="im/images/Offline_13Padded.gif" alt="Offline - Click to chat" border=0 align=absmiddle></a>

    <im:getContactName/></br>

</jx:when>

<jx:when test="$p==’AWAY’">

<jx:expr value="$anchortag"/>

    <img src="im/images/Away_13Padded.gif" alt="Away - Click to chat" border=0 align=absmiddle></a>

    <im:getContactName/></br>

</jx:when>

<jx:when test="$p==’FORWARDED’">

<jx:expr value="$anchortag"/>

    <img src="im/images/Forwarded_13Padded.gif" alt="Offline - Click to chat" border=0 align=absmiddle></a>

    <im:getContactName/></br>

</jx:when>

<jx:when test="$p==’OTHER’">

<jx:expr value="$anchortag"/>

    <img src="im/images/Offline_13Padded.gif" alt="Other - Click to chat" border=0 align=absmiddle></a>

    <im:getContactName/></br>

</jx:when>

<jx:otherwise>

<jx:expr value="$anchortag"/>

    <img src="im/images/Offline_13Padded.gif" alt="<%=p%> - Click to chat" border=0 align=absmiddle></a>

    <im:getContactName/></br>

</jx:otherwise>

-- End of offline states --%>



Previous      Contents      Index      Next     


Part No: 817-7694.   Copyright 2005 Sun Microsystems, Inc. All rights reserved.