From: pvtroshin Date: Fri, 1 Jul 2011 10:59:53 +0000 (+0000) Subject: Add servlet for public usage stats display. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=eff7555f38a27ff33111f4ff1e83c4ae8186df16;p=jabaws.git Add servlet for public usage stats display. git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4384 e3abac25-378b-4346-85de-24260fe3988d --- diff --git a/TODO.txt b/TODO.txt index 67dc7b9..d502d48 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,7 +1,7 @@ JABA 1 is to keep working, later when 2 is ready replace jabaws mapping to point to JABA 2 but provide a link to JABA 1. -install JABA 1 stat server ++install JABA 1 stat server +Get path to Java executable from JAVA_HOME ? (for Jronn AACon) +Describe requirements diff --git a/WEB-INF/web.xml b/WEB-INF/web.xml index 4c01fb9..e9b1b39 100644 --- a/WEB-INF/web.xml +++ b/WEB-INF/web.xml @@ -58,6 +58,12 @@ compbio.stat.servlet.AnnualStat + + Display monthly summary statistics with no links to details + PublicAnnualStat + compbio.stat.servlet.AnnualStat + + RegistryWS com.sun.xml.ws.transport.http.servlet.WSServlet @@ -139,6 +145,12 @@ /AnnualStat + + PublicAnnualStat + /PublicAnnualStat + + + Joblist /Joblist diff --git a/statpages/MonthlySummary.jsp b/statpages/MonthlySummary.jsp index d69db5a..81db03a 100644 --- a/statpages/MonthlySummary.jsp +++ b/statpages/MonthlySummary.jsp @@ -37,7 +37,17 @@ Date: May 2011 - + + + + + + + + + + + ${monthTotal.value.total} ${monthTotal.value.incomplete} ${monthTotal.value.cancelled} @@ -70,5 +80,9 @@ For each month the table contains the following information. The summary for each column is displayed in the last row of the table. + +

Please login as administrator to view the detailed statistics (help)

+
+ \ No newline at end of file diff --git a/webservices/compbio/stat/servlet/AnnualStat.java b/webservices/compbio/stat/servlet/AnnualStat.java index cc3db41..e1baf12 100644 --- a/webservices/compbio/stat/servlet/AnnualStat.java +++ b/webservices/compbio/stat/servlet/AnnualStat.java @@ -40,6 +40,8 @@ public class AnnualStat extends HttpServlet { RequestDispatcher dispatcher = req .getRequestDispatcher("statpages/MonthlySummary.jsp"); + + req.setAttribute("isAdmin", isAdmin(req)); dispatcher.forward(req, resp); } catch (SQLException e) { @@ -48,4 +50,8 @@ public class AnnualStat extends HttpServlet { } } + static boolean isAdmin(final HttpServletRequest request) { + return request.isUserInRole("admin"); + } + }