Add the "Reload" and "CSV" buttons
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 10 Jan 2014 14:53:06 +0000 (14:53 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 10 Jan 2014 14:53:06 +0000 (14:53 +0000)
16 files changed:
server/compbio/controllers/BasicController.java
server/compbio/controllers/DailyStatisticsController.java
server/compbio/controllers/IPDataController.java
server/compbio/controllers/JobController.java
server/compbio/controllers/MainController.java
server/compbio/controllers/SSFeaturesController.java
server/compbio/controllers/SequenceController.java
webapp/view/reportIP.jsp
webapp/view/reportIPstatistics.jsp
webapp/view/reportJobLog.jsp
webapp/view/reportJobStatistics.jsp
webapp/view/reportJobStatisticsOneDay.jsp
webapp/view/reportProteinSequences.jsp
webapp/view/reportProteinSequencesCounter.jsp
webapp/view/reportSSFeatures.jsp
webapp/view/reportTimeExecution.jsp

index a714c4d..d97b59c 100644 (file)
@@ -17,7 +17,7 @@ public class BasicController {
        protected Calendar cal = Calendar.getInstance();
        protected String theEaerlistDate = DateFormatter.DateLongToString(CassandraReader.earliestDate(), formaterYYMMDD);
        protected String theCurrentDate = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
-       
+
        protected String getPrincipalName() {
                Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
                if (principal instanceof UserDetails) {
@@ -64,20 +64,21 @@ public class BasicController {
                }
                return false;
        }
-       
+
        protected String DateChecking(String trimmeddate1, String trimmeddate2, long longDate1, long longDate2) {
                Calendar cal2 = Calendar.getInstance();
-               if (trimmeddate1.equalsIgnoreCase("") || trimmeddate2.equalsIgnoreCase("")) 
+               if (trimmeddate1.equalsIgnoreCase("") || trimmeddate2.equalsIgnoreCase(""))
                        return "The date cann't be empty";
-               else if (!DateFormatter.isThisDateValid(trimmeddate1, formaterYYMMDD) || !DateFormatter.isThisDateValid(trimmeddate2, formaterYYMMDD)) 
+               else if (!DateFormatter.isThisDateValid(trimmeddate1, formaterYYMMDD)
+                               || !DateFormatter.isThisDateValid(trimmeddate2, formaterYYMMDD))
                        return "The date format in invalid. Try format yyyy/mm/dd";
-               else if (longDate2 < CassandraReader.earliestDate()) 
+               else if (longDate2 < CassandraReader.earliestDate())
                        return "The date2 is after the earlestDate " + theEaerlistDate;
                else if (longDate1 > cal2.getTimeInMillis())
                        return "The date1 is before the current date " + theCurrentDate;
-               else if (longDate1 > longDate2)         
+               else if (longDate1 > longDate2)
                        return "Wrong date's diaposon. The date1 is more than date2.";
-               else                    
+               else
                        return null;
        }
 }
index 72ece7e..a9b51f1 100644 (file)
@@ -14,6 +14,7 @@ import compbio.engine.JobStatus;
 import compbio.cassandra.CassandraReader;
 import compbio.cassandra.DateBean;
 import compbio.cassandra.DateFormatter;
+import compbio.cassandra.Total;
 import compbio.cassandra.TotalJobsStatisticBean;
 import compbio.statistic.CassandraRequester;
 
@@ -60,8 +61,8 @@ public class DailyStatisticsController extends BasicController {
         *            the final date for the report (if option is set, date2 =
         *            today)
         * @param option
-        *            defined whether the whole time range of jobs is reported
-        *            (null means date1 and date2 are used)
+        *            defined whether the whole time range of jobs is reported (null
+        *            means date1 and date2 are used)
         * @return link to the report JSP page
         */
        @RequestMapping(value = "/stat/jobsdaily/results", method = RequestMethod.GET)
@@ -101,6 +102,14 @@ public class DailyStatisticsController extends BasicController {
                model.put("date2", date2);
                TotalJobsStatisticBean res = cr.countJobs(date1, date2);
                model.put("result", res);
+               Map<String, Total> results = res.getDateTotal();
+               String csvline = "\'Date\',\'Total\',\'OK\',\'Stopped\',\'Error\',\'Timeout\'%0A";
+               for (Map.Entry<String, Total> entry : results.entrySet()) {
+                       csvline += "\'" + entry.getKey() + "\',\'" + entry.getValue().getTotal() + "\',\'" + entry.getValue().getTotalOK() + "\',\'"
+                                       + entry.getValue().getTotalStopped() + "\',\'" + entry.getValue().getTotalError() + "\',\'"
+                                       + entry.getValue().getTotalTimeOut() + "\'%0A";
+               }
+               model.put("csvfile", csvline);
                model.put("ndays", res.getDateTotal().size());
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
index 5f3f5e1..86f752e 100644 (file)
@@ -63,9 +63,16 @@ public class IPDataController extends BasicController {
                List<TotalByCounterBean> r = cr.readIpByCounter(realcounter);
                model.put("results", r);
                model.put("njobs", 0);
+               String csvline = "";
                if (null != r) {
                        model.put("njobs", r.size());
+                       csvline = "\'Job%20 count\', \'IP\'%0A";
                }
+               // form line for CSV file
+               for (TotalByCounterBean b : r) {
+                       csvline += "\'" + b.getTotaljobs() + "\',\'" + b.getName() + "\'%0A";
+               }
+               model.put("csvfile", csvline);
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
                model.put("counter", realcounter);
index 4819e75..254fdc2 100644 (file)
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import compbio.statistic.CassandraRequester;
-import compbio.cassandra.CassandraNativeConnector;
 import compbio.cassandra.DataBase;
 import compbio.engine.archive.ArchivedJob;
 
@@ -91,6 +90,23 @@ public class JobController extends BasicController {
                model.put("option", option);
                List<DataBase> res = sp.extractExecutionTime(date1, date2);
                model.put("result", res);
+               String csvline = "";
+               if (0 < res.size()) {
+                       csvline = "\'Date\',\'Total\',\'0-30 sec\',\'30-60 sec\',\'1-2 min\',\'2-10 min\',\'more 10 min\'%0A";
+                       for (DataBase entry : res) {
+                               List<Integer> counts = entry.getTimeRez();
+                               int total = 0;
+                               for (int i = 0; i < counts.size(); ++i) {
+                                       total += counts.get(i);
+                               }
+                               csvline += "\'" + entry.getDate() + "\',\'" + total;
+                               for (int i = 0; i < counts.size(); ++i) {
+                                       csvline += "\',\'" + counts.get(i);
+                               }
+                               csvline += "\'%0A";
+                       }
+               }
+               model.put("csvfile", csvline);
                model.put("ndays", res.size() - 1);
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
@@ -131,8 +147,7 @@ public class JobController extends BasicController {
         * 
         * @param indate
         *            date in milliseconds from 1 Jan 1970
-        * @return date 
-        *            in the form of yyyy/mm/dd
+        * @return date in the form of yyyy/mm/dd
         */
        private String DateFormatYYMMDD(long indate) {
                SimpleDateFormat datformat = new SimpleDateFormat("yyyy/MM/dd");
index d5bef44..d555d36 100644 (file)
@@ -11,7 +11,8 @@ public class MainController extends BasicController {
        @RequestMapping(value = "/index", method = RequestMethod.GET)
        public String printPublicHome(ModelMap model) {
                model.addAttribute("username", getPrincipalName());
-               if (isUserRole()) return "home";
+               if (isUserRole())
+                       return "home";
                return "public";
        }
 
@@ -38,7 +39,7 @@ public class MainController extends BasicController {
        }
 
        @RequestMapping(value = "/home", method = RequestMethod.GET)
-       public String printHome(ModelMap model ) {
+       public String printHome(ModelMap model) {
                model.addAttribute("username", getPrincipalName());
                return "home";
        }
index 0339659..ba81cab 100644 (file)
@@ -69,9 +69,20 @@ public class SSFeaturesController extends BasicController {
                Map<String, String> r = cr.readProteinsPrediction(typeFeature, realpercent);
                model.put("results", r);
                model.put("njobs", 0);
+               String csvline = "";
                if (null != r) {
                        model.put("njobs", r.size());
+                       csvline = "\'Prediction%20number\',\'Protein%20Sequence\', \'Secondary%20Structure%20Prediction\'%0A";
                }
+
+               // form line for CSV file
+               int counter = 1;
+               for (Map.Entry<String, String> entry : r.entrySet()) {
+                       csvline += "\'" + counter + "\',\'" + entry.getKey() + "\',\'" + entry.getValue() + "\'%0A";
+                       ++counter;
+               }
+               model.put("csvfile", csvline);
+
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
                model.put("feature", typeFeature);
index df4c987..738e2d8 100644 (file)
@@ -1,5 +1,6 @@
 package compbio.controllers;
 
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
@@ -9,7 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import compbio.cassandra.DataBase;
 import compbio.cassandra.ProteinBean;
+import compbio.cassandra.Total;
 import compbio.cassandra.TotalByCounterBean;
 import compbio.statistic.CassandraRequester;
 
@@ -68,7 +71,7 @@ public class SequenceController extends BasicController {
                model.put("njobs", 0);
                model.put("prot", trimmedsequence);
                model.put("searchtype", searchtype);
-
+               String csvline = "";
                if (0 < trimmedsequence.length()) {
                        CassandraRequester cr = new CassandraRequester();
                        List<ProteinBean> r = cr.readProteins(trimmedsequence, searchtype);
@@ -78,8 +81,23 @@ public class SequenceController extends BasicController {
                                        model.put("njobs", r.get(0).getJobid().size());
                                else
                                        model.put("njobs", r.size());
+                               csvline = "\'Job\',\'Annotation\',\'Sequence\'%0A";
+                       }
+                       // form CSV file string
+                       for (ProteinBean entry : r) {
+                               List<String> jobs = entry.getJobid();
+                               String protein = entry.getSequence();
+                               LinkedHashMap<String, String> predictions = entry.getPredictions();
+                               for (String job : jobs) {
+                                       csvline += "\'" + job + "\',\'Sequence\',\'" + protein + "\',\'%0A";
+                                       for (Map.Entry<String, String> pr : predictions.entrySet()) {
+                                               csvline += "\'\',\'" + pr.getKey() + "\',\'" + pr.getValue() + "\'%0A";
+                                       }
+                               }
                        }
                }
+               model.put("csvfile", csvline);
+
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
                return "reportProteinSequences";
@@ -113,11 +131,27 @@ public class SequenceController extends BasicController {
 
                CassandraRequester cr = new CassandraRequester();
                List<TotalByCounterBean> r = cr.readProteinByCounter(realcounter);
-               model.put("results", r);
                model.put("njobs", 0);
+               String csvline = "";
                if (null != r) {
                        model.put("njobs", r.size());
+                       csvline = "\'Job%20 count\', \'Protein%20Sequence\'%0A";
                }
+               // form line for CSV file
+
+               for (TotalByCounterBean b : r) {
+                       if (b.getName().equals("")) {
+                               csvline += "\'" + b.getTotaljobs() + "\',\'Alignment%20job\'%0A";
+                               // fix problem with records without protein sequence (alignment
+                               // jobs)
+                               b.setName("Alignment job");
+                       } else {
+                               csvline += "\'" + b.getTotaljobs() + "\',\'" + b.getName() + "\'%0A";
+                       }
+               }
+               model.put("csvfile", csvline);
+
+               model.put("results", r);
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
                model.put("counter", realcounter);
index 0d87c6e..529defc 100644 (file)
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/job/results" var="jobqueryservlet" />
 
+               <c:set var="csv" value="\'Job ID\', \'Date\', \'Sequence\'"/>
+               <c:forEach items="${results.mainInfo}" var="res" varStatus="status">
+                       <c:set var="csv" value="${csv}%0A'${res.key}"/>
+                       <c:forEach items="${res.value}" var="info" varStatus="status">
+                               <c:if test="${status.first}">
+                                       <c:set var="csv" value="${csv}\',\'${info}"/>
+                               </c:if>
+                               <c:if test="${!status.first}">
+                                       <c:choose>
+                                               <c:when test="${info==''}">
+                                                       <c:set var="csv" value="${csv}\',\'Alignment job"/>
+                                               </c:when>
+                                               <c:otherwise>
+                                                       <c:set var="csv" value="${csv}\',\'${info}"/>
+                                               </c:otherwise>
+                                       </c:choose>
+                               </c:if>
+                       </c:forEach>
+                       <c:set var="csv" value="${csv}\'"/>
+               </c:forEach>
+
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csv}" class="btn btn-default active">CSV</a>
+                       </li>
+               </ul>
+
+
        <div class="panel panel-default">
        <div class="panel-heading">
                <p style="font-weight:bold;">Jobs executed from ${ip}</p>
@@ -25,6 +57,7 @@
                        <c:otherwise>
                                <p>${njobs} jobs found:</p>
                                <div class="table-responsive">
+                                       <div class="grid-wrapper-div">
                                        <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                        <tr>
@@ -57,6 +90,7 @@
                                                        </c:forEach>
                                                </tbody>
                                        </table>
+                                       </div>
                                </div>
                        </c:otherwise>
                </c:choose>
index 2a6c882..2214e5e 100644 (file)
        <div class="container">
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/admin/ip/results" var="ipquery" />
+               <spring:url value="/admin/ip/counts/results?JobCounter=${counter}" var="the_query"/>
+
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${csvfile != ''}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
 
        <div class="panel panel-default">
        <div class="panel-heading">
-               <div style="font-weight:bold;">Jobs Statistics</div>
+               <p style="font-weight:bold;">IP Statistics</p>
        </div>
        <div class="panel-body">
 
@@ -26,7 +39,7 @@
                <c:otherwise>
                        <p>${njobs} IP with at least ${counter} jobs ever launched</p>
                        <div class="table-responsive">
-                       <table class="table table-striped table-hover table-bordered">
+                       <table class="table table-striped table-hover table-bordered" id="counts">
                        <thead>
                                <tr>
                                        <th style="text-align: centre">Number of jobs</th>
index da1fcde..115f9af 100644 (file)
                                <spring:url value="../${jobarchive}" var="jobarchivefile" />
                                <p>Job archive: <a title="Click to get the file" href="${jobarchivefile}">download</a></p>
                        </c:if>
+                       <div class="grid-wrapper-div">
                        <table class="table table-striped table-hover table-bordered">
                        <tbody>
+                               <thead>
+                                       <tr>
+                                               <th>ID</th>
+                                               <th >Sequence</th>
+                                       </tr>
+                               </thead>
                                <tr>
-                                       <td>Sequence</td>
-                                       <td style="text-align: left; border-buttom: dotted; font-family: monospace">
+                                       <td>Protein</td>
+                                       <td >
                                                <a title="Click to view other jobs" href="${sequence_query}?sequence=${result.sequence}&searchtype=whole">${result.sequence}</a>
                                        </td>
                                </tr>
@@ -44,6 +51,7 @@
                                </c:forEach>
                        </tbody>
                        </table>
+                       </div>
                </div>
                </div>
 
index 185cbfc..09a3a87 100644 (file)
                <spring:url value="/stat/jobsoneday/results" var="oneday_query" />
                <spring:url value="/stat/jobsdaily/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
 
-       <ul class="nav navbar-nav navbar-right">
-               <li>
-               <a href="${the_query}" class="btn btn-default active">Reload</a>
-               </li>
-       </ul>
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${csvfile != ''}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
 
        <div class="panel panel-default">
        <div class="panel-heading">
index 82a3def..23af0ac 100644 (file)
@@ -12,6 +12,7 @@
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/job/results" var="job_query" />
                <spring:url value="/stat/onedaystat?date=${date}&status=${status}" var="the_query" />
+               <spring:url value="/sequence/sequence/results" var="sequence_query" />
 
        <ul class="nav navbar-nav navbar-right">
                <li>
                                                        <td>Job with alignment</td>
                                        </c:when>
                                        <c:otherwise>
-                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">${res.value}</td>
+                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">
+                                               <!-- ${res.value}-->
+                                               <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.value}&searchtype=whole">
+                                               <script>
+                                                       document.write(shorten('${res.value}', 108));
+                                               </script>
+                                               </a>
+                                               </td>
                                        </c:otherwise>
                                        </c:choose>
                                        
index c6be974..b7e7923 100644 (file)
        <div class="container">
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/job/results" var="job_query" />
+               <spring:url value="/sequence/sequence/results?sequence=${prot}&searchtype=${searchtype}" var="the_query"/>
+               <c:set var="shortensequencelength" value="108"/>
 
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${csvfile != '' and csvfile != null}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
+               
        <div class="panel panel-default">
        <div class="panel-heading">
                <c:choose>
                        <c:when test="${searchtype == 'whole'}">
-                               <p style="font-weight:bold;">Jobs for the protein sequence: ${prot}</p>
+                               <p style="font-weight:bold;">
+                               Jobs for the protein sequence:
+                               <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
+                               </p>
                        </c:when>
                        <c:otherwise>
-                               <p style="font-weight:bold;">Jobs for the protein sequences, which include the substring:
-                                       ${prot}</p>
+                               <p style="font-weight:bold;">
+                               Jobs for the protein sequences, which include the substring: 
+                               <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
+                               </p>
                        </c:otherwise>
                </c:choose>
        </div>
@@ -34,6 +53,7 @@
                        <c:otherwise>
                                <p>${njobs} jobs found</p>
                                <div class="table-responsive">
+                                       <div class="grid-wrapper-div">
                                        <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                        <tr>
@@ -51,7 +71,7 @@
                                                                                href="${job_query}?IdJob=${id}">${id}</a></th>
                                                                </tr>
                                                                <tr>
-                                                                       <td style="text-align: center; font-weight: bold; font-family: monospace">Protein Sequence</td>
+                                                                       <td style="text-align: center; font-weight: bold; font-family: monospace">Sequence</td>
                                                                        <c:if test="${searchtype == 'whole'}">
                                                                                <td
                                                                                        style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
                                                        </c:forEach>
                                                </tbody>
                                        </table>
+                                       </div>
                                </div>
                        </c:otherwise>
                </c:choose>
index 93af680..e76f6f5 100644 (file)
@@ -1,26 +1,39 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8"
-       pageEncoding="UTF-8"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
-<%@page import="java.util.ArrayList"%>
 
 <html>
 <jsp:include page="fragments/header.jsp" />
+
 <body>
        <div class="container">
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/sequence/sequence/results" var="sequence_query" />
+               <spring:url value="/sequence/counts/results?counterJob=${counter}" var="the_query" />
+               <c:set var="shortensequencelength" value="108"/>
+
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${njobs > 0}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
 
        <div class="panel panel-default">
        <div class="panel-heading">
-               <div style="font-weight:bold;">Jobs Statistics</div>
+               <p style="font-weight:bold;">Jobs Statistics</p>
        </div>
-       <div class="panel-body">
 
+       <div class="panel-body">
                <c:choose>
                <c:when test="${njobs == 0}">
                        <p>No proteins with at least ${counter} jobs found</p>
@@ -28,7 +41,7 @@
                <c:otherwise>
                        <p>${njobs} proteins with at least ${counter} jobs found</p>
                        <div class="table-responsive">
-                       <table class="table table-striped table-hover table-bordered">
+                       <table class="table table-striped table-hover table-bordered" id="counts">
                        <thead>
                                <tr>
                                        <th style="text-align: centre">Number of jobs</th>
                                <c:forEach items="${results}" var="res">
                                        <tr>
                                                <td>${res.totaljobs}</td>
-                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">
-                                                       <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&searchtype=whole">${res.name}</a>
+                                               <td style="text-overflow:ellipsis text-align: left; font-family: monospace" id="proteinline">
+                                                       <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&searchtype=whole">
+                                                       <script>
+                                                               document.write(shorten('${res.name}', '${shortensequencelength}'));
+                                                       </script>
+                                                       <!-- ${res.name}-->
+                                                       </a>
                                                </td>
                                        </tr>
                                </c:forEach>
index 7aae5d0..6363d24 100644 (file)
        <div class="container">
                <jsp:include page="fragments/mainmenu.jsp" />
                <spring:url value="/sequence/sequence/results" var="sequence_query" />
+               <spring:url value="/features/results" var="the_query"/>
+               <spring:url value="/features/results?TypeFeatures=${feature}&Percent=${percent}" var="the_query" />
+
+       <!-- reload and CSV buttons -->
+       <ul class="nav navbar-nav navbar-right">
+               <li>
+               <a href="${the_query}" class="btn btn-default active">Reload</a>
+               </li>
+               <c:choose><c:when test="${csvfile != ''}">
+               <li>
+               <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+               </li>
+               </c:when></c:choose>
+       </ul>
 
        <div class="panel panel-default">
        <div class="panel-heading">
-               <div style="font-weight:bold;">Protein Secondary Structure Feature Statistics</div>
+               <p style="font-weight:bold;">Protein Secondary Structure Feature Statistics</p>
        </div>
-       <div class="panel-body">
 
+       <div class="panel-body">
                <c:choose>
                <c:when test="${njobs == 0}">
                        <p>No proteins with feature ${feature} more then ${percent}% of the protein sequence found</p>
                                        <tr>
                                                <td rowspan = 2>${count}
                                                <td style="text-align: left; border-buttom: dotted; font-family: monospace">
-                                               <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.key}&searchtype=whole">${res.key}</a></td>
+                                               <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.key}&searchtype=whole">
+                                               <script>
+                                                       document.write(shorten('${res.key}', 108));
+                                               </script>
+                                               </a></td>
                                        </tr>
                                        <tr>
-                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">${res.value}</td>
+                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">
+                                               <script>
+                                                       document.write(shorten('${res.value}', 108));
+                                               </script>
+                                               </td>
                                        </tr>
                                </c:forEach>
                        </tbody>
index 64cef89..d434a2c 100644 (file)
 <body>
        <div class="container">
                <jsp:include page="fragments/mainmenu.jsp" />
-               <spring:url value="/stat/exectime/query?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
+               <spring:url value="/stat/exectime/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
 
-       <!-- reload button  -->
+       <!-- reload and CSV buttons -->
        <ul class="nav navbar-nav navbar-right">
                <li>
                <a href="${the_query}" class="btn btn-default active">Reload</a>
                </li>
+               <c:choose><c:when test="${csvfile != ''}">
+               <li>
+               <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CVS</a>
+               </li>
+               </c:when></c:choose>
        </ul>
 
+       <!-- main data loop  -->
        <div class="panel panel-default">
        <div class="panel-heading">
                <c:choose>