Commit 1a3b3462 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Refactoring changes


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@618 b35dd754-fafc-0310-a699-88a17e54d16e
parent d3683ff3
......@@ -11,7 +11,6 @@
<%@ page import="org.jivesoftware.util.*,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.XMPPAddress,
org.jivesoftware.messenger.group.Group"
errorPage="error.jsp"
%>
......
......@@ -16,7 +16,8 @@
org.jivesoftware.messenger.user.*,
java.util.*,
java.text.*,
org.jivesoftware.admin.AdminPageBean"
org.jivesoftware.admin.AdminPageBean,
org.jivesoftware.admin.AdminConsole"
%>
......
......@@ -15,7 +15,9 @@
java.text.DateFormat,
java.text.NumberFormat,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.user.User"
org.jivesoftware.messenger.user.User,
org.xmpp.packet.JID,
org.xmpp.packet.Presence"
errorPage="error.jsp"
%>
......@@ -34,9 +36,9 @@
// Get the session & address objects
SessionManager sessionManager = webManager.getSessionManager();
XMPPAddress address = XMPPAddress.parseJID(jid);
JID address = new JID(jid);
Session currentSess = sessionManager.getSession(address);
boolean isAnonymous = address.getName() == null || "".equals(address.getName());
boolean isAnonymous = address.getNode() == null || "".equals(address.getNode());
// Get a presence manager
PresenceManager presenceManager = webManager.getPresenceManager();
......@@ -44,7 +46,7 @@
// Get user object
User user = null;
if (!isAnonymous) {
user = webManager.getUserManager().getUser(address.getName());
user = webManager.getUserManager().getUser(address.getNode());
}
// Handle a "message" click:
......@@ -55,9 +57,9 @@
// See if there are multiple sessions for this user:
Collection<Session> sessions = null;
int sessionCount = sessionManager.getSessionCount(address.getName());
int sessionCount = sessionManager.getSessionCount(address.getNode());
if (!isAnonymous && sessionCount > 1) {
sessions = sessionManager.getSessions(address.getName());
sessions = sessionManager.getSessions(address.getNode());
}
// Date dateFormatter for all dates on this page:
......@@ -80,7 +82,7 @@
<p>
Below are session details for the session <b><%= address.toString() %></b>. If the
user <b><%= address.getName() %></b> has multiple sessions open, they will appear below.
user <b><%= address.getNode() %></b> has multiple sessions open, they will appear below.
</p>
<div class="jive-table">
......@@ -106,7 +108,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
User Name &amp; Resource:
</td>
<td>
<% String n = address.getName(); %>
<% String n = address.getNode(); %>
<% if (n == null || "".equals(n)) { %>
<i>Anonymous</i> - <%= address.getResource() %>
......@@ -165,7 +167,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
</td>
<td>
<%
int show = currentSess.getPresence().getShow();
Presence.Show show = currentSess.getPresence().getShow();
String statusTxt = currentSess.getPresence().getStatus();
if (statusTxt != null) {
statusTxt = " -- " + statusTxt;
......@@ -173,33 +175,33 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
else {
statusTxt = "";
}
if (show == Presence.SHOW_AWAY) {
if (show == Presence.Show.away) {
%>
<img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away">
Away <%= statusTxt %>
<%
} else if (show == Presence.SHOW_CHAT) {
} else if (show == Presence.Show.chat) {
%>
<img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat">
Available to Chat <%= statusTxt %>
<%
} else if (show == Presence.SHOW_DND) {
} else if (show == Presence.Show.dnd) {
%>
<img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do not Disturb">
Do Not Disturb <%= statusTxt %>
<%
} else if (show == Presence.SHOW_NONE) {
} else if (show == null) {
%>
<img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online">
Online <%= statusTxt %>
<%
} else if (show == Presence.SHOW_XA) {
} else if (show == Presence.Show.xa) {
%>
<img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Extended Away">
......
<%@ page import="org.jivesoftware.messenger.Session,
org.jivesoftware.messenger.Presence"%>
org.xmpp.packet.Presence"%>
<%--
- $RCSfile$
- $Revision$
......@@ -27,7 +27,7 @@
<td width="1%" nowrap><%= count %></td>
<td width="10%" nowrap>
<% String name = sess.getAddress().getName(); %>
<% String name = sess.getAddress().getNode(); %>
<a href="session-details.jsp?jid=<%= sess.getAddress() %>" title="Click for more info..."
><%= ((name != null && !"".equals(name)) ? name : "<i>Anonymous</i>") %></a>
......@@ -67,9 +67,9 @@
<% } %>
</td>
<% int _show = sess.getPresence().getShow();
<% Presence.Show _show = sess.getPresence().getShow();
String _stat = sess.getPresence().getStatus();
if (_show == Presence.SHOW_AWAY) {
if (_show == Presence.Show.away) {
%>
<td width="1%"
><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away"
......@@ -86,7 +86,7 @@
<% } %>
</td>
<% } else if (_show == Presence.SHOW_CHAT) { %>
<% } else if (_show == Presence.Show.chat) { %>
<td width="1%"
><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat"
......@@ -95,7 +95,7 @@
Available to Chat
</td>
<% } else if (_show == Presence.SHOW_DND) { %>
<% } else if (_show == Presence.Show.dnd) { %>
<td width="1%"
><img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do Not Disturb"
......@@ -112,7 +112,7 @@
<% } %>
</td>
<% } else if (_show == Presence.SHOW_NONE) { %>
<% } else if (_show == null) { %>
<td width="1%"
><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online"
......@@ -121,7 +121,7 @@
Online
</td>
<% } else if (_show == Presence.SHOW_XA) { %>
<% } else if (_show == Presence.Show.xa) { %>
<td width="1%"
><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Extended Away"
......
......@@ -14,7 +14,8 @@
org.jivesoftware.messenger.*,
java.util.Date,
org.jivesoftware.admin.*,
java.text.DateFormat"
java.text.DateFormat,
org.xmpp.packet.JID"
errorPage="error.jsp"
%>
......@@ -37,7 +38,7 @@
// Close a connection if requested
if (close) {
XMPPAddress address = XMPPAddress.parseJID(jid);
JID address = new JID(jid);
try {
Session sess = sessionManager.getSession(address);
sess.getConnection().close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment