Update of
/var/cvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors
In directory
james.mmbase.org:/tmp/cvs-serv19171/cmsc/edit-webapp/src/webapp/editors
Modified Files:
dashboard.jsp
Log Message:
CMSC-241 Show top 5 most urgent tasks on dashboard
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors
See also: http://www.mmbase.org/jira/browse/CMSC-241
Index: dashboard.jsp
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors/dashboard.jsp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- dashboard.jsp 25 Mar 2009 02:45:15 -0000 1.16
+++ dashboard.jsp 25 Mar 2009 09:41:45 -0000 1.17
@@ -1,34 +1,5 @@
<%...@page language="java" contentType="text/html;charset=UTF-8"
%><%...@include file="globals.jsp"
-%><%!/*
-* Comparator to order mmbase nodes on status. Sorting is not done on
alphabetical order but on the value of status where
-* status "init" has position 1; status "notified" position 2 and status "done"
position 3. And if the same status, order
-* by "deadline" down.
-*/
-static public class StatusComparator implements Comparator {
- private static final String INIT = "task.status.init";
- private static final String NOTIFIED = "task.status.notified";
- private static final String DONE = "task.status.done";
-
- public int compare(Object o1, Object o2) {
- String status1 = ((org.mmbase.bridge.Node) o1).getStringValue("status");
- String status2 = ((org.mmbase.bridge.Node) o2).getStringValue("status");
- if (status1.equals(INIT) && status2.equals(INIT) ||
- status1.equals(NOTIFIED) && status2.equals(NOTIFIED) ||
- status1.equals(DONE) && status2.equals(DONE)) {
-
- return ((org.mmbase.bridge.Node)
o1).getStringValue("deadline").compareTo(((org.mmbase.bridge.Node)
o2).getStringValue("deadline"));
- }
- else if (status1.equals(INIT) && status2.equals(NOTIFIED) ||
- status1.equals(INIT) && status2.equals(DONE) ||
- status1.equals(NOTIFIED) && status2.equals(DONE)) {
- return -1;
- }
- else {
- return 1;
- }
- }
-}
%><mm:content type="text/html" encoding="UTF-8" expires="0"
><%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">--%>
<html:html xhtml="true">
@@ -146,7 +117,7 @@
</thead>
<tbody class="hover">
<c:set var="taskList" value="" /><c:set var="isSwapClass"
value="true"/>
- <mm:relatednodes comparator="StatusComparator"
max="${dashboardTaskSize}">
+ <mm:relatednodes
comparator="com.finalist.cmsc.tasks.TaskUrgencyComparator"
max="${dashboardTaskSize}">
<c:set var="taskId"><mm:field name="number"/></c:set>
<c:if test="${not fn:contains(taskList, taskId)}">
<tr <c:if test="${isSwapClass}">class="swap"</c:if>>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs