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