Convert servlets into Spring controllers
[proteocache.git] / webapp / view / ReportSequenceProtein.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8"
2         pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
5 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
6 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
7 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
8 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
9 <%@page import="java.util.ArrayList"%>
10
11 <html>
12 <jsp:include page="fragments/header.jsp" />
13 <body>
14         <div class="container">
15                 <jsp:include page="fragments/bodyHeader.jsp" />
16                 <spring:url value="/sequence/query" var="searchquery" />
17                 <spring:url value="/joblog/query" var="jobquery" />
18
19                 <c:choose>
20                         <c:when test="${search == 'SearchCounter'}">
21                                 <h3>${njobs} proteins with at least ${counter} jobs</h3>
22                         </c:when>
23                         <c:otherwise>
24                                 <h3>Jobs with the given protein sequences:</h3>
25                         </c:otherwise>
26                 </c:choose>
27                 <h3>Time execution: ${timeExecution} ms</h3>
28                 <c:choose>
29
30                 <c:when test="${results == null}">
31                         <h3>No jobs for sequence ${prot}</h3>
32                 </c:when>
33                 <c:otherwise>
34                         <table border="1" style="border-collapse: collapse; white-space: nowrap">
35                                 <c:choose>
36                                         <c:when test="${search == 'SearchCounter'}">
37                                                 <thead>
38                                                         <tr>
39                                                                 <th style="text-align: centre">Number of jobs</th>
40                                                                 <th style="text-align: left">Protein</th>
41                                                         </tr>
42                                                 </thead>
43                                                 <tbody>
44                                                         <c:forEach items="${results}" var="res">
45                                                                 <tr>
46                                                                         <td>${res.totalId}</td>
47                                                                         <td
48                                                                                 style="text-align: left; border-buttom: dotted; font-family: monospace">
49
50                                                                                 <a title="Click to view all jobs"
51                                                                                 href="${searchquery}?prot=${res.prot}&protein=whole&Search=SearchSequence&counterJob=${counter}">${res.prot}</a>
52                                                                         </td>
53                                                                 </tr>
54                                                         </c:forEach>
55                                         </c:when>
56                                         <c:otherwise>
57                                                 <thead>
58                                                         <tr style="text-align: centre">
59                                                                 <th>Job ID</th>
60                                                                 <th>annotation</th>
61                                                                 <th>Sequence</th>
62                                                         </tr>
63                                                         </thead>
64                                                         <tbody>
65                                                                 <c:forEach items="${results}" var="res" varStatus="status">
66                                                                         <c:set var="ann" value="${res.predictions}" />
67                                                                         <tr style="border-bottom: double">
68                                                                                 <th rowspan="${ann.mapsize + 2}">
69                                                                                 <a title="Click to view the job log" href="${jobquery}?IdJob=${res.id}">${res.id}</a></th>
70                                                                         </tr>
71                                                                         <tr style="border-bottom: double">
72                                                                                 <td
73                                                                                         style="text-align: center; font-weight: bold; font-family: monospace">Protein
74                                                                                         Sequence</td>
75                                                                                 <c:if test="${flag == 'whole'}">
76                                                                                         <td
77                                                                                                 style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
78                                                                                                         value="${res.prot}" /></td>
79                                                                                 </c:if>
80                                                                                 <c:if test="${flag == 'part'}">
81                                                                                         <td
82                                                                                                 style="text-align: left; border-buttom: dotted; font-family: monospace">
83                                                                                                 <c:forEach items="${res.subProt}" var="seq">
84                                                                                                         <c:choose>
85                                                                                                                 <c:when test="${fn:contains(seq, prot)}">
86                                                                                                                         <span style="background-color: blue">${seq}</span>
87                                                                                                                 </c:when>
88                                                                                                                 <c:otherwise>${seq}</c:otherwise>
89                                                                                                         </c:choose>
90                                                                                                 </c:forEach>
91                                                                                         </td>
92                                                                                 </c:if>
93                                                                         </tr>
94                                                                         <c:forEach items="${ann.predictions}" var="seq"
95                                                                                 varStatus="status">
96                                                                                 <tr>
97                                                                                         <td
98                                                                                                 style="text-align: center; font-weight: bold; font-family: monospace"><c:out
99                                                                                                         value="${seq.key}" /></td>
100                                                                                         <td
101                                                                                                 style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
102                                                                                                         value="${seq.value}" /></td>
103                                                                                 </tr>
104                                                                         </c:forEach>
105                                                                 </c:forEach>
106                                                 </c:otherwise>
107                                         </c:choose>
108                                         </tbody>
109                                 </table>
110                         </c:otherwise>
111                 </c:choose>
112
113                 <jsp:include page="fragments/footer.jsp" />
114         </div>
115 </body>
116 </html>