1 | <%-- $Id:manual_scan.jsp 4187 2008-03-20 11:15:25Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2005 Nicklas Nordborg |
---|
4 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
---|
5 | Copyright (C) 2007 Martin Svensson |
---|
6 | |
---|
7 | This file is part of BASE - BioArray Software Environment. |
---|
8 | Available at http://base.thep.lu.se/ |
---|
9 | |
---|
10 | BASE is free software; you can redistribute it and/or |
---|
11 | modify it under the terms of the GNU General Public License |
---|
12 | as published by the Free Software Foundation; either version 3 |
---|
13 | of the License, or (at your option) any later version. |
---|
14 | |
---|
15 | BASE is distributed in the hope that it will be useful, |
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | GNU General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU General Public License |
---|
21 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
22 | ------------------------------------------------------------------ |
---|
23 | |
---|
24 | @author Nicklas |
---|
25 | @version 2.0 |
---|
26 | --%> |
---|
27 | <%@ page pageEncoding="UTF-8" session="false" |
---|
28 | import="net.sf.basedb.core.SessionControl" |
---|
29 | import="net.sf.basedb.core.DbControl" |
---|
30 | import="net.sf.basedb.core.Item" |
---|
31 | import="net.sf.basedb.core.Permission" |
---|
32 | import="net.sf.basedb.clients.web.Base" |
---|
33 | import="net.sf.basedb.clients.web.WebException" |
---|
34 | import="net.sf.basedb.util.Values" |
---|
35 | import="net.sf.basedb.clients.web.util.HTML" |
---|
36 | import="net.sf.basedb.util.extensions.ExtensionPoint" |
---|
37 | import="net.sf.basedb.util.extensions.Extension" |
---|
38 | import="net.sf.basedb.util.extensions.manager.ExtensionsFile" |
---|
39 | import="net.sf.basedb.util.extensions.manager.ProcessResults" |
---|
40 | import="net.sf.basedb.util.extensions.manager.ProcessResults.FileResults" |
---|
41 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
42 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
43 | import="net.sf.basedb.util.formatter.Formatter" |
---|
44 | import="java.util.Date" |
---|
45 | import="java.util.List" |
---|
46 | %> |
---|
47 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
48 | <% |
---|
49 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
50 | final String ID = sc.getId(); |
---|
51 | final float scale = Base.getScale(sc); |
---|
52 | DbControl dc = null; |
---|
53 | try |
---|
54 | { |
---|
55 | dc = sc.newDbControl(); |
---|
56 | ExtensionsControl ec = ExtensionsControl.get(dc); |
---|
57 | ProcessResults results = ec.getLastScanResults(); |
---|
58 | Formatter timeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
---|
59 | %> |
---|
60 | <base:page type="popup" title="Last installation results"> |
---|
61 | <base:head scripts="~scan_results.js" /> |
---|
62 | <base:body> |
---|
63 | <h1>Last installation results</h1> |
---|
64 | |
---|
65 | <div class="content bottomborder"> |
---|
66 | |
---|
67 | <table class="fullform outlined"> |
---|
68 | <tr> |
---|
69 | <th>Status</th> |
---|
70 | <td><%=results.hasError() ? "Error" : "Success" %></td> |
---|
71 | </tr> |
---|
72 | <tr> |
---|
73 | <th class="subprompt">Started</th> |
---|
74 | <td><%=timeFormatter.format(new Date(results.getStartTime()))%></td> |
---|
75 | </tr> |
---|
76 | <tr> |
---|
77 | <th class="subprompt">Ended</th> |
---|
78 | <td><%=timeFormatter.format(new Date(results.getEndTime()))%></td> |
---|
79 | </tr> |
---|
80 | <tr> |
---|
81 | <th>Summary</th> |
---|
82 | <td><%=HTML.niceFormat(results.getSummary())%></td> |
---|
83 | </tr> |
---|
84 | <% |
---|
85 | for (FileResults fileResults : results.getAllResults()) |
---|
86 | { |
---|
87 | ExtensionsFile extFile = fileResults.getExtensionsFile(); |
---|
88 | String detailsId = Integer.toString(extFile.hashCode()); |
---|
89 | List<String> messages = fileResults.getMessages(); |
---|
90 | Throwable validationError = extFile.getValidationError(); |
---|
91 | boolean hasMessages = (messages != null && messages.size() > 0) || validationError != null; |
---|
92 | %> |
---|
93 | <tr> |
---|
94 | <th><%=extFile.getName() %></th> |
---|
95 | <td><%=fileResults.getStatus() %> |
---|
96 | <base:icon |
---|
97 | id="<%="icon." + detailsId %>" |
---|
98 | subclass="auto-init" |
---|
99 | data-auto-init="details" |
---|
100 | data-details-id="<%=detailsId%>" |
---|
101 | image="move_right.png" |
---|
102 | visible="<%=hasMessages%>" |
---|
103 | /> |
---|
104 | </td> |
---|
105 | </tr> |
---|
106 | <% |
---|
107 | if (hasMessages) |
---|
108 | { |
---|
109 | %> |
---|
110 | <tr id="details.<%=detailsId %>" style="display:none;"> |
---|
111 | <th class="subprompt"></th><td> |
---|
112 | <ul style="padding-left: 20px; margin: 0px; text-align: left;"> |
---|
113 | <% |
---|
114 | for (String msg : messages) |
---|
115 | { |
---|
116 | %> |
---|
117 | <li><%=HTML.niceFormat(msg)%> |
---|
118 | <% |
---|
119 | } |
---|
120 | if (validationError != null) |
---|
121 | { |
---|
122 | %> |
---|
123 | <li><%=validationError.getClass().getSimpleName()%>: <%=HTML.niceFormat(validationError.getMessage())%> |
---|
124 | <% |
---|
125 | } |
---|
126 | %> |
---|
127 | </ul> |
---|
128 | </td> |
---|
129 | </tr> |
---|
130 | <% |
---|
131 | } |
---|
132 | } |
---|
133 | %> |
---|
134 | <tr class="dynamic"> |
---|
135 | <th></th> |
---|
136 | <td></td> |
---|
137 | </tr> |
---|
138 | </table> |
---|
139 | </div> |
---|
140 | |
---|
141 | <base:buttongroup subclass="dialogbuttons"> |
---|
142 | <base:button id="close" title="Close" /> |
---|
143 | </base:buttongroup> |
---|
144 | |
---|
145 | </base:body> |
---|
146 | </base:page> |
---|
147 | <% |
---|
148 | } |
---|
149 | finally |
---|
150 | { |
---|
151 | if (dc != null) dc.close(); |
---|
152 | } |
---|
153 | %> |
---|