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> |
---|
62 | <script> |
---|
63 | function showDetails(detailsId) |
---|
64 | { |
---|
65 | Main.showHide('details.' + detailsId); |
---|
66 | var icon = document.getElementById('icon.'+detailsId).firstChild; |
---|
67 | if (icon) |
---|
68 | { |
---|
69 | if (icon.src.indexOf('right') > 0) |
---|
70 | { |
---|
71 | icon.src = icon.src.replace('right', 'down'); |
---|
72 | } |
---|
73 | else |
---|
74 | { |
---|
75 | icon.src = icon.src.replace('down', 'right'); |
---|
76 | } |
---|
77 | } |
---|
78 | } |
---|
79 | </script> |
---|
80 | </base:head> |
---|
81 | <base:body> |
---|
82 | <h1>Last installation results</h1> |
---|
83 | |
---|
84 | <div class="content bottomborder"> |
---|
85 | |
---|
86 | <table class="fullform outlined"> |
---|
87 | <tr> |
---|
88 | <th>Status</th> |
---|
89 | <td><%=results.hasError() ? "Error" : "Success" %></td> |
---|
90 | </tr> |
---|
91 | <tr> |
---|
92 | <th class="subprompt">Started</th> |
---|
93 | <td><%=timeFormatter.format(new Date(results.getStartTime()))%></td> |
---|
94 | </tr> |
---|
95 | <tr> |
---|
96 | <th class="subprompt">Ended</th> |
---|
97 | <td><%=timeFormatter.format(new Date(results.getEndTime()))%></td> |
---|
98 | </tr> |
---|
99 | <tr> |
---|
100 | <th>Summary</th> |
---|
101 | <td><%=HTML.niceFormat(results.getSummary())%></td> |
---|
102 | </tr> |
---|
103 | <% |
---|
104 | for (FileResults fileResults : results.getAllResults()) |
---|
105 | { |
---|
106 | ExtensionsFile extFile = fileResults.getExtensionsFile(); |
---|
107 | String detailsId = Integer.toString(extFile.hashCode()); |
---|
108 | List<String> messages = fileResults.getMessages(); |
---|
109 | Throwable validationError = extFile.getValidationError(); |
---|
110 | boolean hasMessages = (messages != null && messages.size() > 0) || validationError != null; |
---|
111 | %> |
---|
112 | <tr> |
---|
113 | <th><%=extFile.getName() %></th> |
---|
114 | <td><%=fileResults.getStatus() %> |
---|
115 | <base:icon |
---|
116 | id="<%="icon." + detailsId %>" |
---|
117 | image="move_right.png" |
---|
118 | onclick="<%="showDetails('" + detailsId + "')" %>" |
---|
119 | visible="<%=hasMessages%>" |
---|
120 | /> |
---|
121 | </td> |
---|
122 | </tr> |
---|
123 | <% |
---|
124 | if (hasMessages) |
---|
125 | { |
---|
126 | %> |
---|
127 | <tr id="details.<%=detailsId %>" style="display:none;"> |
---|
128 | <th class="subprompt"></th><td> |
---|
129 | <ul style="padding-left: 20px; margin: 0px; text-align: left;"> |
---|
130 | <% |
---|
131 | for (String msg : messages) |
---|
132 | { |
---|
133 | %> |
---|
134 | <li><%=HTML.niceFormat(msg)%> |
---|
135 | <% |
---|
136 | } |
---|
137 | if (validationError != null) |
---|
138 | { |
---|
139 | %> |
---|
140 | <li><%=validationError.getClass().getSimpleName()%>: <%=HTML.niceFormat(validationError.getMessage())%> |
---|
141 | <% |
---|
142 | } |
---|
143 | %> |
---|
144 | </ul> |
---|
145 | </td> |
---|
146 | </tr> |
---|
147 | <% |
---|
148 | } |
---|
149 | } |
---|
150 | %> |
---|
151 | <tr class="dynamic"> |
---|
152 | <th></th> |
---|
153 | <td></td> |
---|
154 | </tr> |
---|
155 | </table> |
---|
156 | </div> |
---|
157 | |
---|
158 | <base:buttongroup subclass="dialogbuttons"> |
---|
159 | <base:button onclick="window.close();" title="Close" /> |
---|
160 | </base:buttongroup> |
---|
161 | |
---|
162 | </base:body> |
---|
163 | </base:page> |
---|
164 | <% |
---|
165 | } |
---|
166 | finally |
---|
167 | { |
---|
168 | if (dc != null) dc.close(); |
---|
169 | } |
---|
170 | %> |
---|