1 | <%-- $Id: info.jsp 6382 2013-12-17 13:08:15Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2009 Nicklas Nordborg |
---|
4 | |
---|
5 | This file is part of BASE - BioArray Software Environment. |
---|
6 | Available at http://base.thep.lu.se/ |
---|
7 | |
---|
8 | BASE is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License |
---|
10 | as published by the Free Software Foundation; either version 3 |
---|
11 | of the License, or (at your option) any later version. |
---|
12 | |
---|
13 | BASE is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | GNU General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | ------------------------------------------------------------------ |
---|
21 | --%> |
---|
22 | <%@ page pageEncoding="UTF-8" session="false" |
---|
23 | import="net.sf.basedb.core.SessionControl" |
---|
24 | import="net.sf.basedb.core.DbControl" |
---|
25 | import="net.sf.basedb.core.Project" |
---|
26 | import="net.sf.basedb.core.Item" |
---|
27 | import="net.sf.basedb.core.BasicItem" |
---|
28 | import="net.sf.basedb.core.Nameable" |
---|
29 | import="net.sf.basedb.core.Annotatable" |
---|
30 | import="net.sf.basedb.core.AnnotationSet" |
---|
31 | import="net.sf.basedb.core.AnnotationType" |
---|
32 | import="net.sf.basedb.core.Annotation" |
---|
33 | import="net.sf.basedb.core.ItemSubtype" |
---|
34 | import="net.sf.basedb.core.Subtypable" |
---|
35 | import="net.sf.basedb.core.AnyToAny" |
---|
36 | import="net.sf.basedb.core.Protocol" |
---|
37 | import="net.sf.basedb.core.FileStoreEnabled" |
---|
38 | import="net.sf.basedb.core.FileSetMember" |
---|
39 | import="net.sf.basedb.core.File" |
---|
40 | import="net.sf.basedb.core.DataFileType" |
---|
41 | import="net.sf.basedb.core.ItemContext" |
---|
42 | import="net.sf.basedb.core.Permission" |
---|
43 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
44 | import="net.sf.basedb.core.ItemNotFoundException" |
---|
45 | import="net.sf.basedb.core.snapshot.SnapshotManager" |
---|
46 | import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
---|
47 | import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
---|
48 | import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
---|
49 | import="net.sf.basedb.core.snapshot.AnnotationFilter" |
---|
50 | import="net.sf.basedb.clients.web.Base" |
---|
51 | import="net.sf.basedb.clients.web.util.HTML" |
---|
52 | import="net.sf.basedb.clients.web.extensions.section.SectionAction" |
---|
53 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
54 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
55 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
56 | import="net.sf.basedb.util.Values" |
---|
57 | import="net.sf.basedb.util.NestedIterator" |
---|
58 | import="net.sf.basedb.util.formatter.Formatter" |
---|
59 | import="net.sf.basedb.util.overview.GenericOverview" |
---|
60 | import="net.sf.basedb.util.overview.OverviewUtil" |
---|
61 | import="net.sf.basedb.util.overview.Node" |
---|
62 | import="net.sf.basedb.util.overview.ValidationOptions" |
---|
63 | import="net.sf.basedb.util.overview.Validator" |
---|
64 | import="net.sf.basedb.util.overview.Severity" |
---|
65 | import="net.sf.basedb.util.overview.Failure" |
---|
66 | import="net.sf.basedb.util.overview.Fix" |
---|
67 | import="net.sf.basedb.util.overview.extensions.ValidationRuleAction" |
---|
68 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
69 | import="java.util.ArrayList" |
---|
70 | import="java.util.List" |
---|
71 | import="java.util.LinkedList" |
---|
72 | import="java.util.Iterator" |
---|
73 | import="java.util.Collection" |
---|
74 | import="java.util.Collections" |
---|
75 | %> |
---|
76 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
77 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
78 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
79 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
80 | <%! |
---|
81 | private String getPath(DbControl dc, String ID, Node node) |
---|
82 | { |
---|
83 | Node parent = node.getParent(); |
---|
84 | if (parent == null) return ""; |
---|
85 | String path = getPath(dc, ID, parent); |
---|
86 | if (parent.getNodeType() == Node.Type.FOLDER) |
---|
87 | { |
---|
88 | //path += "/" + HTML.encodeTags(parent.getTitle()); |
---|
89 | } |
---|
90 | else |
---|
91 | { |
---|
92 | BasicItem item = parent.getItem(); |
---|
93 | if (path.length() > 0) |
---|
94 | { |
---|
95 | path += " <b>›</b> "; |
---|
96 | } |
---|
97 | path += Base.getLink(ID, parent.getTitle(), item.getType(), item.getId(), item.hasPermission(Permission.WRITE)); |
---|
98 | |
---|
99 | if (item instanceof Subtypable) |
---|
100 | { |
---|
101 | ItemSubtype subtype = ((Subtypable)parent.getItem(dc)).getItemSubtype(); |
---|
102 | if (subtype != null) |
---|
103 | { |
---|
104 | path += " <span class=\"itemsubtype\">(" + Base.getLinkedName(ID, subtype, false, true) + ")</span>"; |
---|
105 | } |
---|
106 | } |
---|
107 | } |
---|
108 | return path; |
---|
109 | } |
---|
110 | %> |
---|
111 | <% |
---|
112 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
113 | final String ID = sc.getId(); |
---|
114 | final float scale = Base.getScale(sc); |
---|
115 | final DbControl dc = sc.newDbControl(); |
---|
116 | try |
---|
117 | { |
---|
118 | final GenericOverview overview = OverviewUtil.getCurrentOverview(sc); |
---|
119 | final ItemContext cc = sc.getCurrentContext(overview.getRootItem().getType()); |
---|
120 | final SnapshotManager snapshotManager = new SnapshotManager(); |
---|
121 | final AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(); |
---|
122 | final AnnotationFilter annotationFilter = new AnnotationFilter(); |
---|
123 | ValidationOptions options = overview.getValidationOptions(); |
---|
124 | String nodeId = request.getParameter("nodeId"); |
---|
125 | Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false); |
---|
126 | Node node = overview.getNode(nodeId); |
---|
127 | if (node == null) node = overview.getRootNode(); |
---|
128 | |
---|
129 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, node); |
---|
130 | ExtensionsInvoker<SectionAction> invoker = (ExtensionsInvoker<SectionAction>)ExtensionsControl.useExtensions( |
---|
131 | jspContext, "net.sf.basedb.clients.web.overview.info-details"); |
---|
132 | |
---|
133 | BasicItem item = node.getItem(dc); |
---|
134 | List<Failure> failures = overview.getFailures(); |
---|
135 | if (failures == null) failures = new LinkedList<Failure>(); |
---|
136 | %> |
---|
137 | <base:page title="" type="iframe"> |
---|
138 | <base:head styles="table.css" scripts="dragdrop.js,~info.js"> |
---|
139 | <ext:scripts context="<%=jspContext%>" /> |
---|
140 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
141 | <style> |
---|
142 | .itemsubtype .link |
---|
143 | { |
---|
144 | color: #777777; |
---|
145 | } |
---|
146 | </style> |
---|
147 | </base:head> |
---|
148 | |
---|
149 | <base:body> |
---|
150 | <div class="absolutefull auto-init" data-auto-init="drag-support"> |
---|
151 | <div> |
---|
152 | <table class="fullform bottomborder outlined"> |
---|
153 | <tr> |
---|
154 | <th>Path</th> |
---|
155 | <td><%=getPath(dc, ID, node)%></td> |
---|
156 | </tr> |
---|
157 | <% |
---|
158 | if (item instanceof FileSetMember) |
---|
159 | { |
---|
160 | FileSetMember member = null; |
---|
161 | boolean notFound = false; |
---|
162 | try |
---|
163 | { |
---|
164 | member = FileSetMember.getById(dc, item.getId()); |
---|
165 | } |
---|
166 | catch (ItemNotFoundException ex) |
---|
167 | { |
---|
168 | notFound = true; |
---|
169 | } |
---|
170 | File file = null; |
---|
171 | DataFileType dft = null; |
---|
172 | boolean deniedFile = false; |
---|
173 | boolean deniedFileType = false; |
---|
174 | if (member != null) |
---|
175 | { |
---|
176 | try |
---|
177 | { |
---|
178 | file = member.getFile(); |
---|
179 | } |
---|
180 | catch (PermissionDeniedException ex) |
---|
181 | { |
---|
182 | deniedFile = true; |
---|
183 | } |
---|
184 | try |
---|
185 | { |
---|
186 | dft = member.getDataFileType(); |
---|
187 | } |
---|
188 | catch (PermissionDeniedException ex) |
---|
189 | { |
---|
190 | deniedFileType = true; |
---|
191 | } |
---|
192 | } |
---|
193 | if (dft != null || file != null) |
---|
194 | { |
---|
195 | %> |
---|
196 | <tr> |
---|
197 | <th><%=dft == null ? "Data file" : HTML.encodeTags(dft.getName())%></th> |
---|
198 | <td> |
---|
199 | <%=Base.getLinkedFile(ID, file, deniedFile, true, true, "../../")%> |
---|
200 | </td> |
---|
201 | </tr> |
---|
202 | <% |
---|
203 | } |
---|
204 | else |
---|
205 | { |
---|
206 | %> |
---|
207 | <tr> |
---|
208 | <th><%=HTML.encodeTags(node.getTitle())%></th> |
---|
209 | <td> |
---|
210 | <%=notFound ? "<i>- not found -</i>" : "<i>- denied -</i>"%> |
---|
211 | </td> |
---|
212 | </tr> |
---|
213 | <% |
---|
214 | } |
---|
215 | } |
---|
216 | else if (item instanceof AnyToAny) |
---|
217 | { |
---|
218 | AnyToAny any = AnyToAny.getById(dc, item.getId()); |
---|
219 | String linkTo = null; |
---|
220 | try |
---|
221 | { |
---|
222 | BasicItem to = any.getTo(); |
---|
223 | String name = to instanceof Nameable ? ((Nameable)to).getName() : to.toString(); |
---|
224 | linkTo = Base.getLink(ID, HTML.encodeTags(name), |
---|
225 | to.getType(), to.getId(), to.hasPermission(Permission.WRITE)); |
---|
226 | } |
---|
227 | catch (PermissionDeniedException ex) |
---|
228 | { |
---|
229 | linkTo = any.getToType() + "[id=" + any.getToId() + "] (<i>denied</i>)"; |
---|
230 | } |
---|
231 | catch (ItemNotFoundException ex) |
---|
232 | { |
---|
233 | linkTo = any.getToType() + "[id=" + any.getToId() + "] (<i>missing</i>)"; |
---|
234 | } |
---|
235 | %> |
---|
236 | <tr> |
---|
237 | <th>Any-to-any link</th> |
---|
238 | <td> |
---|
239 | <table> |
---|
240 | <tr> |
---|
241 | <td><%=Base.getLinkedName(ID, any, false, true) %></td> |
---|
242 | <td><base:icon image="bullet.png" /></td> |
---|
243 | <td><%=linkTo%></td> |
---|
244 | </tr> |
---|
245 | </table> |
---|
246 | </td> |
---|
247 | </tr> |
---|
248 | <% |
---|
249 | } |
---|
250 | else |
---|
251 | { |
---|
252 | %> |
---|
253 | <tr> |
---|
254 | <th><%=node.getNodeType() == Node.Type.FOLDER ? |
---|
255 | "Folder" : item != null ? item.getType().toString() : "Item"%></th> |
---|
256 | <td> |
---|
257 | <% |
---|
258 | if (item != null) |
---|
259 | { |
---|
260 | %> |
---|
261 | <%=Base.getLink(ID, node.getTitle(), item.getType(),item.getId(), item.hasPermission(Permission.WRITE))%> |
---|
262 | <% |
---|
263 | if (item instanceof Subtypable) |
---|
264 | { |
---|
265 | ItemSubtype subtype = ((Subtypable)item).getItemSubtype(); |
---|
266 | if (subtype != null) |
---|
267 | { |
---|
268 | %> |
---|
269 | <span class="itemsubtype">(<%=Base.getLinkedName(ID, subtype, false, true)%>)</span> |
---|
270 | <% |
---|
271 | } |
---|
272 | } |
---|
273 | } |
---|
274 | else |
---|
275 | { |
---|
276 | %> |
---|
277 | <%=HTML.encodeTags(node.getTitle())%> |
---|
278 | <% |
---|
279 | } |
---|
280 | %> |
---|
281 | </td> |
---|
282 | </tr> |
---|
283 | <% |
---|
284 | } |
---|
285 | %> |
---|
286 | <tr> |
---|
287 | <th>Errors (children)</th> |
---|
288 | <% |
---|
289 | if (showFailures) |
---|
290 | { |
---|
291 | %> |
---|
292 | <td><%=node.getNumErrors()+node.getChildErrors()%> (<%=node.getChildErrors()%>)</td> |
---|
293 | <% |
---|
294 | } |
---|
295 | else |
---|
296 | { |
---|
297 | %> |
---|
298 | <td><i>- n/a -</i></td> |
---|
299 | <% |
---|
300 | } |
---|
301 | %> |
---|
302 | </tr> |
---|
303 | <tr> |
---|
304 | <th>Warnings (children)</th> |
---|
305 | <% |
---|
306 | if (showFailures) |
---|
307 | { |
---|
308 | %> |
---|
309 | <td><%=node.getNumWarnings()+node.getChildWarnings()%> (<%=node.getChildWarnings()%>)</td> |
---|
310 | <% |
---|
311 | } |
---|
312 | else |
---|
313 | { |
---|
314 | %> |
---|
315 | <td><i>- n/a -</i></td> |
---|
316 | <% |
---|
317 | } |
---|
318 | %> |
---|
319 | </tr> |
---|
320 | <% |
---|
321 | if (item instanceof Nameable) |
---|
322 | { |
---|
323 | Nameable nameable = (Nameable)item; |
---|
324 | %> |
---|
325 | <tr> |
---|
326 | <th>Description</th> |
---|
327 | <td><%=HTML.niceFormat(nameable.getDescription())%></td> |
---|
328 | </tr> |
---|
329 | <% |
---|
330 | } |
---|
331 | %> |
---|
332 | </table> |
---|
333 | </div> |
---|
334 | <% |
---|
335 | List<AnnotationSnapshot> annotations = new LinkedList<AnnotationSnapshot>(); |
---|
336 | String annotationsTitle = ""; |
---|
337 | Annotatable annotatable = null; |
---|
338 | if (item instanceof Annotation) |
---|
339 | { |
---|
340 | Annotation a = Annotation.getById(dc, item.getId()); |
---|
341 | AnnotationSetSnapshot snapshot = snapshotManager.getSnapshot(dc, a.getAnnotationSet().getId()); |
---|
342 | annotationFilter.setAnnotation(a); |
---|
343 | annotations.addAll(snapshotManager.findAnnotations(dc, snapshot, annotationFilter, true)); |
---|
344 | |
---|
345 | // Find the annotatable parent node |
---|
346 | Node parentNode = node; |
---|
347 | while (parentNode != null) |
---|
348 | { |
---|
349 | BasicItem parentItem = parentNode.getItem(); |
---|
350 | if (parentItem instanceof Annotatable) |
---|
351 | { |
---|
352 | annotatable = (Annotatable)parentItem; |
---|
353 | break; |
---|
354 | } |
---|
355 | parentNode = parentNode.getParent(); |
---|
356 | } |
---|
357 | annotationsTitle = "Annotation values"; |
---|
358 | } |
---|
359 | else if (item instanceof AnnotationType) |
---|
360 | { |
---|
361 | // Find the annotatable parent |
---|
362 | Node parentNode = node; |
---|
363 | while (parentNode != null) |
---|
364 | { |
---|
365 | BasicItem parentItem = parentNode.getItem(); |
---|
366 | if (parentItem instanceof Annotatable && !(parentItem instanceof Protocol)) |
---|
367 | { |
---|
368 | annotatable = (Annotatable)parentItem.getType().getById(dc, parentItem.getId()); |
---|
369 | if (annotatable.isAnnotated()) |
---|
370 | { |
---|
371 | annotationTypeFilter.setAnnotationType((AnnotationType)item); |
---|
372 | annotations.addAll(snapshotManager.findAnnotations(dc, annotatable, annotationTypeFilter, true)); |
---|
373 | } |
---|
374 | annotationsTitle = "Annotation values"; |
---|
375 | break; |
---|
376 | } |
---|
377 | parentNode = parentNode.getParent(); |
---|
378 | } |
---|
379 | } |
---|
380 | else if (item instanceof Annotatable) |
---|
381 | { |
---|
382 | annotationsTitle = "Annotations & protocol parameters"; |
---|
383 | annotatable = (Annotatable)item.getType().getById(dc, item.getId()); |
---|
384 | if (annotatable.isAnnotated()) |
---|
385 | { |
---|
386 | annotations.addAll(snapshotManager.findAnnotations(dc, annotatable, null, true)); |
---|
387 | } |
---|
388 | |
---|
389 | } |
---|
390 | if (annotations != null && annotations.size() > 0) |
---|
391 | { |
---|
392 | %> |
---|
393 | <base:section |
---|
394 | id="allAnnotations" |
---|
395 | title="<%="Annotations & parameters (" + annotations.size() + ")"%>" |
---|
396 | context="<%=cc %>"> |
---|
397 | |
---|
398 | <tbl:table id="annotations"> |
---|
399 | <tbl:columndef id="annotation" title="Annotation/parameter" /> |
---|
400 | <tbl:columndef id="owner" title="Owner" /> |
---|
401 | <tbl:columndef id="values" title="Value" /> |
---|
402 | <tbl:columndef id="edit" title="" /> |
---|
403 | <tbl:data> |
---|
404 | <tbl:headers> |
---|
405 | <tbl:headerrow> |
---|
406 | <tbl:columnheaders /> |
---|
407 | </tbl:headerrow> |
---|
408 | </tbl:headers> |
---|
409 | <tbl:rows> |
---|
410 | <% |
---|
411 | for (AnnotationSnapshot snapshot : annotations) |
---|
412 | { |
---|
413 | Annotation a = snapshot.getAnnotation(dc); |
---|
414 | AnnotationType at = snapshot.getAnnotationType(dc); |
---|
415 | Formatter formatter = FormatterFactory.getAnnotationFormatter(sc, a, null); |
---|
416 | Annotatable annotationOwner = null; |
---|
417 | try |
---|
418 | { |
---|
419 | annotationOwner = snapshot.getItem(dc); |
---|
420 | } |
---|
421 | catch (Throwable t) |
---|
422 | {} |
---|
423 | String icon = at != null && at.isProtocolParameter() ? |
---|
424 | "parameter.png" : "annotation.png"; |
---|
425 | String autoInit = null; |
---|
426 | String editTooltip = null; |
---|
427 | if (annotatable != null && annotatable.hasPermission(Permission.WRITE)) |
---|
428 | { |
---|
429 | if (annotatable.equals(annotationOwner)) |
---|
430 | { |
---|
431 | autoInit = "edit-annotation"; |
---|
432 | editTooltip = "Edit the values of this annotation"; |
---|
433 | } |
---|
434 | else |
---|
435 | { |
---|
436 | autoInit = "edit-inherited-annotation"; |
---|
437 | editTooltip = "Inherit this annotation from another item"; |
---|
438 | } |
---|
439 | } |
---|
440 | %> |
---|
441 | <tbl:row> |
---|
442 | <tbl:cell column="annotation"><base:icon image="<%=icon%>" /> |
---|
443 | <%=Base.getLinkedName(ID, at, false, true)%> |
---|
444 | </tbl:cell> |
---|
445 | <tbl:cell column="owner"> |
---|
446 | <% |
---|
447 | if (annotationOwner != null && !annotationOwner.equals(annotatable)) |
---|
448 | { |
---|
449 | String ownerName = annotationOwner instanceof Nameable ? |
---|
450 | ((Nameable)annotationOwner).getName() : annotationOwner.toString(); |
---|
451 | %> |
---|
452 | <%=Base.getLink(ID, ownerName, annotationOwner.getType(), annotationOwner.getId(), annotationOwner.hasPermission(Permission.WRITE)) %> |
---|
453 | <% |
---|
454 | } |
---|
455 | %> |
---|
456 | </tbl:cell> |
---|
457 | <tbl:cell column="values"><%=Values.getString(a.getValues(null), ", ", true, formatter)%></tbl:cell> |
---|
458 | <tbl:cell column="edit"><base:icon id="<%=Integer.toString(a.getId())%>" image="edit.png" subclass="auto-init" data-auto-init="<%=autoInit %>" |
---|
459 | data-item-type="<%=annotatable.getType().name()%>" |
---|
460 | data-item-id="<%=annotatable.getId()%>" |
---|
461 | data-annotation-type-id="<%=at.getId()%>" |
---|
462 | tooltip="<%=editTooltip%>" visible="<%=autoInit != null %>"/></tbl:cell> |
---|
463 | </tbl:row> |
---|
464 | <% |
---|
465 | } |
---|
466 | %> |
---|
467 | </tbl:rows> |
---|
468 | </tbl:data> |
---|
469 | </tbl:table> |
---|
470 | </base:section> |
---|
471 | <% |
---|
472 | } |
---|
473 | if (showFailures) |
---|
474 | { |
---|
475 | %> |
---|
476 | <base:section |
---|
477 | id="failures" |
---|
478 | title="<%="Failure details (" + (node.getNumErrors() + node.getNumWarnings()) + ")"%>" |
---|
479 | context="<%=cc %>" |
---|
480 | > |
---|
481 | <table> |
---|
482 | <% |
---|
483 | int numFailures = 0; |
---|
484 | for (Failure failure : failures) |
---|
485 | { |
---|
486 | ValidationRuleAction validator = failure.getValidator(); |
---|
487 | Severity severity = options.getSeverity(validator); |
---|
488 | if (failure.getNode() == node && severity != Severity.IGNORE) |
---|
489 | { |
---|
490 | numFailures++; |
---|
491 | List<Fix> fixes = failure.getFixes(); |
---|
492 | %> |
---|
493 | <tr> |
---|
494 | <td><base:icon image="<%=severity == Severity.ERROR ? "error.png" : "warning.png"%>" style="padding-right: 4px;"/></td> |
---|
495 | <td><b><%=HTML.encodeTags(failure.getMessage())%></b></td> |
---|
496 | </tr> |
---|
497 | <tr> |
---|
498 | <td></td> |
---|
499 | <td style="padding-bottom: 0.3em;"> |
---|
500 | <%=HTML.encodeTags(validator.getDescription())%><br> |
---|
501 | <% |
---|
502 | if (fixes != null && fixes.size() > 0) |
---|
503 | { |
---|
504 | for (Fix fix : fixes) |
---|
505 | { |
---|
506 | if (fix == null) continue; |
---|
507 | BasicItem fixItem = fix.getItem(); |
---|
508 | boolean enabled = fixItem.hasPermission(Permission.WRITE); |
---|
509 | AnnotationType at = fix.getAnnotationType(); |
---|
510 | String autoInit = ""; |
---|
511 | if (enabled) |
---|
512 | { |
---|
513 | if (fix.isAnnotationFix()) |
---|
514 | { |
---|
515 | autoInit = fix.isFromInherited() ? "edit-inherited-annotation" : "edit-annotation"; |
---|
516 | } |
---|
517 | else if (fix.isDataFileFix()) |
---|
518 | { |
---|
519 | autoInit = "edit-data-file"; |
---|
520 | } |
---|
521 | else |
---|
522 | { |
---|
523 | autoInit = "edit-item"; |
---|
524 | } |
---|
525 | } |
---|
526 | %> |
---|
527 | <base:icon image="fixit.png" |
---|
528 | style="padding-bottom: 4px;" |
---|
529 | id="<%=Integer.toString(fix.hashCode())%>" |
---|
530 | enabled="<%=enabled %>" |
---|
531 | subclass="auto-init" |
---|
532 | data-auto-init="<%=autoInit%>" |
---|
533 | data-item-type="<%=fixItem.getType().name()%>" |
---|
534 | data-item-id="<%=fixItem.getId()%>" |
---|
535 | data-annotation-type-id="<%=at != null ? at.getId() : ""%>" |
---|
536 | tooltip="<%=enabled ? "Edit this item to fix the problem" : "You do not have permission to modify this item" %>" |
---|
537 | ><%=HTML.encodeTags(fix.getMessage())%></base:icon><br> |
---|
538 | <% |
---|
539 | } |
---|
540 | } |
---|
541 | %> |
---|
542 | </td> |
---|
543 | </tr> |
---|
544 | <% |
---|
545 | } |
---|
546 | } |
---|
547 | %> |
---|
548 | </table> |
---|
549 | <% |
---|
550 | if (numFailures == 0) |
---|
551 | { |
---|
552 | %> |
---|
553 | <div class="messagecontainer note"> |
---|
554 | No validation failures on this item |
---|
555 | </div> |
---|
556 | <% |
---|
557 | } |
---|
558 | %> |
---|
559 | </base:section> |
---|
560 | <% |
---|
561 | } |
---|
562 | |
---|
563 | for (SectionAction section : invoker) |
---|
564 | { |
---|
565 | %> |
---|
566 | <base:section |
---|
567 | id="<%=section.getId() %>" |
---|
568 | showclazz="<%=section.getShowClazz() %>" |
---|
569 | hideclazz="<%=section.getHideClazz() %>" |
---|
570 | style="<%=section.getStyle() %>" |
---|
571 | contentstyle="<%=section.getContentStyle() %>" |
---|
572 | title="<%=section.getTitle() %>" |
---|
573 | context="<%=cc %>" |
---|
574 | ><%=section.getContent() %></base:section> |
---|
575 | <% |
---|
576 | } |
---|
577 | %> |
---|
578 | </div> |
---|
579 | </base:body> |
---|
580 | </base:page> |
---|
581 | <% |
---|
582 | } |
---|
583 | finally |
---|
584 | { |
---|
585 | if (dc != null) dc.close(); |
---|
586 | } |
---|
587 | %> |
---|