Add first banch of JSPs
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 24 Oct 2013 17:27:00 +0000 (18:27 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 24 Oct 2013 17:27:00 +0000 (18:27 +0100)
website/AllReports.jsp [new file with mode: 0644]
website/Index.jsp [new file with mode: 0644]
website/JobLength.jsp [new file with mode: 0644]
website/PrintResult.jsp [new file with mode: 0644]
website/ReportLength.jsp [new file with mode: 0644]
website/ReportNew.jsp [new file with mode: 0644]
website/ReportProt.jsp [new file with mode: 0644]
website/Sample.jsp [new file with mode: 0644]
website/Sequence.jsp [new file with mode: 0644]
website/StatisticsProtein.jsp [new file with mode: 0644]

diff --git a/website/AllReports.jsp b/website/AllReports.jsp
new file mode 100644 (file)
index 0000000..110bc3e
--- /dev/null
@@ -0,0 +1,9 @@
+<%
+       String query = request.getParameter("query");
+       if (query.equals("date"))
+               response.sendRedirect("Sample.jsp");
+       else if (query.equals("length"))
+               response.sendRedirect("JobLength.jsp");
+       else if (query.equals("protein"))
+               response.sendRedirect("Sequence.jsp");
+%>
\ No newline at end of file
diff --git a/website/Index.jsp b/website/Index.jsp
new file mode 100644 (file)
index 0000000..e113e4b
--- /dev/null
@@ -0,0 +1,18 @@
+<%@ 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">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Cassandra report</title>
+</head>
+<body>
+       <form method="post" action="AllReports.jsp">
+               <h3>Choose query type</h3>
+               <input type="radio" name="query" value="protein" Checked>Search by protein sequence<br/>
+               <input type="radio" name="query" value="date">Search by date<br/>
+               <input type="radio" name="query" value="length">Usage statistics by job time execution<br/>             
+               <input type="submit" name="Search" value="Search"/>
+       </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/website/JobLength.jsp b/website/JobLength.jsp
new file mode 100644 (file)
index 0000000..a264db8
--- /dev/null
@@ -0,0 +1,24 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+    <%@page import="java.util.Calendar"%>
+   
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Date interval</title>
+</head>
+<body>
+       <form method="post" action="LengthServlet">
+               <h3>Enter time period</h3>      
+                <% Calendar cal = Calendar.getInstance();
+                String datecalBegin = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) +"/1";
+                String datecalEnd = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
+                %>
+               <p>from  <input type="text" name="data1" value = <%= datecalBegin%> style=" width : 145px;"/>
+               to <input type="text" name="data2" value = <%= datecalEnd%> style=" width : 145px;"/></p>
+               <input type="checkbox" name="option" value="AllDate">Query for all dates<br>
+               <input type="submit" name="Search" value="Search"/>
+       </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/website/PrintResult.jsp b/website/PrintResult.jsp
new file mode 100644 (file)
index 0000000..c2f2e81
--- /dev/null
@@ -0,0 +1,21 @@
+<%@ 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">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Report</title>
+</head>
+<body>
+<h3>Report Results</h3> 
+<%     String rez = request.getAttribute("result").toString();
+       String[] rezLines = rez.split(";");
+       for (int i = 0; i < rezLines.length; i++) {
+%>
+<%= rezLines[i]+"<br/>" %>
+<%
+}
+%>
+<a href="javascript:history.back()">Click here to go Back</a>
+</body>
+</html>
\ No newline at end of file
diff --git a/website/ReportLength.jsp b/website/ReportLength.jsp
new file mode 100644 (file)
index 0000000..c7f9cff
--- /dev/null
@@ -0,0 +1,34 @@
+<%@page import="java.util.ArrayList"%>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ 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" %>
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
+<c:choose>
+<c:when test="${flag == 'AllDate'}">
+<h3>Time execution for the whole period</h3>
+</c:when>
+<c:otherwise>
+<h3>Time execution for the interval: ${data1}  -  ${data2}</h3> 
+</c:otherwise>
+</c:choose>
+<table border="1" style = "border-collapse: collapse; white-space: nowrap"> 
+<thead>
+<tr>
+<th style="text-align: centre;  width: 150px">Date</th>
+<th style="text-align: centre;  width: 150px">less then 30 s</th>
+<th style="text-align: centre;  width: 150px">30 s - 60 s</th>
+<th style="text-align: centre;  width: 150px">1 min - 2 min</th>
+<th style="text-align: centre;  width: 150px">more then 2min</th>
+</tr>
+</thead>
+<tbody>
+<c:forEach items="${result}" var="res">
+<tr>
+<td>${res.date}</td>
+<c:forEach items="${res.timeRez}" var="time">
+<td style="text-align: right">${time}</td>
+</c:forEach>
+</c:forEach>
+</tbody>
+</table>
diff --git a/website/ReportNew.jsp b/website/ReportNew.jsp
new file mode 100644 (file)
index 0000000..498fa8c
--- /dev/null
@@ -0,0 +1,49 @@
+<%@page import="java.util.ArrayList"%>
+<%@ 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" %>
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
+<c:choose>
+<c:when test="${flag == 'AllDate'}">
+<h3>Jobs statistics for the whole period</h3>
+</c:when>
+<c:otherwise>
+<h3>Jobs statistics for the Period: 
+<c:out value = "${data1}"/> to <c:out value = "${data2}"/> </h3>
+</c:otherwise>
+</c:choose>
+<table border="1" style = "border-collapse: collapse; white-space: nowrap"> 
+<thead>
+<tr>
+<th rowspan="2"style="text-align: centre">Date</th>
+<th colspan="4" style="text-align: centre">Number of Proteins</th>
+</tr>
+<tr>
+<th style="text-align: centre">Total</th>
+<th style="text-align: centre">Failed</th>
+<th style="text-align: centre">Cancelled</th>
+<th style="text-align: centre">Abandoned</th>
+</tr>
+</thead>
+<tbody>
+<c:set var="sum"  value="0" />
+<c:forEach items="${result}" var="res">
+<tr>
+<td>${res.date}</td>
+<c:set var="tot"  value="${res.total}" />
+<c:set var="sum"  value="${sum + tot}" />
+<td style="text-align: right"><c:out value = "${res.total}" /></td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+</tr>
+</c:forEach>
+<tr style="font-weight: bolder;">
+<td>Total:</td>
+<td style="text-align: right">${sum}</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+</tr>
+</tbody>
+</table>
\ No newline at end of file
diff --git a/website/ReportProt.jsp b/website/ReportProt.jsp
new file mode 100644 (file)
index 0000000..ad64ac1
--- /dev/null
@@ -0,0 +1,58 @@
+<%@page import="java.util.ArrayList"%>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ 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" %>
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
+
+<h3>Dundee ProteoCache query result</h3>
+<table border="1" style = "border-collapse: collapse; white-space: nowrap"> 
+<c:choose>
+<c:when test="${checkbox == 'AllProtein'}">
+<thead>
+<tr>
+<th style="text-align: centre">Number of jobs</th>
+<th style="text-align: left">Protein</th>
+</tr>
+</thead>
+<tbody>
+<c:forEach items="${result}" var="res">
+<tr>
+<td> ${res.totalId}</td>
+<td style=" text-align: left;  border-buttom:  dotted; font-family: monospace"><a title="Click to view predictions" href="ProtServlet?prot=${res.prot}&protein=whole&Search=Search">${res.prot}</a> </td>
+</tr>
+</c:forEach>
+</c:when>
+<c:otherwise>
+<thead>
+<tr>
+<th style="text-align: centre">ID</th>
+<th style="text-align: centre">Prediction</th>
+</tr>
+</thead>
+<tbody>
+<c:forEach items="${result}" var="res" varStatus="status">
+<tr>
+<td rowspan="2">${res.id}</td>
+<c:if test ="${flag == 'whole'}">
+<td  style=" text-align: left;  border-buttom:  dotted; font-family: monospace"><c:out value = "${res.prot}" /></td>
+</c:if>
+<c:if test ="${flag == 'part'}">
+<td  style=" text-align: left;  border-buttom:  dotted; font-family: monospace">
+<c:forEach items="${res.subProt}" var="seq">
+<c:choose>
+<c:when test="${fn:contains(seq, prot)}"><span style="background-color:blue">${seq}</span></c:when>
+<c:otherwise>${seq}</c:otherwise>
+</c:choose>
+</c:forEach>
+</td>
+</c:if>
+</tr>
+<tr>
+<td style="text-align: left; border-top: hidden; font-family: monospace"><c:out value = "${res.jpred}" /></td>
+</tr>
+</c:forEach>
+</c:otherwise>
+</c:choose>
+</tbody>
+</table>
diff --git a/website/Sample.jsp b/website/Sample.jsp
new file mode 100644 (file)
index 0000000..0116ba7
--- /dev/null
@@ -0,0 +1,24 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+    <%@page import="java.util.Calendar"%>
+   
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Date period</title>
+</head>
+<body>
+       <form method="post" action="QueryServlet">
+               <h3>Enter time period</h3>      
+                <% Calendar cal = Calendar.getInstance();
+                       String datecalBegin = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/1";
+                       String datecalEnd = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
+                %>
+               <p>from  <input type="text" name="data1" value = <%= datecalBegin%> style=" width : 145px;"/>
+               to <input type="text" name="data2" value = <%= datecalEnd%> style=" width : 145px;"/></p>
+               <input type="checkbox" name="option" value="AllDate">Query for all dates<br>
+               <input type="submit" name="Search" value="Search"/>
+       </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/website/Sequence.jsp b/website/Sequence.jsp
new file mode 100644 (file)
index 0000000..5ff90b6
--- /dev/null
@@ -0,0 +1,21 @@
+<%@ 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">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Sequence of protein</title>
+</head>
+<body>
+       <br/>
+       <form method="get" action="ProtServlet">
+               <h3>Enter protein sequence</h3> 
+               <p><textarea rows="2" cols="100" name="prot">MPIDYSKWKDIEVSDDEDDTHPNIDTPSLFRWRHQARLERMAEKKMEQEKIDKEKGTTSKKMEELEKKLAAADVTDKSDIQKQIDEVKAQEEAWRKKEAELEEKERLEPWNVDTIGHEAFSTSRINKI</textarea></p>
+               <input type="radio" name="protein" value="whole"  Checked>search by the whole sequence
+               <input type="radio" name="protein" value="part">search by a part of sequence<br/>
+               <input type="submit" name="Search" value="Search"/><br/><br/>
+               <input type="checkbox" name="option" value="AllProtein">Sequence with more then 3 jobs<br>
+       </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/website/StatisticsProtein.jsp b/website/StatisticsProtein.jsp
new file mode 100644 (file)
index 0000000..06c7d72
--- /dev/null
@@ -0,0 +1,41 @@
+<%@ 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" %>
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
+
+<table class="its" style="width:800px" border="1"> 
+<thead>
+<tr>
+<th rowspan="2"style="text-align: centre">Date</th>
+<th colspan="4" style="text-align: centre">Number of Proteins</th>
+</tr>
+<tr>
+<th style="text-align: centre">Total</th>
+<th style="text-align: centre">Failed</th>
+<th style="text-align: centre">Cancelled</th>
+<th style="text-align: centre">Abandoned</th>
+</tr>
+</thead>
+<tbody>
+<c:set var="sum"  value="0" />
+<c:forEach items="${statistics}" var="res">
+<tr>
+<td>${res.date}</td>
+<c:set var="tot"  value="${res.total}" />
+<c:set var="sum"  value="${sum + tot}" />
+<td style="text-align: right"><c:out value = "${res.total}" /></td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+</tr>
+</c:forEach>
+<tr style="font-weight: bolder;">
+<td>Total:</td>
+<td style="text-align: right">${sum}</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+<td style="text-align: right">0</td>
+
+</tr>
+</tbody>
+</table>