Commit 71d8614f authored by Matt Tucker's avatar Matt Tucker Committed by matt

Added sorting of sessions (JM-633).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3738 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4ca9a0a2
...@@ -301,7 +301,7 @@ public class WebManager extends WebBean { ...@@ -301,7 +301,7 @@ public class WebManager extends WebBean {
setPageProperty(pageName, "console.refresh", newValue); setPageProperty(pageName, "console.refresh", newValue);
} }
private int getPageProperty(String pageName, String property, int defaultValue) { public int getPageProperty(String pageName, String property, int defaultValue) {
User user = getUser(); User user = getUser();
if (user != null) { if (user != null) {
String values = user.getProperties().get(property); String values = user.getProperties().get(property);
......
/** /**
* $RCSfile$
* $Revision: 580 $ * $Revision: 580 $
* $Date: 2004-12-01 18:46:33 -0300 (Wed, 01 Dec 2004) $ * $Date: 2004-12-01 18:46:33 -0300 (Wed, 01 Dec 2004) $
* *
* Copyright (C) 2004 Jive Software. All rights reserved. * Copyright (C) 2004-2006 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -15,21 +14,18 @@ import java.util.Comparator; ...@@ -15,21 +14,18 @@ import java.util.Comparator;
import java.util.Date; import java.util.Date;
/** /**
* <p>Filters and sorts lists of sessions.</p> * Filters and sorts lists of sessions. This allows for a very rich set of possible
* <p>This allows for a very * queries that can be run on session data. Some examples are: "Show all sessions
* rich set of possible queries that can be run on session data. Some examples * started during the last hour by a certain user".<p>
* are: "Show all sessions started during the last hour by a *
* certain user".
* </p><p>
* The class also supports pagination of results with the setStartIndex(int) * The class also supports pagination of results with the setStartIndex(int)
* and setNumResults(int) methods. If the start index is not set, it will * and setNumResults(int) methods. If the start index is not set, it will
* begin at index 0 (the start of results). If the number of results is not set, * begin at index 0 (the start of results). If the number of results is not set,
* it will be unbounded and return as many results as available. * it will be unbounded and return as many results as available.<p>
* </p><p> *
* Factory methods to create common queries are provided for convenience. * Factory methods to create common queries are provided for convenience.
* </p>
* *
* @author Iain Shigeoka * @author Matt Tucker
*/ */
public class SessionResultFilter { public class SessionResultFilter {
...@@ -50,7 +46,7 @@ public class SessionResultFilter { ...@@ -50,7 +46,7 @@ public class SessionResultFilter {
// Result limit search criteria // Result limit search criteria
// ############################################################ // ############################################################
/** /**
* <p>Represents no result limit (infinite results).</p> * Represents no result limit (infinite results).
*/ */
public static final int NO_RESULT_LIMIT = -1; public static final int NO_RESULT_LIMIT = -1;
...@@ -58,7 +54,7 @@ public class SessionResultFilter { ...@@ -58,7 +54,7 @@ public class SessionResultFilter {
// Packet limit search criteria // Packet limit search criteria
// ############################################################ // ############################################################
/** /**
* <p>Represents no result limit (infinite results).</p> * Represents no result limit (infinite results).
*/ */
public static final long NO_PACKET_LIMIT = -1; public static final long NO_PACKET_LIMIT = -1;
// ############################################################ // ############################################################
...@@ -71,8 +67,8 @@ public class SessionResultFilter { ...@@ -71,8 +67,8 @@ public class SessionResultFilter {
public static final int SORT_NUM_SERVER_PACKETS = 4; public static final int SORT_NUM_SERVER_PACKETS = 4;
/** /**
* <p>Creates a default SessionResultFilter: no filtering with results sorted * Creates a default SessionResultFilter: no filtering with results sorted
* by user.</p> * by user (ascending).
*/ */
public static SessionResultFilter createDefaultSessionFilter() { public static SessionResultFilter createDefaultSessionFilter() {
SessionResultFilter resultFilter = new SessionResultFilter(); SessionResultFilter resultFilter = new SessionResultFilter();
...@@ -140,7 +136,7 @@ public class SessionResultFilter { ...@@ -140,7 +136,7 @@ public class SessionResultFilter {
/** /**
* Sets the date that represents the lower boundary for sessions to * Sets the date that represents the lower boundary for sessions to
* be selected by the result filter. If this value is not set the results filter will * be selected by the result filter. If this value is not set the results filter will
* be unbounded for the earliest creation date selected.<p> * be unbounded for the earliest creation date selected.
* *
* @param creationDateRangeMin Date representing the filter lowest value of * @param creationDateRangeMin Date representing the filter lowest value of
* the creation date to be selected. * the creation date to be selected.
...@@ -155,7 +151,7 @@ public class SessionResultFilter { ...@@ -155,7 +151,7 @@ public class SessionResultFilter {
* and the results filter will be unbounded for the latest creation date selected. * and the results filter will be unbounded for the latest creation date selected.
* *
* @return a Date representing the filter highest value of the creation date to be * @return a Date representing the filter highest value of the creation date to be
* selected. * selected.
*/ */
public Date getCreationDateRangeMax() { public Date getCreationDateRangeMax() {
return creationDateRangeMax; return creationDateRangeMax;
...@@ -167,7 +163,7 @@ public class SessionResultFilter { ...@@ -167,7 +163,7 @@ public class SessionResultFilter {
* filter will be unbounded for the latest creation date selected. * filter will be unbounded for the latest creation date selected.
* *
* @param creationDateRangeMax Date representing the filter lowest value of * @param creationDateRangeMax Date representing the filter lowest value of
* the creation date range. * the creation date range.
*/ */
public void setCreationDateRangeMax(Date creationDateRangeMax) { public void setCreationDateRangeMax(Date creationDateRangeMax) {
this.creationDateRangeMax = creationDateRangeMax; this.creationDateRangeMax = creationDateRangeMax;
...@@ -180,7 +176,7 @@ public class SessionResultFilter { ...@@ -180,7 +176,7 @@ public class SessionResultFilter {
* last activity date selected. * last activity date selected.
* *
* @return a Date representing the filter lowest value of the last activity date * @return a Date representing the filter lowest value of the last activity date
* range. * range.
*/ */
public Date getLastActivityDateRangeMin() { public Date getLastActivityDateRangeMin() {
return lastActivityDateRangeMin; return lastActivityDateRangeMin;
...@@ -192,7 +188,7 @@ public class SessionResultFilter { ...@@ -192,7 +188,7 @@ public class SessionResultFilter {
* filter will be unbounded for the earliest last activity date selected. * filter will be unbounded for the earliest last activity date selected.
* *
* @param lastActivityDateRangeMin Date representing the filter lowest value of * @param lastActivityDateRangeMin Date representing the filter lowest value of
* the last activity date to be selected. * the last activity date to be selected.
*/ */
public void setLastActivityDateRangeMin(Date lastActivityDateRangeMin) { public void setLastActivityDateRangeMin(Date lastActivityDateRangeMin) {
this.lastActivityDateRangeMin = lastActivityDateRangeMin; this.lastActivityDateRangeMin = lastActivityDateRangeMin;
...@@ -204,7 +200,7 @@ public class SessionResultFilter { ...@@ -204,7 +200,7 @@ public class SessionResultFilter {
* and the results filter will be unbounded for the latest activity date selected. * and the results filter will be unbounded for the latest activity date selected.
* *
* @return a Date representing the filter highest value of the last activity date to be * @return a Date representing the filter highest value of the last activity date to be
* selected. * selected.
*/ */
public Date getLastActivityDateRangeMax() { public Date getLastActivityDateRangeMax() {
return lastActivityDateRangeMax; return lastActivityDateRangeMax;
...@@ -216,105 +212,107 @@ public class SessionResultFilter { ...@@ -216,105 +212,107 @@ public class SessionResultFilter {
* be unbounded for the latest activity date selected. * be unbounded for the latest activity date selected.
* *
* @param lastActivityDateRangeMax Date representing the filter lowest value of * @param lastActivityDateRangeMax Date representing the filter lowest value of
* the last activity date range. * the last activity date range.
*/ */
public void setLastActivityDateRangeMax(Date lastActivityDateRangeMax) { public void setLastActivityDateRangeMax(Date lastActivityDateRangeMax) {
this.lastActivityDateRangeMax = lastActivityDateRangeMax; this.lastActivityDateRangeMax = lastActivityDateRangeMax;
} }
/** /**
* <p>Get a lower boundary on client packets for sessions to be * Returns the lower boundary on client packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. A value of {@link #NO_PACKET_LIMIT} will be returned if
* <p>A value of NO_PACKET_LIMIT will be returned if * there is no lower packet limit.
* there is lower packet limit.</p>
* *
* @return The upper limit of client packets allowed for sessions to meet this filter requirement * @return the lower limit of client packets allowed for sessions to meet this
* filter requirement.
*/ */
public long getClientPacketRangeMin() { public long getClientPacketRangeMin() {
return clientPacketRangeMin; return clientPacketRangeMin;
} }
/** /**
* <p>Set an lower boundary on client packets for sessions to be * Sets the lower boundary on client packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. If this value is not set (using the value
* <p>If this value is not set * {@link #NO_PACKET_LIMIT}), the results filter will have no lower bounds
* the results filter will have no lower bounds for client packets selected.</p> * for client packets selected.
* *
* @param max The lower limit of client packets allowed for sessions to meet this filter requirement * @param min the lower limit of client packets allowed for sessions to meet
* this filter requirement.
*/ */
public void setClientPacketRangeMin(long max) { public void setClientPacketRangeMin(long min) {
this.clientPacketRangeMin = max; this.clientPacketRangeMin = min;
} }
/** /**
* <p>Get an upper boundary on client packets for sessions to be * Returns the upper boundary on client packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. A value of {@link #NO_PACKET_LIMIT} will be returned if
* <p>A value of NO_PACKET_LIMIT will be returned if * there is no upper packet limit.
* there is upper packet limit.</p>
* *
* @return The upper limit of client packets allowed for sessions to meet this filter requirement * @return the upper limit of client packets allowed for sessions to meet this
* filter requirement.
*/ */
public long getClientPacketRangeMax() { public long getClientPacketRangeMax() {
return clientPacketRangeMax; return clientPacketRangeMax;
} }
/** /**
* <p>Set an upper boundary on client packets for sessions to be * Sets the upper boundary on client packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. If this value is not set (using the value
* <p>If this value is not set * {@link #NO_PACKET_LIMIT}), the results filter will have no upper bounds
* the results filter will have no upper bounds * for client packets selected.
* for client packets selected.</p>
* *
* @param max The upper limit of client packets allowed for sessions to meet this filter requirement * @param max the upper limit of client packets allowed for sessions to meet
* this filter requirement.
*/ */
public void setClientPacketRangeMax(long max) { public void setClientPacketRangeMax(long max) {
this.clientPacketRangeMax = max; this.clientPacketRangeMax = max;
} }
/** /**
* <p>Get a lower boundary on server packets for sessions to be * Returns the lower boundary on server packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. A value of {@link #NO_PACKET_LIMIT} will be returned if
* <p>A value of NO_PACKET_LIMIT will be returned if * there is no lower packet limit.
* there is lower packet limit.</p>
* *
* @return The upper limit of server packets allowed for sessions to meet this filter requirement * @return the lower limit of server packets allowed for sessions to meet this
* filter requirement.
*/ */
public long getServerPacketRangeMin() { public long getServerPacketRangeMin() {
return serverPacketRangeMin; return serverPacketRangeMin;
} }
/** /**
* <p>Set an lower boundary on server packets for sessions to be * Sets the lower boundary on server packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. If this value is not set (using the value
* <p>If this value is not set * {@link #NO_PACKET_LIMIT}), the results filter will have no lower bounds
* the results filter will have no lower bounds for server packets selected.</p> * for server packets selected.
* *
* @param max The lower limit of server packets allowed for sessions to meet this filter requirement * @param min the lower limit of server packets allowed for sessions to meet
* this filter requirement.
*/ */
public void setServerPacketRangeMin(long max) { public void setServerPacketRangeMin(long min) {
this.serverPacketRangeMin = max; this.serverPacketRangeMin = min;
} }
/** /**
* <p>Get an upper boundary on server packets for sessions to be * Returns the upper boundary on server packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. A value of {@link #NO_PACKET_LIMIT} will be returned if
* <p>A value of NO_PACKET_LIMIT will be returned if * there is no upper packet limit.
* there is upper packet limit.</p>
* *
* @return The upper limit of server packets allowed for sessions to meet this filter requirement * @return the upper limit of server packets allowed for sessions to meet this
* filter requirement.
*/ */
public long getServerPacketRangeMax() { public long getServerPacketRangeMax() {
return serverPacketRangeMax; return serverPacketRangeMax;
} }
/** /**
* <p>Set an upper boundary on server packets for sessions to be * Sets the upper boundary on server packets for sessions to be selected
* selected by the result filter.</p> * by the result filter. If this value is not set (using the value
* <p>If this value is not set * {@link #NO_PACKET_LIMIT}), the results filter will have no upper bounds
* the results filter will have no upper bounds * for server packets selected.
* for server packets selected.</p>
* *
* @param max The upper limit of server packets allowed for sessions to meet this filter requirement * @param max the upper limit of server packets allowed for sessions to meet
* this filter requirement.
*/ */
public void setServerPacketRangeMax(long max) { public void setServerPacketRangeMax(long max) {
this.serverPacketRangeMax = max; this.serverPacketRangeMax = max;
...@@ -416,29 +414,22 @@ public class SessionResultFilter { ...@@ -416,29 +414,22 @@ public class SessionResultFilter {
} }
/** /**
* <p>Obtains a comparator that will sort a standard sorted set according * Returns a comparator that will sort a standard sorted set according
* to this filter's sort order.</p> * to this filter's sort order.
* *
* @return A comparator that sorts Sessions matching the sort order for this filter. * @return a comparator that sorts Sessions matching the sort order for this filter.
*/ */
public Comparator<Session> getSortComparator() { public Comparator<Session> getSortComparator() {
return new SessionComparator(); return new SessionComparator();
} }
/** /**
* <p>Compares sessions according to sort fields.</p> * Compares sessions according to sort fields.
* *
* @author Iain Shigeoka * @author Iain Shigeoka
*/ */
private class SessionComparator implements Comparator { private class SessionComparator implements Comparator {
/**
* <p>Compare two sessions according to sort order.</p>
*
* @param o1 The first session to compare
* @param o2 The second session to compare
* @return a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
*/
public int compare(Object o1, Object o2) { public int compare(Object o1, Object o2) {
Session lhs = (Session)o1; Session lhs = (Session)o1;
Session rhs = (Session)o2; Session rhs = (Session)o2;
...@@ -489,45 +480,33 @@ public class SessionResultFilter { ...@@ -489,45 +480,33 @@ public class SessionResultFilter {
* Rounds the given date down to the nearest specified second. The following * Rounds the given date down to the nearest specified second. The following
* table shows sample input and expected output values: (Note, only * table shows sample input and expected output values: (Note, only
* the time portion of the date is shown for brevity) <p> * the time portion of the date is shown for brevity) <p>
* <p/> *
* <table border="1"> * <table border="1">
* <tr> * <tr><th>Date</th><th>Seconds</th><th>Result</th></tr>
* <th>Date</th><th>Seconds</th><th>Result</th> * <tr><td>1:37.48</td><td>5</td><td>1:37.45</td></tr>
* </tr> * <tr><td>1:37.48</td><td>10</td><td>1:37.40</td></tr>
* <tr> * <tr><td>1:37.48</td><td>30</td><td>1:37.30</td</tr>
* <td>1:37.48</td><td>5</td><td>1:37.45</td> * <tr><td>1:37.48</td><td>60</td><td>1:37.00</td></tr>
* </tr> * <tr><td>1:37.48</td><td>120</td><td>1:36.00</td></tr>
* <tr>
* <td>1:37.48</td><td>10</td><td>1:37.40</td>
* </tr>
* <tr>
* <td>1:37.48</td><td>30</td><td>1:37.30</td>
* </tr>
* <tr>
* <td>1:37.48</td><td>60</td><td>1:37.00</td>
* </tr>
* <tr>
* <td>1:37.48</td><td>120</td><td>1:36.00</td>
* </tr>
* </table><p> * </table><p>
* <p/> *
* This method is useful when calculating the last post in * This method is useful when calculating the last post in
* a forum or the number of new messages from a given date. Using a rounded * a forum or the number of new messages from a given date. Using a rounded
* date allows Jive to internally cache the results of the date query. * date allows Jive to internally cache the results of the date query.
* Here's an example that shows the last posted message in a forum accurate * Here's an example that shows the last posted message in a forum accurate
* to the last 60 seconds: <p> * to the last 60 seconds:<p>
* <p/> *
* <code> * <pre>
* SessionResultFilter filter = new SessionResultFilter(); <br> * SessionResultFilter filter = new SessionResultFilter();
* filter.setSortOrder(SessionResultFilter.DESCENDING); <br> * filter.setSortOrder(SessionResultFilter.DESCENDING);
* filter.setSortField(JiveGlobals.SORT_CREATION_DATE); <br> * filter.setSortField(JiveGlobals.SORT_CREATION_DATE);
* <b>filter.setCreationDateRangeMin(SessionResultFilter.roundDate(forum.getModificationDate(), 60));</b> <br> * <b>filter.setCreationDateRangeMin(SessionResultFilter.roundDate(forum.getModificationDate(), 60));</b>
* filter.setNumResults(1); <br> * filter.setNumResults(1);
* Iterator messages = forum.messages(filter); <br> * Iterator messages = forum.messages(filter);
* ForumMessage lastPost = (ForumMessage)messages.next(); <br> * ForumMessage lastPost = (ForumMessage)messages.next();
* </code><p> * </pre>
* *
* @param date the <tt>Date</tt> we want to round. * @param date the <tt>Date</tt> we want to round.
* @param seconds the number of seconds we want to round the date to. * @param seconds the number of seconds we want to round the date to.
* @return the given date, rounded down to the nearest specified number of seconds. * @return the given date, rounded down to the nearest specified number of seconds.
*/ */
...@@ -538,7 +517,7 @@ public class SessionResultFilter { ...@@ -538,7 +517,7 @@ public class SessionResultFilter {
/** /**
* Rounds the given date down to the nearest specfied second. * Rounds the given date down to the nearest specfied second.
* *
* @param date the date (as a long) that we want to round. * @param date the date (as a long) that we want to round.
* @param seconds the number of seconds we want to round the date to. * @param seconds the number of seconds we want to round the date to.
* @return the given date (as a long), rounded down to the nearest * @return the given date (as a long), rounded down to the nearest
* specified number of seconds. * specified number of seconds.
...@@ -547,46 +526,63 @@ public class SessionResultFilter { ...@@ -547,46 +526,63 @@ public class SessionResultFilter {
return date - (date % (1000 * seconds)); return date - (date % (1000 * seconds));
} }
/**
* Clones a SessionResultFilter
*/
public Object clone() {
SessionResultFilter clonedFilter = new SessionResultFilter();
clonedFilter.setCreationDateRangeMax(getCreationDateRangeMax());
clonedFilter.setCreationDateRangeMin(getCreationDateRangeMin());
clonedFilter.setLastActivityDateRangeMax(getLastActivityDateRangeMax());
clonedFilter.setLastActivityDateRangeMin(getLastActivityDateRangeMin());
clonedFilter.setNumResults(getNumResults());
clonedFilter.setSortField(getSortField());
clonedFilter.setSortOrder(getSortOrder());
clonedFilter.setStartIndex(getStartIndex());
clonedFilter.setUsername(getUsername());
return clonedFilter;
}
public boolean equals(Object object) { public boolean equals(Object object) {
if (this == object) { if (this == object) {
return true; return true;
} }
if (object != null && object instanceof SessionResultFilter) { if (object != null && object instanceof SessionResultFilter) {
SessionResultFilter o = (SessionResultFilter)object; SessionResultFilter o = (SessionResultFilter)object;
return if (sortField != o.sortField) {
sortField == o.sortField && return false;
sortOrder == o.sortOrder && }
startIndex == o.startIndex && if (sortOrder != o.sortOrder) {
numResults == o.numResults && return false;
username == o.username && }
((creationDateRangeMin == null && o.creationDateRangeMin == null) || if (numResults != o.numResults) {
creationDateRangeMin.equals(o.creationDateRangeMin)) && return false;
((creationDateRangeMax == null && o.creationDateRangeMax == null) || }
creationDateRangeMax.equals(o.creationDateRangeMax)) && if (!compare(username, o.username)) {
((lastActivityDateRangeMin == null && o.lastActivityDateRangeMin == null) || return false;
lastActivityDateRangeMin.equals(o.lastActivityDateRangeMin)) && }
((lastActivityDateRangeMax == null && o.lastActivityDateRangeMax == null) ||
lastActivityDateRangeMax.equals(o.lastActivityDateRangeMax)); if (!compare(creationDateRangeMin, o.creationDateRangeMin)) {
return false;
}
if (!compare(creationDateRangeMax, o.creationDateRangeMax)) {
return false;
}
if (!compare(lastActivityDateRangeMin, o.lastActivityDateRangeMin)) {
return false;
}
if (!compare(lastActivityDateRangeMax, o.lastActivityDateRangeMax)) {
return false;
}
// All checks passed, so equal.
return true;
} }
else { else {
return false; return false;
} }
} }
/**
* Returns true if two objects are equal. This is a helper method
* to assist with the case that one or both objects are <tt>null</tt>;
* if both objects are <tt>null</tt> then they're considered equal.
*
* @param one the first object.
* @param two the second object.
* @return true if the objects are equal.
*/
private static boolean compare (Object one, Object two) {
if (one == null && two != null) {
return false;
}
else if (one != null) {
if (!one.equals(two)) {
return false;
}
}
return true;
}
} }
\ No newline at end of file
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
int range = ParamUtils.getIntParameter(request,"range",webManager.getRowsPerPage("session-summary", DEFAULT_RANGE)); int range = ParamUtils.getIntParameter(request,"range",webManager.getRowsPerPage("session-summary", DEFAULT_RANGE));
int refresh = ParamUtils.getIntParameter(request,"refresh",webManager.getRefreshValue("session-summary", 0)); int refresh = ParamUtils.getIntParameter(request,"refresh",webManager.getRefreshValue("session-summary", 0));
boolean close = ParamUtils.getBooleanParameter(request,"close"); boolean close = ParamUtils.getBooleanParameter(request,"close");
int order = ParamUtils.getIntParameter(request, "order",
webManager.getPageProperty("session-summary", "console.order", SessionResultFilter.ASCENDING));
String jid = ParamUtils.getParameter(request,"jid"); String jid = ParamUtils.getParameter(request,"jid");
if (request.getParameter("range") != null) { if (request.getParameter("range") != null) {
...@@ -45,6 +47,10 @@ ...@@ -45,6 +47,10 @@
webManager.setRefreshValue("session-summary", refresh); webManager.setRefreshValue("session-summary", refresh);
} }
if (request.getParameter("order") != null) {
webManager.setPageProperty("session-summary", "console.order", order);
}
// Get the user manager // Get the user manager
SessionManager sessionManager = webManager.getSessionManager(); SessionManager sessionManager = webManager.getSessionManager();
...@@ -153,12 +159,52 @@ ...@@ -153,12 +159,52 @@
</table> </table>
<br> <br>
<% // Get the iterator of sessions, print out session info if any exist.
SessionResultFilter filter = SessionResultFilter.createDefaultSessionFilter();
filter.setSortOrder(order);
filter.setStartIndex(start);
filter.setNumResults(range);
Collection<ClientSession> sessions = sessionManager.getSessions(filter);
%>
<div class="jive-table"> <div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%"> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th nowrap><fmt:message key="session.details.name" /></th> <th nowrap>
<%
if (filter.getSortField() == SessionResultFilter.SORT_USER) {
if (filter.getSortOrder() == SessionResultFilter.DESCENDING) {
%>
<table border="0"><tr valign="middle"><th>
<a href="session-summary.jsp?order=<%=SessionResultFilter.ASCENDING %>">
<fmt:message key="session.details.name" /></a>
</th><th>
<a href="session-summary.jsp?order=<%=SessionResultFilter.ASCENDING %>">
<img src="images/sort_descending.gif" border="0" width="16" height="16" alt=""></a>
</th></tr></table></div>
<%
}
else {
%>
<table border="0"><tr valign="middle"><th>
<a href="session-summary.jsp?order=<%=SessionResultFilter.DESCENDING %>">
<fmt:message key="session.details.name" /></a>
</th><th>
<a href="session-summary.jsp?order=<%=SessionResultFilter.DESCENDING %>">
<img src="images/sort_ascending.gif" width="16" height="16" border="0" alt=""></a>
</th></tr></table></div>
<%
}
}
else {
%>
<fmt:message key="session.details.name" />
<%
}
%>
</th>
<th nowrap><fmt:message key="session.details.resource" /></th> <th nowrap><fmt:message key="session.details.resource" /></th>
<th nowrap colspan="2"><fmt:message key="session.details.status" /></th> <th nowrap colspan="2"><fmt:message key="session.details.status" /></th>
<th nowrap colspan="2"><fmt:message key="session.details.presence" /></th> <th nowrap colspan="2"><fmt:message key="session.details.presence" /></th>
...@@ -167,11 +213,7 @@ ...@@ -167,11 +213,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% // Get the iterator of sessions, print out session info if any exist. <%
SessionResultFilter filter = new SessionResultFilter();
filter.setStartIndex(start);
filter.setNumResults(range);
Collection<ClientSession> sessions = sessionManager.getSessions(filter);
if (sessions.isEmpty()) { if (sessions.isEmpty()) {
%> %>
<tr> <tr>
......
...@@ -286,6 +286,14 @@ PRE, TT { ...@@ -286,6 +286,14 @@ PRE, TT {
font-size : 8pt; font-size : 8pt;
font-weight : bold; font-weight : bold;
} }
.jive-table TH TABLE TH {
border-right : none;
border-bottom : none;
}
.jive-table TH TABLE TH a {
text-decoration : none;
color: #000;
}
.jive-table TR TD { .jive-table TR TD {
border-bottom : 1px #ccc solid; border-bottom : 1px #ccc solid;
} }
......
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