4745 |
10 Feb 09 |
nicklas |
1 |
<%-- $Id$ |
4745 |
10 Feb 09 |
nicklas |
2 |
------------------------------------------------------------------ |
4745 |
10 Feb 09 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
4745 |
10 Feb 09 |
nicklas |
4 |
|
4745 |
10 Feb 09 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
4745 |
10 Feb 09 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
4745 |
10 Feb 09 |
nicklas |
7 |
|
4745 |
10 Feb 09 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
4745 |
10 Feb 09 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
4745 |
10 Feb 09 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
4745 |
10 Feb 09 |
nicklas |
11 |
of the License, or (at your option) any later version. |
4745 |
10 Feb 09 |
nicklas |
12 |
|
4745 |
10 Feb 09 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
4745 |
10 Feb 09 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4745 |
10 Feb 09 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4745 |
10 Feb 09 |
nicklas |
16 |
GNU General Public License for more details. |
4745 |
10 Feb 09 |
nicklas |
17 |
|
4745 |
10 Feb 09 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4745 |
10 Feb 09 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4745 |
10 Feb 09 |
nicklas |
20 |
------------------------------------------------------------------ |
4745 |
10 Feb 09 |
nicklas |
21 |
--%> |
5426 |
24 Sep 10 |
nicklas |
22 |
<%@ page pageEncoding="UTF-8" session="false" |
4745 |
10 Feb 09 |
nicklas |
23 |
import="net.sf.basedb.core.SessionControl" |
4745 |
10 Feb 09 |
nicklas |
24 |
import="net.sf.basedb.core.DbControl" |
4745 |
10 Feb 09 |
nicklas |
25 |
import="net.sf.basedb.core.Project" |
4745 |
10 Feb 09 |
nicklas |
26 |
import="net.sf.basedb.core.Item" |
4745 |
10 Feb 09 |
nicklas |
27 |
import="net.sf.basedb.core.BasicItem" |
4745 |
10 Feb 09 |
nicklas |
28 |
import="net.sf.basedb.core.Nameable" |
4745 |
10 Feb 09 |
nicklas |
29 |
import="net.sf.basedb.core.ItemContext" |
4745 |
10 Feb 09 |
nicklas |
30 |
import="net.sf.basedb.core.Permission" |
4745 |
10 Feb 09 |
nicklas |
31 |
import="net.sf.basedb.clients.web.Base" |
4745 |
10 Feb 09 |
nicklas |
32 |
import="net.sf.basedb.clients.web.util.HTML" |
4745 |
10 Feb 09 |
nicklas |
33 |
import="net.sf.basedb.util.Values" |
4745 |
10 Feb 09 |
nicklas |
34 |
import="net.sf.basedb.util.NestedIterator" |
4745 |
10 Feb 09 |
nicklas |
35 |
import="net.sf.basedb.util.overview.GenericOverview" |
4745 |
10 Feb 09 |
nicklas |
36 |
import="net.sf.basedb.util.overview.OverviewUtil" |
4745 |
10 Feb 09 |
nicklas |
37 |
import="net.sf.basedb.util.overview.Node" |
4745 |
10 Feb 09 |
nicklas |
38 |
import="net.sf.basedb.util.overview.ValidationOptions" |
4745 |
10 Feb 09 |
nicklas |
39 |
import="net.sf.basedb.util.overview.Validator" |
4745 |
10 Feb 09 |
nicklas |
40 |
import="net.sf.basedb.util.overview.Severity" |
4745 |
10 Feb 09 |
nicklas |
41 |
import="net.sf.basedb.util.overview.Failure" |
6047 |
18 Apr 12 |
nicklas |
42 |
import="net.sf.basedb.util.overview.extensions.ValidationRuleAction" |
4745 |
10 Feb 09 |
nicklas |
43 |
import="java.util.List" |
4745 |
10 Feb 09 |
nicklas |
44 |
import="java.util.LinkedList" |
4745 |
10 Feb 09 |
nicklas |
45 |
import="java.util.Iterator" |
4745 |
10 Feb 09 |
nicklas |
46 |
import="java.util.Set" |
4745 |
10 Feb 09 |
nicklas |
47 |
import="java.util.HashSet" |
4745 |
10 Feb 09 |
nicklas |
48 |
%> |
4745 |
10 Feb 09 |
nicklas |
49 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4745 |
10 Feb 09 |
nicklas |
50 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
4745 |
10 Feb 09 |
nicklas |
51 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
4745 |
10 Feb 09 |
nicklas |
52 |
<% |
4745 |
10 Feb 09 |
nicklas |
53 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4745 |
10 Feb 09 |
nicklas |
54 |
final String ID = sc.getId(); |
4745 |
10 Feb 09 |
nicklas |
55 |
final float scale = Base.getScale(sc); |
4767 |
17 Feb 09 |
nicklas |
56 |
final DbControl dc = null; |
4745 |
10 Feb 09 |
nicklas |
57 |
try |
4745 |
10 Feb 09 |
nicklas |
58 |
{ |
4767 |
17 Feb 09 |
nicklas |
59 |
GenericOverview overview = OverviewUtil.getCurrentOverview(sc); |
4745 |
10 Feb 09 |
nicklas |
60 |
ValidationOptions options = overview.getValidationOptions(); |
4840 |
24 Mar 09 |
martin |
61 |
Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false); |
4745 |
10 Feb 09 |
nicklas |
62 |
List<Failure> failures = overview.getFailures(); |
4745 |
10 Feb 09 |
nicklas |
63 |
if (failures == null) failures = new LinkedList<Failure>(); |
4745 |
10 Feb 09 |
nicklas |
64 |
List<Failure> errors = new LinkedList<Failure>(); |
4745 |
10 Feb 09 |
nicklas |
65 |
List<Failure> warnings = new LinkedList<Failure>(); |
4745 |
10 Feb 09 |
nicklas |
66 |
Set<Failure> duplicates = new HashSet<Failure>(); |
4745 |
10 Feb 09 |
nicklas |
67 |
|
4745 |
10 Feb 09 |
nicklas |
68 |
for (Failure failure : failures) |
4745 |
10 Feb 09 |
nicklas |
69 |
{ |
4745 |
10 Feb 09 |
nicklas |
70 |
if (!duplicates.contains(failure)) |
4745 |
10 Feb 09 |
nicklas |
71 |
{ |
4745 |
10 Feb 09 |
nicklas |
72 |
duplicates.add(failure); |
6047 |
18 Apr 12 |
nicklas |
73 |
ValidationRuleAction validator = failure.getValidator(); |
4745 |
10 Feb 09 |
nicklas |
74 |
Severity severity = options.getSeverity(validator); |
4745 |
10 Feb 09 |
nicklas |
75 |
if (severity == Severity.ERROR) |
4745 |
10 Feb 09 |
nicklas |
76 |
{ |
4745 |
10 Feb 09 |
nicklas |
77 |
errors.add(failure); |
4745 |
10 Feb 09 |
nicklas |
78 |
} |
4745 |
10 Feb 09 |
nicklas |
79 |
else if (severity == Severity.WARNING) |
4745 |
10 Feb 09 |
nicklas |
80 |
{ |
4745 |
10 Feb 09 |
nicklas |
81 |
warnings.add(failure); |
4745 |
10 Feb 09 |
nicklas |
82 |
} |
4745 |
10 Feb 09 |
nicklas |
83 |
} |
4745 |
10 Feb 09 |
nicklas |
84 |
} |
4745 |
10 Feb 09 |
nicklas |
85 |
%> |
5951 |
09 Feb 12 |
nicklas |
86 |
<base:page title="" type="iframe"> |
6195 |
01 Nov 12 |
nicklas |
87 |
<base:head scripts="dragdrop.js,~failures.js"> |
4765 |
17 Feb 09 |
nicklas |
88 |
<style> |
5957 |
14 Feb 12 |
nicklas |
89 |
tr.failure |
5957 |
14 Feb 12 |
nicklas |
90 |
{ |
6621 |
24 Nov 14 |
nicklas |
91 |
border-top-width: 1px; |
6621 |
24 Nov 14 |
nicklas |
92 |
border-top-style: dotted; |
6621 |
24 Nov 14 |
nicklas |
93 |
border-bottom-width: 1px; |
6621 |
24 Nov 14 |
nicklas |
94 |
border-bottom-style: dotted; |
5957 |
14 Feb 12 |
nicklas |
95 |
cursor: pointer; |
5957 |
14 Feb 12 |
nicklas |
96 |
} |
5957 |
14 Feb 12 |
nicklas |
97 |
tr.failure:first-child |
5957 |
14 Feb 12 |
nicklas |
98 |
{ |
6621 |
24 Nov 14 |
nicklas |
99 |
border-top-color: transparent; |
5957 |
14 Feb 12 |
nicklas |
100 |
} |
5957 |
14 Feb 12 |
nicklas |
101 |
tr.failure td |
5957 |
14 Feb 12 |
nicklas |
102 |
{ |
4765 |
17 Feb 09 |
nicklas |
103 |
vertical-align: bottom; |
4765 |
17 Feb 09 |
nicklas |
104 |
padding: 2px; |
4765 |
17 Feb 09 |
nicklas |
105 |
} |
5971 |
17 Feb 12 |
nicklas |
106 |
tr.failure td.text |
5971 |
17 Feb 12 |
nicklas |
107 |
{ |
5971 |
17 Feb 12 |
nicklas |
108 |
white-space: nowrap; |
5971 |
17 Feb 12 |
nicklas |
109 |
overflow: hidden; |
5971 |
17 Feb 12 |
nicklas |
110 |
text-overflow: ellipsis; |
5971 |
17 Feb 12 |
nicklas |
111 |
} |
5957 |
14 Feb 12 |
nicklas |
112 |
.index |
5957 |
14 Feb 12 |
nicklas |
113 |
{ |
4765 |
17 Feb 09 |
nicklas |
114 |
font-weight: bold; |
4765 |
17 Feb 09 |
nicklas |
115 |
text-align: right; |
4765 |
17 Feb 09 |
nicklas |
116 |
} |
4765 |
17 Feb 09 |
nicklas |
117 |
</style> |
4745 |
10 Feb 09 |
nicklas |
118 |
</base:head> |
5918 |
21 Dec 11 |
nicklas |
119 |
<base:body> |
6194 |
01 Nov 12 |
nicklas |
120 |
<div class="absolutefull auto-init" data-auto-init="drag-support"> |
5918 |
21 Dec 11 |
nicklas |
121 |
|
6607 |
19 Nov 14 |
nicklas |
122 |
<div class="absolutefull bg-filled-100 bottomborder" style="height: 2em; padding-left: 1em;"> |
5957 |
14 Feb 12 |
nicklas |
123 |
<table style="width: 100%; height: 100%;"><tr><td><b> |
5957 |
14 Feb 12 |
nicklas |
124 |
<% |
5957 |
14 Feb 12 |
nicklas |
125 |
if (showFailures) |
5957 |
14 Feb 12 |
nicklas |
126 |
{ |
5957 |
14 Feb 12 |
nicklas |
127 |
%> |
5957 |
14 Feb 12 |
nicklas |
128 |
<%=errors.size() %> error(s), |
5957 |
14 Feb 12 |
nicklas |
129 |
<%=warnings.size()%> warning(s) |
5957 |
14 Feb 12 |
nicklas |
130 |
<% |
5957 |
14 Feb 12 |
nicklas |
131 |
} |
5957 |
14 Feb 12 |
nicklas |
132 |
else |
5957 |
14 Feb 12 |
nicklas |
133 |
{ |
5957 |
14 Feb 12 |
nicklas |
134 |
%> |
5957 |
14 Feb 12 |
nicklas |
135 |
<i>Item-tree not validated</i> |
5957 |
14 Feb 12 |
nicklas |
136 |
<% |
5957 |
14 Feb 12 |
nicklas |
137 |
} |
4840 |
24 Mar 09 |
martin |
138 |
%> |
4840 |
24 Mar 09 |
martin |
139 |
</b> |
5957 |
14 Feb 12 |
nicklas |
140 |
</td></tr></table> |
4745 |
10 Feb 09 |
nicklas |
141 |
</div> |
4745 |
10 Feb 09 |
nicklas |
142 |
<% |
4840 |
24 Mar 09 |
martin |
143 |
if(showFailures) |
4745 |
10 Feb 09 |
nicklas |
144 |
{ |
4840 |
24 Mar 09 |
martin |
145 |
%> |
5962 |
15 Feb 12 |
nicklas |
146 |
<div class="absolutefull" style="top: 2em; margin-top: 1px;"> |
5957 |
14 Feb 12 |
nicklas |
147 |
<table style="width: 100%; border-collapse: collapse;"> |
4840 |
24 Mar 09 |
martin |
148 |
<% |
4840 |
24 Mar 09 |
martin |
149 |
int index = 0; |
4840 |
24 Mar 09 |
martin |
150 |
Iterator<Failure> all = new NestedIterator<Failure>(errors, warnings); |
4840 |
24 Mar 09 |
martin |
151 |
while (all.hasNext()) |
4745 |
10 Feb 09 |
nicklas |
152 |
{ |
4840 |
24 Mar 09 |
martin |
153 |
Failure failure = all.next(); |
6047 |
18 Apr 12 |
nicklas |
154 |
ValidationRuleAction validator = failure.getValidator(); |
4840 |
24 Mar 09 |
martin |
155 |
Severity severity = options.getSeverity(validator); |
4840 |
24 Mar 09 |
martin |
156 |
if (severity != Severity.IGNORE) |
4745 |
10 Feb 09 |
nicklas |
157 |
{ |
4840 |
24 Mar 09 |
martin |
158 |
index++; |
4840 |
24 Mar 09 |
martin |
159 |
Node node = failure.getNode(); |
4840 |
24 Mar 09 |
martin |
160 |
BasicItem item = node.getItem(); |
4840 |
24 Mar 09 |
martin |
161 |
%> |
6684 |
14 Jan 15 |
nicklas |
162 |
<tr class="failure highlight auto-init" data-auto-init="failure" |
6684 |
14 Jan 15 |
nicklas |
163 |
data-node-id="<%=node.getId()%>" |
6195 |
01 Nov 12 |
nicklas |
164 |
<% |
6195 |
01 Nov 12 |
nicklas |
165 |
if (item != null) |
6195 |
01 Nov 12 |
nicklas |
166 |
{ |
6195 |
01 Nov 12 |
nicklas |
167 |
%> |
6195 |
01 Nov 12 |
nicklas |
168 |
data-item-type="<%=item.getType().name()%>" data-item-id="<%=item.getId()%>" |
6195 |
01 Nov 12 |
nicklas |
169 |
title="Get more information about this failure (use CTRL, ALT or SHIFT to edit the item)" |
6195 |
01 Nov 12 |
nicklas |
170 |
<% |
6195 |
01 Nov 12 |
nicklas |
171 |
} |
6195 |
01 Nov 12 |
nicklas |
172 |
else |
6195 |
01 Nov 12 |
nicklas |
173 |
{ |
6195 |
01 Nov 12 |
nicklas |
174 |
%> |
6195 |
01 Nov 12 |
nicklas |
175 |
title="Get more information about this failure" |
6195 |
01 Nov 12 |
nicklas |
176 |
<% |
6195 |
01 Nov 12 |
nicklas |
177 |
} |
6195 |
01 Nov 12 |
nicklas |
178 |
%> |
4840 |
24 Mar 09 |
martin |
179 |
> |
5957 |
14 Feb 12 |
nicklas |
180 |
<td style="width: 3em;" class="index"><%=index%></td> |
5957 |
14 Feb 12 |
nicklas |
181 |
<td style="width: 24px; text-align: center;" class="text"><base:icon image="<%=severity == Severity.ERROR ? "error.png" : "warning.png"%>" /></td> |
5957 |
14 Feb 12 |
nicklas |
182 |
<td class="text link"><%=HTML.encodeTags(failure.getMessage()) %></td> |
4840 |
24 Mar 09 |
martin |
183 |
<td class="text"><%=HTML.encodeTags(node.getTitle()) %></td> |
4840 |
24 Mar 09 |
martin |
184 |
</tr> |
4840 |
24 Mar 09 |
martin |
185 |
<% |
4745 |
10 Feb 09 |
nicklas |
186 |
} |
4745 |
10 Feb 09 |
nicklas |
187 |
} |
4840 |
24 Mar 09 |
martin |
188 |
%> |
4840 |
24 Mar 09 |
martin |
189 |
</table> |
4840 |
24 Mar 09 |
martin |
190 |
</div> |
4840 |
24 Mar 09 |
martin |
191 |
<% |
4745 |
10 Feb 09 |
nicklas |
192 |
} |
4745 |
10 Feb 09 |
nicklas |
193 |
%> |
5918 |
21 Dec 11 |
nicklas |
194 |
</div> |
4745 |
10 Feb 09 |
nicklas |
195 |
</base:body> |
4745 |
10 Feb 09 |
nicklas |
196 |
</base:page> |
4745 |
10 Feb 09 |
nicklas |
197 |
<% |
4745 |
10 Feb 09 |
nicklas |
198 |
} |
4745 |
10 Feb 09 |
nicklas |
199 |
finally |
4745 |
10 Feb 09 |
nicklas |
200 |
{ |
4745 |
10 Feb 09 |
nicklas |
201 |
if (dc != null) dc.close(); |
4745 |
10 Feb 09 |
nicklas |
202 |
} |
4745 |
10 Feb 09 |
nicklas |
203 |
%> |