Further work on statistics display
authorpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Thu, 26 May 2011 16:12:19 +0000 (16:12 +0000)
committerpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Thu, 26 May 2011 16:12:19 +0000 (16:12 +0000)
git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4176 e3abac25-378b-4346-85de-24260fe3988d

statpages/Joblist.jsp
statpages/MonthlySummary.jsp
statpages/Statistics.jsp
statpages/StatisticsTable.jsp [new file with mode: 0644]
statpages/footer.jsp
statpages/header.jsp
statpages/screen.css

index ba232c2..90fda82 100644 (file)
@@ -5,26 +5,12 @@
 Author: Peter Troshin\r
 Date: May 2011\r
 --%>\r
-\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>\r
 <%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>\r
 \r
-    \r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
-<title>Cluster usage per user</title>\r
-<style type="text/css" media="all">\r
-     @import url("${pageContext.request.contextPath}/statpages/screen.css");\r
-</style>\r
-<link rel="stylesheet" href="${pageContext.request.contextPath}/statpages/print.css" type="text/css" media="print" />\r
-\r
-</head>\r
-<body>\r
-\r
+<jsp:include page="header.jsp" />\r
 \r
 <dt:table class="its" id="job" name="${stat.jobs}" export="true" sort="list"  pagesize="100" \r
 defaultsort="0" defaultorder="descending">\r
@@ -67,15 +53,4 @@ defaultsort="0" defaultorder="descending">
 \r
 </dt:table>\r
 \r
-<%--\r
-\r
-<form action="" method="post">\r
-       <input name="field1" maxlength="" title=""  type="text"/>\r
-       <input name="field2" maxlength="" title=""  type="text"/>\r
-       <textarea name="field3" cols="10" rows="10"  title="" />\r
-       <input type="submit" name="Submit"/>\r
-</form>\r
- --%>\r
\r
-</body>\r
-</html>
\ No newline at end of file
+<jsp:include page="footer.jsp" />
\ No newline at end of file
index 1aff7e4..6c08d4d 100644 (file)
@@ -1,33 +1,16 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>\r
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"\r
-    pageEncoding="ISO-8859-1"%>\r
 <%--\r
 Author: Peter Troshin\r
 Date: May 2011\r
 --%>\r
-\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>\r
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>\r
 <%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>\r
 \r
-    \r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
-<title>JABAWS Monthly Summary Usage Statistics</title>\r
-<style type="text/css" media="all">\r
-     @import url("${pageContext.request.contextPath}/statpages/screen.css");\r
-</style>\r
-<link rel="stylesheet" href="${pageContext.request.contextPath}/statpages/print.css" type="text/css" media="print" />\r
-</head>\r
-\r
-<body>\r
-\r
+<jsp:include page="header.jsp" />\r
 \r
 <h2>Web Services Usage Statistics</h2>\r
-<table class="its" style="border: 1px solid red; border-collapse: separate;"> \r
+<table class="its"> \r
 <thead>\r
 <tr>\r
 <th rowspan="2">Month</th>\r
@@ -42,8 +25,16 @@ Date: May 2011
 </thead>\r
 <tbody>\r
 \r
-<c:forEach items="${stat}" var="monthTotal" >\r
-<tr>\r
+<c:forEach items="${stat}" var="monthTotal" varStatus="status">\r
+<c:choose>\r
+       <c:when test="${status.count%2==0}">\r
+               <tr class="even">\r
+       </c:when>\r
+       <c:otherwise>\r
+               <tr class="odd">\r
+       </c:otherwise>\r
+</c:choose>\r
+\r
 <td><a href="DisplayStat?datetime=${monthTotal.key.time}"><fmt:formatDate value="${monthTotal.key}" type="date" pattern="MMM yyyy"/></a></td>\r
 <td>${monthTotal.value.total}</td>\r
 <td>${monthTotal.value.incomplete}</td>\r
@@ -62,5 +53,4 @@ Date: May 2011
 </table>\r
 \r
 \r
-</body>\r
-</html>
\ No newline at end of file
+<jsp:include page="footer.jsp" />
\ No newline at end of file
index af8d82f..65575a6 100644 (file)
@@ -1,6 +1,3 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>\r
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"\r
-    pageEncoding="ISO-8859-1"%>\r
 <%--\r
 Author: Peter Troshin\r
 Date: May 2011\r
@@ -11,136 +8,25 @@ Date: May 2011
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>\r
 <%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>\r
 \r
+<jsp:include page="header.jsp" />\r
     \r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
-<title>Cluster usage per user</title>\r
-<style type="text/css" media="all">\r
-     @import url("${pageContext.request.contextPath}/statpages/screen.css");\r
-</style>\r
-<link rel="stylesheet" href="${pageContext.request.contextPath}/statpages/print.css" type="text/css" media="print" />\r
-</head>\r
-\r
-<body>\r
-\r
-\r
+<h2>JABAWS Usage Statistics for the Period: <fmt:formatDate value="${startDate}" /> to <fmt:formatDate value="${stopDate}"/></h2>\r
 <h2>All jobs</h2>\r
-<table class="its" style="border: 1px solid red; border-collapse: separate;"> \r
-<thead>\r
-<tr>\r
-<th rowspan="2">Web Service</th>\r
-<th colspan="4" style="text-align: center">Number of Jobs</th>\r
-</tr>\r
-<tr>\r
-<th>Total</th>\r
-<th>Incomplete</th>\r
-<th>Cancelled</th>\r
-<th>Abandoned</th>\r
-</tr>\r
-</thead>\r
-<tbody>\r
 \r
\r
-<c:forEach items="${stat.allStat}" var="ws" >\r
-<tr>\r
-<td>${ws.key}</td>\r
-<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=all&from=${startDate}&to=${stopDate}">${ws.value.jobNumber}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=incomplete&from=${startDate}&to=${stopDate}">${fn:length(ws.value.incompleteJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=cancelled&from=${startDate}&to=${stopDate}">${fn:length(ws.value.cancelledJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=abandoned&from=${startDate}&to=${stopDate}">${fn:length(ws.value.abandonedJobs)}</a></td>\r
-</tr>\r
-</c:forEach>\r
-\r
-<tr>\r
-<td>Total:</td>\r
-<td>${statTotal.total}</td>\r
-<td>${statTotal.incomplete}</td>\r
-<td>${statTotal.cancelled}</td>\r
-<td>${statTotal.abandoned}</td>\r
-</tr>\r
-</tbody>\r
-</table>\r
+<c:set var="statistics"  value="${stat.allStat}" scope="request"/>\r
+<c:set var="totals" value="${statTotal}" scope="request"/>\r
+<c:import url="StatisticsTable.jsp"/> \r
 \r
 <h2>Local jobs</h2>\r
-<table style="border: 1px solid red; border-collapse: separate;"> \r
-<tr>\r
-<th rowspan="2">Web Service</th>\r
-<th colspan="4" style="text-align: center">Number of Jobs</th>\r
-</tr>\r
-<tr>\r
-<th>Total</th>\r
-<th>Incomplete</th>\r
-<th>Cancelled</th>\r
-<th>Abandoned</th>\r
-</tr>\r
-\r
-<c:forEach items="${stat.localStat}" var="ws" >\r
-<tr>\r
-<td>${ws.key}</td>\r
-<td><a href="Joblist?ws=${ws.key}&where=local&type=all&from=${startDate}&to=${stopDate}">${ws.value.jobNumber}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=local&type=incomplete&from=${startDate}&to=${stopDate}">${fn:length(ws.value.incompleteJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=local&type=cancelled&from=${startDate}&to=${stopDate}">${fn:length(ws.value.cancelledJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=local&type=abandoned&from=${startDate}&to=${stopDate}">${fn:length(ws.value.abandonedJobs)}</a></td>\r
-</tr>\r
-</c:forEach>\r
-\r
-<tr>\r
-<td>Total:</td>\r
-<td>${statTotalLocal.total}</td>\r
-<td>${statTotalLocal.incomplete}</td>\r
-<td>${statTotalLocal.cancelled}</td>\r
-<td>${statTotalLocal.abandoned}</td>\r
-</tr>\r
-\r
-</table>\r
-\r
+<c:set var="statistics"  value="${stat.localStat}" scope="request"/>\r
+<c:set var="totals" value="${statTotalLocal}" scope="request"/>\r
+<c:import url="StatisticsTable.jsp"/>\r
+       \r
\r
 <h2>Cluster jobs</h2>\r
-<table style="border: 1px solid red; border-collapse: separate;"> \r
-<tr>\r
-<th rowspan="2">Web Service</th>\r
-<th colspan="4" style="text-align: center">Number of Jobs</th>\r
-</tr>\r
-<tr>\r
-<th>Total</th>\r
-<th>Incomplete</th>\r
-<th>Cancelled</th>\r
-<th>Abandoned</th>\r
-</tr>\r
-\r
-<c:forEach items="${stat.clusterStat}" var="ws" >\r
-<tr>\r
-<td>${ws.key}</td>\r
-<td><a href="Joblist?ws=${ws.key}&where=cluster&type=all&from=${startDate}&to=${stopDate}">${ws.value.jobNumber}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=cluster&type=incomplete&from=${startDate}&to=${stopDate}">${fn:length(ws.value.incompleteJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=cluster&type=cancelled&from=${startDate}&to=${stopDate}">${fn:length(ws.value.cancelledJobs)}</a></td>\r
-<td><a href="Joblist?ws=${ws.key}&where=cluster&type=abandoned&from=${startDate}&to=${stopDate}">${fn:length(ws.value.abandonedJobs)}</a></td>\r
-</tr>\r
-</c:forEach>\r
-<tr>\r
-<td>Total:</td>\r
-<td>${statTotalCluster.total}</td>\r
-<td>${statTotalCluster.incomplete}</td>\r
-<td>${statTotalCluster.cancelled}</td>\r
-<td>${statTotalCluster.abandoned}</td>\r
-</tr>\r
+<c:set var="statistics"  value="${stat.clusterStat}" scope="request"/>\r
+<c:set var="totals" value="${statTotalCluster}" scope="request"/>\r
+<c:import url="StatisticsTable.jsp"/>\r
 \r
-</table>\r
-\r
-\r
-<%--\r
-<dt:table class="its" id="order" name="${stat.abandonedJobs}" export="true" sort="list"  pagesize="-1" \r
-defaultsort="2" defaultorder="descending">\r
-       <dt:column property="jobname" sortable="true"></dt:column>\r
-</dt:table>\r
 \r
-<form action="" method="post">\r
-       <input name="field1" maxlength="" title=""  type="text"/>\r
-       <input name="field2" maxlength="" title=""  type="text"/>\r
-       <textarea name="field3" cols="10" rows="10"  title="" />\r
-       <input type="submit" name="Submit"/>\r
-</form>\r
- --%>\r
-</body>\r
-</html>
\ No newline at end of file
+<jsp:include page="footer.jsp" />\r
diff --git a/statpages/StatisticsTable.jsp b/statpages/StatisticsTable.jsp
new file mode 100644 (file)
index 0000000..d744abe
--- /dev/null
@@ -0,0 +1,56 @@
+<%--\r
+Author: Peter Troshin\r
+Date: May 2011\r
+--%>\r
+\r
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>\r
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>\r
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>\r
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>\r
+\r
+    \r
+<table class="its" style="border-collapse: separate;"> \r
+<thead>\r
+<tr>\r
+<th rowspan="2">Web Service</th>\r
+<th colspan="4" style="text-align: center">Number of Jobs</th>\r
+</tr>\r
+<tr>\r
+<th>Total</th>\r
+<th>Incomplete</th>\r
+<th>Cancelled</th>\r
+<th>Abandoned</th>\r
+</tr>\r
+</thead>\r
+<tbody>\r
+\r
\r
+<c:forEach items="${statistics}" var="ws" varStatus="status">\r
+<c:choose>\r
+       <c:when test="${status.count%2==0}">\r
+               <tr class="even">\r
+       </c:when>\r
+       <c:otherwise>\r
+               <tr class="odd">\r
+       </c:otherwise>\r
+</c:choose>\r
+\r
+<td>${ws.key}</td>\r
+<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=all&from=${startDate.time}&to=${stopDate.time}">${ws.value.jobNumber}</a></td>\r
+<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=incomplete&from=${startDate.time}&to=${stopDate.time}">${fn:length(ws.value.incompleteJobs)}</a></td>\r
+<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=cancelled&from=${startDate.time}&to=${stopDate.time}">${fn:length(ws.value.cancelledJobs)}</a></td>\r
+<td><a href="Joblist?ws=${ws.key}&where=everywhere&type=abandoned&from=${startDate.time}&to=${stopDate.time}">${fn:length(ws.value.abandonedJobs)}</a></td>\r
+</tr>\r
+</c:forEach>\r
+\r
+<tr style="font-weight: bolder;">\r
+<td>Total:</td>\r
+<td>${totals.total}</td>\r
+<td>${totals.incomplete}</td>\r
+<td>${totals.cancelled}</td>\r
+<td>${totals.abandoned}</td>\r
+</tr>\r
+</tbody>\r
+</table>\r
+<c:remove var="statistics"/>\r
+<c:remove var="totals"/>
\ No newline at end of file
index 6565d96..5a464b6 100644 (file)
@@ -1,24 +1,3 @@
-<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page">
-  <jsp:text>
-    <![CDATA[</div></div></div>]]>
-  </jsp:text>
-
-
-  <div class="clear">
-  <hr />
-  </div>
-  <div id="footer">
-
-
-  <div class="xright">&#169; 2002-2006 the Displaytag team</div>
-  <div class="clear">
-  <hr />
-  </div>
-  </div>
-
-
-
-  <jsp:text>
-    <![CDATA[</body></html>]]>
-  </jsp:text>
-</jsp:root>
+</div> <!-- wrapper end -->
+</body>
+</html>
index 813a6bb..1e54eaa 100644 (file)
-<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="urn:jsptld:http://java.sun.com/jstl/core">
-  <jsp:directive.page contentType="text/html; charset=UTF-8" />
-  <jsp:text>
-    <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]>
-  </jsp:text>
-  <jsp:text>
-    <![CDATA[<html xmlns="http://www.w3.org/1999/xhtml" lang="en">]]>
-  </jsp:text>
-  <head>
-    <title>
-      The
-      <![CDATA[&lt;display:*>]]>
-      tag library
-    </title>
-    <meta http-equiv="Expires" content="-1" />
-    <meta http-equiv="Pragma" content="no-cache" />
-    <meta http-equiv="Cache-Control" content="no-cache" />
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-    <style type="text/css" media="all">
-      @import url("css/maven-base.css"); @import url("css/maven-theme.css"); @import url("css/site.css"); @import
-      url("css/screen.css");
-    </style>
-    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
-  </head>
-  <jsp:text>
-    <![CDATA[<body class="composite">]]>
-  </jsp:text>
-  <div id="banner">
-    <a href="index.jsp" id="bannerRight">
-      <img src="img/displaytag.png" alt="" />
-    </a>
-    <div class="clear">
-      <hr />
-    </div>
-  </div>
-  <div id="breadcrumbs">
-    <div class="xright">
-      <a href="http://displaytag.sf.net">Documentation</a>
-      |
-      <a href="index.jsp">Examples</a>
-    </div>
-    <div class="clear">
-      <hr />
-    </div>
-  </div>
-  <div id="leftColumn">
-    <div id="navcolumn">
-      <h5>Examples</h5>
-      <ul>
-        <li>
-          <a href="example-nocolumns.jsp">Simplest case, no columns</a>
-        </li>
-        <li>
-          <a href="example-columns.jsp">Columns</a>
-        </li>
-        <li>
-          <a href="example-styles.jsp">Styles</a>
-        </li>
-        <li>
-          <a href="example-datasource.jsp">Acquiring your List of data</a>
-        </li>
-        <li>
-          <a href="example-imp-objects.jsp">Implicit objects</a>
-        </li>
-        <li>
-          <a href="example-subsets.jsp">Showing subsets of data</a>
-        </li>
-        <li>
-          <a href="example-autolink.jsp">Smart linking</a>
-        </li>
-        <li>
-          <a href="example-decorator.jsp">Using decorators</a>
-        </li>
-        <li>
-          <a href="example-decorator-link.jsp">Creating dynamic links</a>
-        </li>
-        <li>
-          <a href="example-paging.jsp">Auto-paging of long lists</a>
-        </li>
-        <li>
-          <a href="example-sorting.jsp">Auto-sorting by columns</a>
-        </li>
-        <li>
-          <a href="example-grouping.jsp">Column grouping</a>
-        </li>
-        <li>
-          <a href="example-callbacks.jsp">Using callbacks for totals</a>
-        </li>
-        <li>
-          <a href="example-export.jsp">Data exporting</a>
-        </li>
-        <li>
-          <a href="example-config.jsp">Config, overriding default</a>
-        </li>
-        <li>
-          <a href="example-pse.jsp">All the features together</a>
-        </li>
-        <li>
-          <a href="example-twotables.jsp">More tables on one page</a>
-        </li>
-        <li>
-          <a href="example-nestedtables.jsp">Nested tables</a>
-        </li>
-        <li>
-          <a href="example-caption-footer.jsp">Caption and footer</a>
-        </li>
-        <li>
-          <a href="example-misc.jsp">Misc, odds and ends</a>
-        </li>
-        <li>
-          <a href="example-new-export.jsp">WYSIWYG data exporting</a>
-        </li>
-        <li>
-          <a href="example-format.jsp">Using format</a>
-        </li>
-        <li>
-          <a href="example-columnlist.jsp">Dynamic Column Creation</a>
-        </li>
-        <li>
-          <a href="example-rowclass.jsp">Row highlighting</a>
-        </li>
-        <li>
-          <a href="example-columnsummation.jsp">Column Summation</a>
-        </li>
-        <li>
-          <a href="example-keepstatus.jsp">Preserve pagination status</a>
-        </li>
-        <li>
-          <a href="example-checkboxes.jsp">Posting forms (checkboxes)</a>
-        </li>
-      </ul>
-      <a href="http://validator.w3.org/check?uri=referer" id="poweredBy">
-        <img src="img/valid-xhtml10.png" alt="Valid XHTML 1.0!" height="31" width="88" style="border:none" />
-      </a>
-    </div>
-  </div>
-  <jsp:scriptlet>if (request.getRequestURI().indexOf("example-") != -1) {</jsp:scriptlet>
-  <ul id="showsource">
-    <li><![CDATA[<a href="]]><c:out value="${pageContext.request.requestURI}" />
-      <![CDATA[.source">View source</a>]]></li>
-  </ul>
-  <jsp:scriptlet>}</jsp:scriptlet>
-  <jsp:text>
-    <![CDATA[<div id="bodyColumn">
-      <div id="contentBox">
-      <div class="section">]]>
-  </jsp:text>
-</jsp:root>
+    
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Cluster usage per user</title>
+<style type="text/css" media="all">
+     @import url("${pageContext.request.contextPath}/statpages/screen.css");
+</style>
+<link rel="stylesheet" href="${pageContext.request.contextPath}/statpages/print.css" type="text/css" media="print" />
+
+</head>
+<body>
+<div id="statwrapper">
+
index 302a5d3..9f4c984 100644 (file)
@@ -18,12 +18,12 @@ h4,h5,h6,p,strong,div,form,acronym,label,table,td,th,span,a,hr,code,pre,hr
 }
 
 a,a:visited,a:hover {
-       color: #666;
-       text-decoration: none;
+       color: black;
+       text-decoration: underline;
 }
 
 a:hover {
-       text-decoration: underline;
+       color: #666; 
 }
 
 img {