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.Annotatable" |
4745 |
10 Feb 09 |
nicklas |
30 |
import="net.sf.basedb.core.AnnotationSet" |
4745 |
10 Feb 09 |
nicklas |
31 |
import="net.sf.basedb.core.AnnotationType" |
4745 |
10 Feb 09 |
nicklas |
32 |
import="net.sf.basedb.core.Annotation" |
5651 |
08 Jun 11 |
nicklas |
33 |
import="net.sf.basedb.core.ItemSubtype" |
5651 |
08 Jun 11 |
nicklas |
34 |
import="net.sf.basedb.core.Subtypable" |
5500 |
18 Nov 10 |
nicklas |
35 |
import="net.sf.basedb.core.AnyToAny" |
5132 |
14 Oct 09 |
nicklas |
36 |
import="net.sf.basedb.core.Protocol" |
6939 |
21 Aug 15 |
nicklas |
37 |
import="net.sf.basedb.core.Unit" |
4745 |
10 Feb 09 |
nicklas |
38 |
import="net.sf.basedb.core.FileStoreEnabled" |
4745 |
10 Feb 09 |
nicklas |
39 |
import="net.sf.basedb.core.FileSetMember" |
4745 |
10 Feb 09 |
nicklas |
40 |
import="net.sf.basedb.core.File" |
4745 |
10 Feb 09 |
nicklas |
41 |
import="net.sf.basedb.core.DataFileType" |
4745 |
10 Feb 09 |
nicklas |
42 |
import="net.sf.basedb.core.ItemContext" |
4745 |
10 Feb 09 |
nicklas |
43 |
import="net.sf.basedb.core.Permission" |
4745 |
10 Feb 09 |
nicklas |
44 |
import="net.sf.basedb.core.PermissionDeniedException" |
4745 |
10 Feb 09 |
nicklas |
45 |
import="net.sf.basedb.core.ItemNotFoundException" |
5132 |
14 Oct 09 |
nicklas |
46 |
import="net.sf.basedb.core.snapshot.SnapshotManager" |
5132 |
14 Oct 09 |
nicklas |
47 |
import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
5132 |
14 Oct 09 |
nicklas |
48 |
import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
5132 |
14 Oct 09 |
nicklas |
49 |
import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
5132 |
14 Oct 09 |
nicklas |
50 |
import="net.sf.basedb.core.snapshot.AnnotationFilter" |
4745 |
10 Feb 09 |
nicklas |
51 |
import="net.sf.basedb.clients.web.Base" |
4745 |
10 Feb 09 |
nicklas |
52 |
import="net.sf.basedb.clients.web.util.HTML" |
6052 |
23 Apr 12 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.section.SectionAction" |
6052 |
23 Apr 12 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
6052 |
23 Apr 12 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6076 |
31 Jul 12 |
nicklas |
56 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4745 |
10 Feb 09 |
nicklas |
57 |
import="net.sf.basedb.util.Values" |
4745 |
10 Feb 09 |
nicklas |
58 |
import="net.sf.basedb.util.NestedIterator" |
6939 |
21 Aug 15 |
nicklas |
59 |
import="net.sf.basedb.util.units.UnitConverter" |
6076 |
31 Jul 12 |
nicklas |
60 |
import="net.sf.basedb.util.formatter.Formatter" |
4745 |
10 Feb 09 |
nicklas |
61 |
import="net.sf.basedb.util.overview.GenericOverview" |
4745 |
10 Feb 09 |
nicklas |
62 |
import="net.sf.basedb.util.overview.OverviewUtil" |
4745 |
10 Feb 09 |
nicklas |
63 |
import="net.sf.basedb.util.overview.Node" |
4745 |
10 Feb 09 |
nicklas |
64 |
import="net.sf.basedb.util.overview.ValidationOptions" |
4745 |
10 Feb 09 |
nicklas |
65 |
import="net.sf.basedb.util.overview.Validator" |
4745 |
10 Feb 09 |
nicklas |
66 |
import="net.sf.basedb.util.overview.Severity" |
4745 |
10 Feb 09 |
nicklas |
67 |
import="net.sf.basedb.util.overview.Failure" |
4745 |
10 Feb 09 |
nicklas |
68 |
import="net.sf.basedb.util.overview.Fix" |
7762 |
28 Nov 19 |
nicklas |
69 |
import="net.sf.basedb.util.overview.filter.NodeTypeFilter" |
6052 |
23 Apr 12 |
nicklas |
70 |
import="net.sf.basedb.util.overview.extensions.ValidationRuleAction" |
6052 |
23 Apr 12 |
nicklas |
71 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
7762 |
28 Nov 19 |
nicklas |
72 |
import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext" |
7762 |
28 Nov 19 |
nicklas |
73 |
import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerUtil" |
4745 |
10 Feb 09 |
nicklas |
74 |
import="java.util.ArrayList" |
6939 |
21 Aug 15 |
nicklas |
75 |
import="java.util.Date" |
4745 |
10 Feb 09 |
nicklas |
76 |
import="java.util.List" |
4745 |
10 Feb 09 |
nicklas |
77 |
import="java.util.LinkedList" |
4745 |
10 Feb 09 |
nicklas |
78 |
import="java.util.Iterator" |
4745 |
10 Feb 09 |
nicklas |
79 |
import="java.util.Collection" |
4745 |
10 Feb 09 |
nicklas |
80 |
import="java.util.Collections" |
4745 |
10 Feb 09 |
nicklas |
81 |
%> |
4745 |
10 Feb 09 |
nicklas |
82 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4745 |
10 Feb 09 |
nicklas |
83 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
4745 |
10 Feb 09 |
nicklas |
84 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
6052 |
23 Apr 12 |
nicklas |
85 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
4745 |
10 Feb 09 |
nicklas |
86 |
<%! |
5651 |
08 Jun 11 |
nicklas |
87 |
private String getPath(DbControl dc, String ID, Node node) |
4745 |
10 Feb 09 |
nicklas |
88 |
{ |
4745 |
10 Feb 09 |
nicklas |
89 |
Node parent = node.getParent(); |
4745 |
10 Feb 09 |
nicklas |
90 |
if (parent == null) return ""; |
5651 |
08 Jun 11 |
nicklas |
91 |
String path = getPath(dc, ID, parent); |
4745 |
10 Feb 09 |
nicklas |
92 |
if (parent.getNodeType() == Node.Type.FOLDER) |
4745 |
10 Feb 09 |
nicklas |
93 |
{ |
4745 |
10 Feb 09 |
nicklas |
94 |
//path += "/" + HTML.encodeTags(parent.getTitle()); |
4745 |
10 Feb 09 |
nicklas |
95 |
} |
4745 |
10 Feb 09 |
nicklas |
96 |
else |
4745 |
10 Feb 09 |
nicklas |
97 |
{ |
4745 |
10 Feb 09 |
nicklas |
98 |
BasicItem item = parent.getItem(); |
4757 |
13 Feb 09 |
nicklas |
99 |
if (path.length() > 0) |
4757 |
13 Feb 09 |
nicklas |
100 |
{ |
5918 |
21 Dec 11 |
nicklas |
101 |
path += " <b>›</b> "; |
4757 |
13 Feb 09 |
nicklas |
102 |
} |
5104 |
28 Sep 09 |
nicklas |
103 |
path += Base.getLink(ID, parent.getTitle(), item.getType(), item.getId(), item.hasPermission(Permission.WRITE)); |
5651 |
08 Jun 11 |
nicklas |
104 |
|
5651 |
08 Jun 11 |
nicklas |
105 |
if (item instanceof Subtypable) |
5651 |
08 Jun 11 |
nicklas |
106 |
{ |
5651 |
08 Jun 11 |
nicklas |
107 |
ItemSubtype subtype = ((Subtypable)parent.getItem(dc)).getItemSubtype(); |
5651 |
08 Jun 11 |
nicklas |
108 |
if (subtype != null) |
5651 |
08 Jun 11 |
nicklas |
109 |
{ |
5957 |
14 Feb 12 |
nicklas |
110 |
path += " <span class=\"itemsubtype\">(" + Base.getLinkedName(ID, subtype, false, true) + ")</span>"; |
5651 |
08 Jun 11 |
nicklas |
111 |
} |
5651 |
08 Jun 11 |
nicklas |
112 |
} |
4745 |
10 Feb 09 |
nicklas |
113 |
} |
4745 |
10 Feb 09 |
nicklas |
114 |
return path; |
4745 |
10 Feb 09 |
nicklas |
115 |
} |
4745 |
10 Feb 09 |
nicklas |
116 |
%> |
4745 |
10 Feb 09 |
nicklas |
117 |
<% |
4745 |
10 Feb 09 |
nicklas |
118 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4745 |
10 Feb 09 |
nicklas |
119 |
final String ID = sc.getId(); |
4745 |
10 Feb 09 |
nicklas |
120 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
121 |
final DbControl dc = sc.newDbControl(":Item overview - Details"); |
4745 |
10 Feb 09 |
nicklas |
122 |
try |
4745 |
10 Feb 09 |
nicklas |
123 |
{ |
5132 |
14 Oct 09 |
nicklas |
124 |
final GenericOverview overview = OverviewUtil.getCurrentOverview(sc); |
5957 |
14 Feb 12 |
nicklas |
125 |
final ItemContext cc = sc.getCurrentContext(overview.getRootItem().getType()); |
5185 |
05 Nov 09 |
nicklas |
126 |
final SnapshotManager snapshotManager = new SnapshotManager(); |
5132 |
14 Oct 09 |
nicklas |
127 |
final AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(); |
5132 |
14 Oct 09 |
nicklas |
128 |
final AnnotationFilter annotationFilter = new AnnotationFilter(); |
4745 |
10 Feb 09 |
nicklas |
129 |
ValidationOptions options = overview.getValidationOptions(); |
4745 |
10 Feb 09 |
nicklas |
130 |
String nodeId = request.getParameter("nodeId"); |
4840 |
24 Mar 09 |
martin |
131 |
Boolean showFailures = Values.getBoolean(request.getParameter("show_failures"), false); |
4745 |
10 Feb 09 |
nicklas |
132 |
Node node = overview.getNode(nodeId); |
4745 |
10 Feb 09 |
nicklas |
133 |
if (node == null) node = overview.getRootNode(); |
4745 |
10 Feb 09 |
nicklas |
134 |
|
6052 |
23 Apr 12 |
nicklas |
135 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, node); |
7605 |
26 Feb 19 |
nicklas |
136 |
ExtensionsInvoker<SectionAction> invoker = ExtensionsControl.useExtensions( |
6052 |
23 Apr 12 |
nicklas |
137 |
jspContext, "net.sf.basedb.clients.web.overview.info-details"); |
6052 |
23 Apr 12 |
nicklas |
138 |
|
5651 |
08 Jun 11 |
nicklas |
139 |
BasicItem item = node.getItem(dc); |
7859 |
20 Oct 20 |
nicklas |
140 |
BasicItem annotationsItem = item; |
4745 |
10 Feb 09 |
nicklas |
141 |
List<Failure> failures = overview.getFailures(); |
4745 |
10 Feb 09 |
nicklas |
142 |
if (failures == null) failures = new LinkedList<Failure>(); |
6939 |
21 Aug 15 |
nicklas |
143 |
|
6939 |
21 Aug 15 |
nicklas |
144 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
6939 |
21 Aug 15 |
nicklas |
145 |
|
7762 |
28 Nov 19 |
nicklas |
146 |
FileViewerContext fileContext = null; |
7762 |
28 Nov 19 |
nicklas |
147 |
FileViewerUtil fileViewer = null; |
7762 |
28 Nov 19 |
nicklas |
148 |
if (item instanceof FileSetMember) |
7762 |
28 Nov 19 |
nicklas |
149 |
{ |
7762 |
28 Nov 19 |
nicklas |
150 |
Node parentNode = node.getFirstParent(new NodeTypeFilter(Node.Type.ITEM)); |
7762 |
28 Nov 19 |
nicklas |
151 |
if (parentNode != null) |
7762 |
28 Nov 19 |
nicklas |
152 |
{ |
7762 |
28 Nov 19 |
nicklas |
153 |
fileContext = FileViewerContext.dataFile(parentNode.getItem()); |
7762 |
28 Nov 19 |
nicklas |
154 |
} |
7762 |
28 Nov 19 |
nicklas |
155 |
} |
7762 |
28 Nov 19 |
nicklas |
156 |
else if (item instanceof AnyToAny) |
7762 |
28 Nov 19 |
nicklas |
157 |
{ |
7762 |
28 Nov 19 |
nicklas |
158 |
if (((AnyToAny)item).getToType() == Item.FILE) |
7762 |
28 Nov 19 |
nicklas |
159 |
{ |
7762 |
28 Nov 19 |
nicklas |
160 |
Node parentNode = node.getFirstParent(new NodeTypeFilter(Node.Type.ITEM)); |
7762 |
28 Nov 19 |
nicklas |
161 |
if (parentNode != null) |
7762 |
28 Nov 19 |
nicklas |
162 |
{ |
7762 |
28 Nov 19 |
nicklas |
163 |
fileContext = FileViewerContext.anyToAny(parentNode.getItem()); |
7762 |
28 Nov 19 |
nicklas |
164 |
} |
7762 |
28 Nov 19 |
nicklas |
165 |
} |
7762 |
28 Nov 19 |
nicklas |
166 |
} |
7762 |
28 Nov 19 |
nicklas |
167 |
if (fileContext != null) |
7762 |
28 Nov 19 |
nicklas |
168 |
{ |
7855 |
19 Oct 20 |
nicklas |
169 |
fileViewer = FileViewerUtil.getOrCreate(jspContext, fileContext); |
7762 |
28 Nov 19 |
nicklas |
170 |
} |
4745 |
10 Feb 09 |
nicklas |
171 |
%> |
5951 |
09 Feb 12 |
nicklas |
172 |
<base:page title="" type="iframe"> |
6195 |
01 Nov 12 |
nicklas |
173 |
<base:head styles="table.css" scripts="dragdrop.js,~info.js"> |
6052 |
23 Apr 12 |
nicklas |
174 |
<ext:scripts context="<%=jspContext%>" /> |
6052 |
23 Apr 12 |
nicklas |
175 |
<ext:stylesheets context="<%=jspContext%>" /> |
5651 |
08 Jun 11 |
nicklas |
176 |
<style> |
5957 |
14 Feb 12 |
nicklas |
177 |
.itemsubtype .link |
5957 |
14 Feb 12 |
nicklas |
178 |
{ |
5651 |
08 Jun 11 |
nicklas |
179 |
color: #777777; |
5651 |
08 Jun 11 |
nicklas |
180 |
} |
6939 |
21 Aug 15 |
nicklas |
181 |
.edit-annotation |
6939 |
21 Aug 15 |
nicklas |
182 |
{ |
6939 |
21 Aug 15 |
nicklas |
183 |
float: right; |
6939 |
21 Aug 15 |
nicklas |
184 |
} |
5651 |
08 Jun 11 |
nicklas |
185 |
</style> |
4745 |
10 Feb 09 |
nicklas |
186 |
</base:head> |
4745 |
10 Feb 09 |
nicklas |
187 |
|
4745 |
10 Feb 09 |
nicklas |
188 |
<base:body> |
6194 |
01 Nov 12 |
nicklas |
189 |
<div class="absolutefull auto-init" data-auto-init="drag-support"> |
5918 |
21 Dec 11 |
nicklas |
190 |
<div> |
5918 |
21 Dec 11 |
nicklas |
191 |
<table class="fullform bottomborder outlined"> |
4745 |
10 Feb 09 |
nicklas |
192 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
193 |
<th>Path</th> |
5651 |
08 Jun 11 |
nicklas |
194 |
<td><%=getPath(dc, ID, node)%></td> |
4745 |
10 Feb 09 |
nicklas |
195 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
196 |
<% |
4745 |
10 Feb 09 |
nicklas |
197 |
if (item instanceof FileSetMember) |
4745 |
10 Feb 09 |
nicklas |
198 |
{ |
4745 |
10 Feb 09 |
nicklas |
199 |
FileSetMember member = null; |
4745 |
10 Feb 09 |
nicklas |
200 |
boolean notFound = false; |
4745 |
10 Feb 09 |
nicklas |
201 |
try |
4745 |
10 Feb 09 |
nicklas |
202 |
{ |
4745 |
10 Feb 09 |
nicklas |
203 |
member = FileSetMember.getById(dc, item.getId()); |
4745 |
10 Feb 09 |
nicklas |
204 |
} |
4745 |
10 Feb 09 |
nicklas |
205 |
catch (ItemNotFoundException ex) |
4745 |
10 Feb 09 |
nicklas |
206 |
{ |
4745 |
10 Feb 09 |
nicklas |
207 |
notFound = true; |
4745 |
10 Feb 09 |
nicklas |
208 |
} |
4745 |
10 Feb 09 |
nicklas |
209 |
File file = null; |
4745 |
10 Feb 09 |
nicklas |
210 |
DataFileType dft = null; |
4745 |
10 Feb 09 |
nicklas |
211 |
boolean deniedFile = false; |
4745 |
10 Feb 09 |
nicklas |
212 |
boolean deniedFileType = false; |
4745 |
10 Feb 09 |
nicklas |
213 |
if (member != null) |
4745 |
10 Feb 09 |
nicklas |
214 |
{ |
4745 |
10 Feb 09 |
nicklas |
215 |
try |
4745 |
10 Feb 09 |
nicklas |
216 |
{ |
4745 |
10 Feb 09 |
nicklas |
217 |
file = member.getFile(); |
7859 |
20 Oct 20 |
nicklas |
218 |
annotationsItem = file; |
4745 |
10 Feb 09 |
nicklas |
219 |
} |
4745 |
10 Feb 09 |
nicklas |
220 |
catch (PermissionDeniedException ex) |
4745 |
10 Feb 09 |
nicklas |
221 |
{ |
4745 |
10 Feb 09 |
nicklas |
222 |
deniedFile = true; |
4745 |
10 Feb 09 |
nicklas |
223 |
} |
4745 |
10 Feb 09 |
nicklas |
224 |
try |
4745 |
10 Feb 09 |
nicklas |
225 |
{ |
4745 |
10 Feb 09 |
nicklas |
226 |
dft = member.getDataFileType(); |
4745 |
10 Feb 09 |
nicklas |
227 |
} |
4745 |
10 Feb 09 |
nicklas |
228 |
catch (PermissionDeniedException ex) |
4745 |
10 Feb 09 |
nicklas |
229 |
{ |
4745 |
10 Feb 09 |
nicklas |
230 |
deniedFileType = true; |
4745 |
10 Feb 09 |
nicklas |
231 |
} |
4745 |
10 Feb 09 |
nicklas |
232 |
} |
4745 |
10 Feb 09 |
nicklas |
233 |
if (dft != null || file != null) |
4745 |
10 Feb 09 |
nicklas |
234 |
{ |
7762 |
28 Nov 19 |
nicklas |
235 |
if (file != null) fileContext.setCurrentDataFile(file, dft, member); |
4745 |
10 Feb 09 |
nicklas |
236 |
%> |
4745 |
10 Feb 09 |
nicklas |
237 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
238 |
<th><%=dft == null ? "Data file" : HTML.encodeTags(dft.getName())%></th> |
4745 |
10 Feb 09 |
nicklas |
239 |
<td> |
7762 |
28 Nov 19 |
nicklas |
240 |
<%=Base.getLinkedName(ID, file, deniedFile, true)%> |
7762 |
28 Nov 19 |
nicklas |
241 |
<%if (file != null) fileViewer.render(); %> |
4745 |
10 Feb 09 |
nicklas |
242 |
</td> |
4745 |
10 Feb 09 |
nicklas |
243 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
244 |
<% |
4745 |
10 Feb 09 |
nicklas |
245 |
} |
4745 |
10 Feb 09 |
nicklas |
246 |
else |
4745 |
10 Feb 09 |
nicklas |
247 |
{ |
4745 |
10 Feb 09 |
nicklas |
248 |
%> |
4745 |
10 Feb 09 |
nicklas |
249 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
250 |
<th><%=HTML.encodeTags(node.getTitle())%></th> |
4745 |
10 Feb 09 |
nicklas |
251 |
<td> |
4745 |
10 Feb 09 |
nicklas |
252 |
<%=notFound ? "<i>- not found -</i>" : "<i>- denied -</i>"%> |
4745 |
10 Feb 09 |
nicklas |
253 |
</td> |
4745 |
10 Feb 09 |
nicklas |
254 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
255 |
<% |
4745 |
10 Feb 09 |
nicklas |
256 |
} |
4745 |
10 Feb 09 |
nicklas |
257 |
} |
5500 |
18 Nov 10 |
nicklas |
258 |
else if (item instanceof AnyToAny) |
5500 |
18 Nov 10 |
nicklas |
259 |
{ |
5500 |
18 Nov 10 |
nicklas |
260 |
AnyToAny any = AnyToAny.getById(dc, item.getId()); |
5500 |
18 Nov 10 |
nicklas |
261 |
String linkTo = null; |
5500 |
18 Nov 10 |
nicklas |
262 |
try |
5500 |
18 Nov 10 |
nicklas |
263 |
{ |
5500 |
18 Nov 10 |
nicklas |
264 |
BasicItem to = any.getTo(); |
7859 |
20 Oct 20 |
nicklas |
265 |
annotationsItem = to; |
5500 |
18 Nov 10 |
nicklas |
266 |
String name = to instanceof Nameable ? ((Nameable)to).getName() : to.toString(); |
5500 |
18 Nov 10 |
nicklas |
267 |
linkTo = Base.getLink(ID, HTML.encodeTags(name), |
5500 |
18 Nov 10 |
nicklas |
268 |
to.getType(), to.getId(), to.hasPermission(Permission.WRITE)); |
7762 |
28 Nov 19 |
nicklas |
269 |
if (fileViewer != null) |
7762 |
28 Nov 19 |
nicklas |
270 |
{ |
7762 |
28 Nov 19 |
nicklas |
271 |
fileContext.setCurrentAnyToAny((File)to, any); |
7762 |
28 Nov 19 |
nicklas |
272 |
linkTo += " " + fileViewer.renderAsString(); |
7762 |
28 Nov 19 |
nicklas |
273 |
} |
5500 |
18 Nov 10 |
nicklas |
274 |
} |
5500 |
18 Nov 10 |
nicklas |
275 |
catch (PermissionDeniedException ex) |
5500 |
18 Nov 10 |
nicklas |
276 |
{ |
5500 |
18 Nov 10 |
nicklas |
277 |
linkTo = any.getToType() + "[id=" + any.getToId() + "] (<i>denied</i>)"; |
5500 |
18 Nov 10 |
nicklas |
278 |
} |
5500 |
18 Nov 10 |
nicklas |
279 |
catch (ItemNotFoundException ex) |
5500 |
18 Nov 10 |
nicklas |
280 |
{ |
5500 |
18 Nov 10 |
nicklas |
281 |
linkTo = any.getToType() + "[id=" + any.getToId() + "] (<i>missing</i>)"; |
5500 |
18 Nov 10 |
nicklas |
282 |
} |
5500 |
18 Nov 10 |
nicklas |
283 |
%> |
5500 |
18 Nov 10 |
nicklas |
284 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
285 |
<th>Any-to-any link</th> |
5500 |
18 Nov 10 |
nicklas |
286 |
<td> |
5918 |
21 Dec 11 |
nicklas |
287 |
<table> |
5500 |
18 Nov 10 |
nicklas |
288 |
<tr> |
5500 |
18 Nov 10 |
nicklas |
289 |
<td><%=Base.getLinkedName(ID, any, false, true) %></td> |
5946 |
03 Feb 12 |
nicklas |
290 |
<td><base:icon image="bullet.png" /></td> |
5500 |
18 Nov 10 |
nicklas |
291 |
<td><%=linkTo%></td> |
5500 |
18 Nov 10 |
nicklas |
292 |
</tr> |
5500 |
18 Nov 10 |
nicklas |
293 |
</table> |
5500 |
18 Nov 10 |
nicklas |
294 |
</td> |
5500 |
18 Nov 10 |
nicklas |
295 |
</tr> |
5500 |
18 Nov 10 |
nicklas |
296 |
<% |
5500 |
18 Nov 10 |
nicklas |
297 |
} |
4745 |
10 Feb 09 |
nicklas |
298 |
else |
4745 |
10 Feb 09 |
nicklas |
299 |
{ |
4745 |
10 Feb 09 |
nicklas |
300 |
%> |
4745 |
10 Feb 09 |
nicklas |
301 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
302 |
<th><%=node.getNodeType() == Node.Type.FOLDER ? |
5918 |
21 Dec 11 |
nicklas |
303 |
"Folder" : item != null ? item.getType().toString() : "Item"%></th> |
4745 |
10 Feb 09 |
nicklas |
304 |
<td> |
4745 |
10 Feb 09 |
nicklas |
305 |
<% |
5104 |
28 Sep 09 |
nicklas |
306 |
if (item != null) |
4745 |
10 Feb 09 |
nicklas |
307 |
{ |
4745 |
10 Feb 09 |
nicklas |
308 |
%> |
5104 |
28 Sep 09 |
nicklas |
309 |
<%=Base.getLink(ID, node.getTitle(), item.getType(),item.getId(), item.hasPermission(Permission.WRITE))%> |
4745 |
10 Feb 09 |
nicklas |
310 |
<% |
5651 |
08 Jun 11 |
nicklas |
311 |
if (item instanceof Subtypable) |
5651 |
08 Jun 11 |
nicklas |
312 |
{ |
5651 |
08 Jun 11 |
nicklas |
313 |
ItemSubtype subtype = ((Subtypable)item).getItemSubtype(); |
5651 |
08 Jun 11 |
nicklas |
314 |
if (subtype != null) |
5651 |
08 Jun 11 |
nicklas |
315 |
{ |
5651 |
08 Jun 11 |
nicklas |
316 |
%> |
5957 |
14 Feb 12 |
nicklas |
317 |
<span class="itemsubtype">(<%=Base.getLinkedName(ID, subtype, false, true)%>)</span> |
5651 |
08 Jun 11 |
nicklas |
318 |
<% |
5651 |
08 Jun 11 |
nicklas |
319 |
} |
5651 |
08 Jun 11 |
nicklas |
320 |
} |
4745 |
10 Feb 09 |
nicklas |
321 |
} |
4745 |
10 Feb 09 |
nicklas |
322 |
else |
4745 |
10 Feb 09 |
nicklas |
323 |
{ |
4745 |
10 Feb 09 |
nicklas |
324 |
%> |
4745 |
10 Feb 09 |
nicklas |
325 |
<%=HTML.encodeTags(node.getTitle())%> |
4745 |
10 Feb 09 |
nicklas |
326 |
<% |
4745 |
10 Feb 09 |
nicklas |
327 |
} |
4745 |
10 Feb 09 |
nicklas |
328 |
%> |
4745 |
10 Feb 09 |
nicklas |
329 |
</td> |
4745 |
10 Feb 09 |
nicklas |
330 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
331 |
<% |
4745 |
10 Feb 09 |
nicklas |
332 |
} |
4745 |
10 Feb 09 |
nicklas |
333 |
%> |
4745 |
10 Feb 09 |
nicklas |
334 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
335 |
<th>Errors (children)</th> |
4840 |
24 Mar 09 |
martin |
336 |
<% |
4840 |
24 Mar 09 |
martin |
337 |
if (showFailures) |
4840 |
24 Mar 09 |
martin |
338 |
{ |
4840 |
24 Mar 09 |
martin |
339 |
%> |
4840 |
24 Mar 09 |
martin |
340 |
<td><%=node.getNumErrors()+node.getChildErrors()%> (<%=node.getChildErrors()%>)</td> |
4840 |
24 Mar 09 |
martin |
341 |
<% |
4840 |
24 Mar 09 |
martin |
342 |
} |
4840 |
24 Mar 09 |
martin |
343 |
else |
4840 |
24 Mar 09 |
martin |
344 |
{ |
4840 |
24 Mar 09 |
martin |
345 |
%> |
4840 |
24 Mar 09 |
martin |
346 |
<td><i>- n/a -</i></td> |
4840 |
24 Mar 09 |
martin |
347 |
<% |
4840 |
24 Mar 09 |
martin |
348 |
} |
4840 |
24 Mar 09 |
martin |
349 |
%> |
4745 |
10 Feb 09 |
nicklas |
350 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
351 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
352 |
<th>Warnings (children)</th> |
4840 |
24 Mar 09 |
martin |
353 |
<% |
4840 |
24 Mar 09 |
martin |
354 |
if (showFailures) |
4840 |
24 Mar 09 |
martin |
355 |
{ |
4840 |
24 Mar 09 |
martin |
356 |
%> |
4840 |
24 Mar 09 |
martin |
357 |
<td><%=node.getNumWarnings()+node.getChildWarnings()%> (<%=node.getChildWarnings()%>)</td> |
4840 |
24 Mar 09 |
martin |
358 |
<% |
4840 |
24 Mar 09 |
martin |
359 |
} |
4840 |
24 Mar 09 |
martin |
360 |
else |
4840 |
24 Mar 09 |
martin |
361 |
{ |
4840 |
24 Mar 09 |
martin |
362 |
%> |
4840 |
24 Mar 09 |
martin |
363 |
<td><i>- n/a -</i></td> |
4840 |
24 Mar 09 |
martin |
364 |
<% |
4840 |
24 Mar 09 |
martin |
365 |
} |
4840 |
24 Mar 09 |
martin |
366 |
%> |
4745 |
10 Feb 09 |
nicklas |
367 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
368 |
<% |
4745 |
10 Feb 09 |
nicklas |
369 |
if (item instanceof Nameable) |
4745 |
10 Feb 09 |
nicklas |
370 |
{ |
4745 |
10 Feb 09 |
nicklas |
371 |
Nameable nameable = (Nameable)item; |
4745 |
10 Feb 09 |
nicklas |
372 |
%> |
4745 |
10 Feb 09 |
nicklas |
373 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
374 |
<th>Description</th> |
4745 |
10 Feb 09 |
nicklas |
375 |
<td><%=HTML.niceFormat(nameable.getDescription())%></td> |
4745 |
10 Feb 09 |
nicklas |
376 |
</tr> |
4745 |
10 Feb 09 |
nicklas |
377 |
<% |
4745 |
10 Feb 09 |
nicklas |
378 |
} |
4745 |
10 Feb 09 |
nicklas |
379 |
%> |
4745 |
10 Feb 09 |
nicklas |
380 |
</table> |
5918 |
21 Dec 11 |
nicklas |
381 |
</div> |
4745 |
10 Feb 09 |
nicklas |
382 |
<% |
5132 |
14 Oct 09 |
nicklas |
383 |
List<AnnotationSnapshot> annotations = new LinkedList<AnnotationSnapshot>(); |
4745 |
10 Feb 09 |
nicklas |
384 |
String annotationsTitle = ""; |
4745 |
10 Feb 09 |
nicklas |
385 |
Annotatable annotatable = null; |
7859 |
20 Oct 20 |
nicklas |
386 |
if (annotationsItem instanceof Annotation) |
4745 |
10 Feb 09 |
nicklas |
387 |
{ |
7859 |
20 Oct 20 |
nicklas |
388 |
Annotation a = Annotation.getById(dc, annotationsItem.getId()); |
5132 |
14 Oct 09 |
nicklas |
389 |
AnnotationSetSnapshot snapshot = snapshotManager.getSnapshot(dc, a.getAnnotationSet().getId()); |
5143 |
19 Oct 09 |
nicklas |
390 |
annotationFilter.setAnnotation(a); |
5132 |
14 Oct 09 |
nicklas |
391 |
annotations.addAll(snapshotManager.findAnnotations(dc, snapshot, annotationFilter, true)); |
5132 |
14 Oct 09 |
nicklas |
392 |
|
5132 |
14 Oct 09 |
nicklas |
393 |
// Find the annotatable parent node |
5132 |
14 Oct 09 |
nicklas |
394 |
Node parentNode = node; |
5132 |
14 Oct 09 |
nicklas |
395 |
while (parentNode != null) |
4757 |
13 Feb 09 |
nicklas |
396 |
{ |
5132 |
14 Oct 09 |
nicklas |
397 |
BasicItem parentItem = parentNode.getItem(); |
5132 |
14 Oct 09 |
nicklas |
398 |
if (parentItem instanceof Annotatable) |
5132 |
14 Oct 09 |
nicklas |
399 |
{ |
5132 |
14 Oct 09 |
nicklas |
400 |
annotatable = (Annotatable)parentItem; |
5132 |
14 Oct 09 |
nicklas |
401 |
break; |
5132 |
14 Oct 09 |
nicklas |
402 |
} |
5132 |
14 Oct 09 |
nicklas |
403 |
parentNode = parentNode.getParent(); |
4757 |
13 Feb 09 |
nicklas |
404 |
} |
4745 |
10 Feb 09 |
nicklas |
405 |
annotationsTitle = "Annotation values"; |
4745 |
10 Feb 09 |
nicklas |
406 |
} |
7859 |
20 Oct 20 |
nicklas |
407 |
else if (annotationsItem instanceof AnnotationType) |
4745 |
10 Feb 09 |
nicklas |
408 |
{ |
4745 |
10 Feb 09 |
nicklas |
409 |
// Find the annotatable parent |
4745 |
10 Feb 09 |
nicklas |
410 |
Node parentNode = node; |
4745 |
10 Feb 09 |
nicklas |
411 |
while (parentNode != null) |
4745 |
10 Feb 09 |
nicklas |
412 |
{ |
4745 |
10 Feb 09 |
nicklas |
413 |
BasicItem parentItem = parentNode.getItem(); |
5132 |
14 Oct 09 |
nicklas |
414 |
if (parentItem instanceof Annotatable && !(parentItem instanceof Protocol)) |
4745 |
10 Feb 09 |
nicklas |
415 |
{ |
5749 |
19 Sep 11 |
nicklas |
416 |
annotatable = (Annotatable)parentItem.getType().getById(dc, parentItem.getId()); |
4745 |
10 Feb 09 |
nicklas |
417 |
if (annotatable.isAnnotated()) |
4745 |
10 Feb 09 |
nicklas |
418 |
{ |
5132 |
14 Oct 09 |
nicklas |
419 |
annotationTypeFilter.setAnnotationType((AnnotationType)item); |
5132 |
14 Oct 09 |
nicklas |
420 |
annotations.addAll(snapshotManager.findAnnotations(dc, annotatable, annotationTypeFilter, true)); |
4745 |
10 Feb 09 |
nicklas |
421 |
} |
4745 |
10 Feb 09 |
nicklas |
422 |
annotationsTitle = "Annotation values"; |
4745 |
10 Feb 09 |
nicklas |
423 |
break; |
4745 |
10 Feb 09 |
nicklas |
424 |
} |
4745 |
10 Feb 09 |
nicklas |
425 |
parentNode = parentNode.getParent(); |
4745 |
10 Feb 09 |
nicklas |
426 |
} |
4745 |
10 Feb 09 |
nicklas |
427 |
} |
7859 |
20 Oct 20 |
nicklas |
428 |
else if (annotationsItem instanceof Annotatable) |
4745 |
10 Feb 09 |
nicklas |
429 |
{ |
4745 |
10 Feb 09 |
nicklas |
430 |
annotationsTitle = "Annotations & protocol parameters"; |
7859 |
20 Oct 20 |
nicklas |
431 |
annotatable = (Annotatable)annotationsItem.getType().getById(dc, annotationsItem.getId()); |
4745 |
10 Feb 09 |
nicklas |
432 |
if (annotatable.isAnnotated()) |
4745 |
10 Feb 09 |
nicklas |
433 |
{ |
5132 |
14 Oct 09 |
nicklas |
434 |
annotations.addAll(snapshotManager.findAnnotations(dc, annotatable, null, true)); |
4745 |
10 Feb 09 |
nicklas |
435 |
} |
6037 |
29 Mar 12 |
nicklas |
436 |
|
4745 |
10 Feb 09 |
nicklas |
437 |
} |
4745 |
10 Feb 09 |
nicklas |
438 |
if (annotations != null && annotations.size() > 0) |
4745 |
10 Feb 09 |
nicklas |
439 |
{ |
6939 |
21 Aug 15 |
nicklas |
440 |
Collections.sort(annotations, AnnotationSnapshot.sortByAnnotationType(dc)); |
4745 |
10 Feb 09 |
nicklas |
441 |
%> |
5957 |
14 Feb 12 |
nicklas |
442 |
<base:section |
5957 |
14 Feb 12 |
nicklas |
443 |
id="allAnnotations" |
5957 |
14 Feb 12 |
nicklas |
444 |
title="<%="Annotations & parameters (" + annotations.size() + ")"%>" |
5957 |
14 Feb 12 |
nicklas |
445 |
context="<%=cc %>"> |
5957 |
14 Feb 12 |
nicklas |
446 |
|
5957 |
14 Feb 12 |
nicklas |
447 |
<tbl:table id="annotations"> |
5957 |
14 Feb 12 |
nicklas |
448 |
<tbl:columndef id="annotation" title="Annotation/parameter" /> |
6939 |
21 Aug 15 |
nicklas |
449 |
<tbl:columndef id="values" title="Values" /> |
6939 |
21 Aug 15 |
nicklas |
450 |
<tbl:columndef |
6939 |
21 Aug 15 |
nicklas |
451 |
id="item" |
6939 |
21 Aug 15 |
nicklas |
452 |
title="Parent item" |
6939 |
21 Aug 15 |
nicklas |
453 |
/> |
6939 |
21 Aug 15 |
nicklas |
454 |
<tbl:columndef |
6939 |
21 Aug 15 |
nicklas |
455 |
id="note" |
6939 |
21 Aug 15 |
nicklas |
456 |
title="Note" |
6939 |
21 Aug 15 |
nicklas |
457 |
/> |
6939 |
21 Aug 15 |
nicklas |
458 |
<tbl:columndef |
6939 |
21 Aug 15 |
nicklas |
459 |
id="lastModified" |
6939 |
21 Aug 15 |
nicklas |
460 |
title="Last modified" |
6939 |
21 Aug 15 |
nicklas |
461 |
formatter="<%=dateTimeFormatter %>" |
6939 |
21 Aug 15 |
nicklas |
462 |
/> |
5957 |
14 Feb 12 |
nicklas |
463 |
<tbl:data> |
5957 |
14 Feb 12 |
nicklas |
464 |
<tbl:headers> |
5957 |
14 Feb 12 |
nicklas |
465 |
<tbl:headerrow> |
5957 |
14 Feb 12 |
nicklas |
466 |
<tbl:columnheaders /> |
5957 |
14 Feb 12 |
nicklas |
467 |
</tbl:headerrow> |
5957 |
14 Feb 12 |
nicklas |
468 |
</tbl:headers> |
5957 |
14 Feb 12 |
nicklas |
469 |
<tbl:rows> |
4745 |
10 Feb 09 |
nicklas |
470 |
<% |
5957 |
14 Feb 12 |
nicklas |
471 |
for (AnnotationSnapshot snapshot : annotations) |
4745 |
10 Feb 09 |
nicklas |
472 |
{ |
6076 |
31 Jul 12 |
nicklas |
473 |
AnnotationType at = snapshot.getAnnotationType(dc); |
6939 |
21 Aug 15 |
nicklas |
474 |
|
6939 |
21 Aug 15 |
nicklas |
475 |
// Unit and formatter for the values |
7605 |
26 Feb 19 |
nicklas |
476 |
Formatter<Object> formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
6939 |
21 Aug 15 |
nicklas |
477 |
Unit unit = snapshot.getActualUnit(dc); |
6939 |
21 Aug 15 |
nicklas |
478 |
UnitConverter converter = null; |
6939 |
21 Aug 15 |
nicklas |
479 |
if (unit != null) |
5957 |
14 Feb 12 |
nicklas |
480 |
{ |
6939 |
21 Aug 15 |
nicklas |
481 |
converter = unit.getUnitConverter(at.getDefaultUnit()); |
6939 |
21 Aug 15 |
nicklas |
482 |
formatter = unit.getFormatter(formatter); |
5957 |
14 Feb 12 |
nicklas |
483 |
} |
6939 |
21 Aug 15 |
nicklas |
484 |
// Get values |
6939 |
21 Aug 15 |
nicklas |
485 |
List<?> values = snapshot.getActualValues(converter, at.getValueType()); |
7338 |
12 Apr 17 |
nicklas |
486 |
|
7338 |
12 Apr 17 |
nicklas |
487 |
// Project-specific values |
7338 |
12 Apr 17 |
nicklas |
488 |
List<?> defaultValues = null; |
7338 |
12 Apr 17 |
nicklas |
489 |
boolean projectSpecific = snapshot.getProjectId() != 0;; |
7338 |
12 Apr 17 |
nicklas |
490 |
boolean overrideDefault = snapshot.getOverrideId() != 0; |
7338 |
12 Apr 17 |
nicklas |
491 |
if (overrideDefault) |
7338 |
12 Apr 17 |
nicklas |
492 |
{ |
7338 |
12 Apr 17 |
nicklas |
493 |
Annotation defAnn = Annotation.getById(dc, snapshot.getOverrideId()); |
7338 |
12 Apr 17 |
nicklas |
494 |
if (defAnn.getSource() == Annotation.Source.INHERITED) |
7338 |
12 Apr 17 |
nicklas |
495 |
{ |
7338 |
12 Apr 17 |
nicklas |
496 |
defAnn = defAnn.getInheritedFrom(); |
7338 |
12 Apr 17 |
nicklas |
497 |
} |
7338 |
12 Apr 17 |
nicklas |
498 |
defaultValues = defAnn.getValues(); |
7338 |
12 Apr 17 |
nicklas |
499 |
} |
6939 |
21 Aug 15 |
nicklas |
500 |
|
6939 |
21 Aug 15 |
nicklas |
501 |
// Inheritance information |
6939 |
21 Aug 15 |
nicklas |
502 |
Date lastModified = snapshot.getThisLastUpdate(); |
6962 |
01 Oct 15 |
nicklas |
503 |
boolean isUpToDate = snapshot.isUpToDate(); |
6939 |
21 Aug 15 |
nicklas |
504 |
AnnotationSnapshot inherited = snapshot.getInheritedFrom(); |
6939 |
21 Aug 15 |
nicklas |
505 |
Annotatable inheritedFrom = null; |
6939 |
21 Aug 15 |
nicklas |
506 |
if (inherited != null) |
5957 |
14 Feb 12 |
nicklas |
507 |
{ |
6939 |
21 Aug 15 |
nicklas |
508 |
if (lastModified == null) |
5957 |
14 Feb 12 |
nicklas |
509 |
{ |
6939 |
21 Aug 15 |
nicklas |
510 |
lastModified = inherited.getThisLastUpdate(); |
5957 |
14 Feb 12 |
nicklas |
511 |
} |
6939 |
21 Aug 15 |
nicklas |
512 |
try |
6939 |
21 Aug 15 |
nicklas |
513 |
{ |
6939 |
21 Aug 15 |
nicklas |
514 |
inheritedFrom = inherited.getThisItem(dc); |
6939 |
21 Aug 15 |
nicklas |
515 |
} |
6939 |
21 Aug 15 |
nicklas |
516 |
catch (Throwable t) |
6939 |
21 Aug 15 |
nicklas |
517 |
{} |
5957 |
14 Feb 12 |
nicklas |
518 |
} |
6939 |
21 Aug 15 |
nicklas |
519 |
|
6939 |
21 Aug 15 |
nicklas |
520 |
String icon = at != null && at.isProtocolParameter() ? |
6939 |
21 Aug 15 |
nicklas |
521 |
"parameter.png" : "annotation.png"; |
7207 |
19 Oct 16 |
nicklas |
522 |
boolean editPermission = snapshot.hasPermission(dc, Permission.WRITE); |
8160 |
07 Jun 23 |
nicklas |
523 |
String prefix = ""; |
8160 |
07 Jun 23 |
nicklas |
524 |
String sep = ", "; |
8160 |
07 Jun 23 |
nicklas |
525 |
String suffix = ""; |
8160 |
07 Jun 23 |
nicklas |
526 |
if (values.size() > 1 && at.getValueType().isText() && !at.isEnumeration()) |
8160 |
07 Jun 23 |
nicklas |
527 |
{ |
8160 |
07 Jun 23 |
nicklas |
528 |
prefix = "<ul class=\"bullet-list\"><li>"; |
8160 |
07 Jun 23 |
nicklas |
529 |
sep = "<li>"; |
8160 |
07 Jun 23 |
nicklas |
530 |
suffix = "</ul>"; |
8160 |
07 Jun 23 |
nicklas |
531 |
} |
5104 |
28 Sep 09 |
nicklas |
532 |
%> |
5957 |
14 Feb 12 |
nicklas |
533 |
<tbl:row> |
6195 |
01 Nov 12 |
nicklas |
534 |
<tbl:cell column="annotation"><base:icon image="<%=icon%>" /> |
6037 |
29 Mar 12 |
nicklas |
535 |
<%=Base.getLinkedName(ID, at, false, true)%> |
5957 |
14 Feb 12 |
nicklas |
536 |
</tbl:cell> |
7338 |
12 Apr 17 |
nicklas |
537 |
<tbl:cell column="values" clazz="<%=projectSpecific && defaultValues != null ? "cell ps-annotation" : "cell" %>"> |
6939 |
21 Aug 15 |
nicklas |
538 |
<base:icon id="<%=Integer.toString(snapshot.getThisAnnotationId())%>" |
6962 |
01 Oct 15 |
nicklas |
539 |
image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" |
6962 |
01 Oct 15 |
nicklas |
540 |
subclass="edit-annotation auto-init" |
6962 |
01 Oct 15 |
nicklas |
541 |
data-auto-init="edit-annotation" |
6939 |
21 Aug 15 |
nicklas |
542 |
data-item-type="<%=annotatable.getType().name()%>" |
6939 |
21 Aug 15 |
nicklas |
543 |
data-item-id="<%=annotatable.getId()%>" |
6939 |
21 Aug 15 |
nicklas |
544 |
data-annotation-type-id="<%=at.getId()%>" |
6939 |
21 Aug 15 |
nicklas |
545 |
data-annotation-id="<%=snapshot.getThisAnnotationId()%>" |
6939 |
21 Aug 15 |
nicklas |
546 |
tooltip="Edit this annotation" visible="<%=editPermission %>"/> |
8160 |
07 Jun 23 |
nicklas |
547 |
<%=prefix+Values.getString(values, sep, true, formatter)+suffix%> |
6939 |
21 Aug 15 |
nicklas |
548 |
</tbl:cell> |
6939 |
21 Aug 15 |
nicklas |
549 |
<tbl:cell column="item"> |
5957 |
14 Feb 12 |
nicklas |
550 |
<% |
6939 |
21 Aug 15 |
nicklas |
551 |
if (inheritedFrom != null) |
5957 |
14 Feb 12 |
nicklas |
552 |
{ |
6939 |
21 Aug 15 |
nicklas |
553 |
String ownerName = inheritedFrom instanceof Nameable ? |
6939 |
21 Aug 15 |
nicklas |
554 |
((Nameable)inheritedFrom).getName() : inheritedFrom.toString(); |
5957 |
14 Feb 12 |
nicklas |
555 |
%> |
6939 |
21 Aug 15 |
nicklas |
556 |
<%=Base.getLink(ID, ownerName, inheritedFrom.getType(), inheritedFrom.getId(), inheritedFrom.hasPermission(Permission.WRITE)) %> |
5957 |
14 Feb 12 |
nicklas |
557 |
<% |
5957 |
14 Feb 12 |
nicklas |
558 |
} |
6939 |
21 Aug 15 |
nicklas |
559 |
else if (snapshot.getSource() == Annotation.Source.CLONED) |
6939 |
21 Aug 15 |
nicklas |
560 |
{ |
6939 |
21 Aug 15 |
nicklas |
561 |
%> |
6939 |
21 Aug 15 |
nicklas |
562 |
<i>- missing -</i> |
6939 |
21 Aug 15 |
nicklas |
563 |
<% |
6939 |
21 Aug 15 |
nicklas |
564 |
} |
5957 |
14 Feb 12 |
nicklas |
565 |
%> |
5957 |
14 Feb 12 |
nicklas |
566 |
</tbl:cell> |
7338 |
12 Apr 17 |
nicklas |
567 |
<tbl:cell column="note"> |
7338 |
12 Apr 17 |
nicklas |
568 |
<%=snapshot.getSource() == Annotation.Source.CLONED ? "Cloned" + (isUpToDate ? "; up-to-date" : "; modified") : "" %> |
7338 |
12 Apr 17 |
nicklas |
569 |
<% |
7338 |
12 Apr 17 |
nicklas |
570 |
if (projectSpecific) |
7338 |
12 Apr 17 |
nicklas |
571 |
{ |
7338 |
12 Apr 17 |
nicklas |
572 |
%> |
7338 |
12 Apr 17 |
nicklas |
573 |
<%=defaultValues == null || defaultValues.size() == 0 ? "No default value" : "Default value: " + Values.getString(defaultValues, ", ", true, formatter)%> |
7338 |
12 Apr 17 |
nicklas |
574 |
<% |
7338 |
12 Apr 17 |
nicklas |
575 |
} |
7338 |
12 Apr 17 |
nicklas |
576 |
%> |
7338 |
12 Apr 17 |
nicklas |
577 |
</tbl:cell> |
6939 |
21 Aug 15 |
nicklas |
578 |
<tbl:cell column="lastModified" value="<%=lastModified %>" /> |
5957 |
14 Feb 12 |
nicklas |
579 |
</tbl:row> |
5104 |
28 Sep 09 |
nicklas |
580 |
<% |
4745 |
10 Feb 09 |
nicklas |
581 |
} |
4745 |
10 Feb 09 |
nicklas |
582 |
%> |
5957 |
14 Feb 12 |
nicklas |
583 |
</tbl:rows> |
5957 |
14 Feb 12 |
nicklas |
584 |
</tbl:data> |
5957 |
14 Feb 12 |
nicklas |
585 |
</tbl:table> |
5957 |
14 Feb 12 |
nicklas |
586 |
</base:section> |
4745 |
10 Feb 09 |
nicklas |
587 |
<% |
4840 |
24 Mar 09 |
martin |
588 |
} |
4840 |
24 Mar 09 |
martin |
589 |
if (showFailures) |
4745 |
10 Feb 09 |
nicklas |
590 |
{ |
4840 |
24 Mar 09 |
martin |
591 |
%> |
5957 |
14 Feb 12 |
nicklas |
592 |
<base:section |
5957 |
14 Feb 12 |
nicklas |
593 |
id="failures" |
5957 |
14 Feb 12 |
nicklas |
594 |
title="<%="Failure details (" + (node.getNumErrors() + node.getNumWarnings()) + ")"%>" |
5957 |
14 Feb 12 |
nicklas |
595 |
context="<%=cc %>" |
5957 |
14 Feb 12 |
nicklas |
596 |
> |
4840 |
24 Mar 09 |
martin |
597 |
<table> |
4840 |
24 Mar 09 |
martin |
598 |
<% |
4840 |
24 Mar 09 |
martin |
599 |
int numFailures = 0; |
4840 |
24 Mar 09 |
martin |
600 |
for (Failure failure : failures) |
4745 |
10 Feb 09 |
nicklas |
601 |
{ |
6047 |
18 Apr 12 |
nicklas |
602 |
ValidationRuleAction validator = failure.getValidator(); |
4840 |
24 Mar 09 |
martin |
603 |
Severity severity = options.getSeverity(validator); |
4840 |
24 Mar 09 |
martin |
604 |
if (failure.getNode() == node && severity != Severity.IGNORE) |
4840 |
24 Mar 09 |
martin |
605 |
{ |
4840 |
24 Mar 09 |
martin |
606 |
numFailures++; |
4840 |
24 Mar 09 |
martin |
607 |
List<Fix> fixes = failure.getFixes(); |
4840 |
24 Mar 09 |
martin |
608 |
%> |
4840 |
24 Mar 09 |
martin |
609 |
<tr> |
5957 |
14 Feb 12 |
nicklas |
610 |
<td><base:icon image="<%=severity == Severity.ERROR ? "error.png" : "warning.png"%>" style="padding-right: 4px;"/></td> |
4840 |
24 Mar 09 |
martin |
611 |
<td><b><%=HTML.encodeTags(failure.getMessage())%></b></td> |
4840 |
24 Mar 09 |
martin |
612 |
</tr> |
4840 |
24 Mar 09 |
martin |
613 |
<tr> |
5957 |
14 Feb 12 |
nicklas |
614 |
<td></td> |
5957 |
14 Feb 12 |
nicklas |
615 |
<td style="padding-bottom: 0.3em;"> |
4840 |
24 Mar 09 |
martin |
616 |
<%=HTML.encodeTags(validator.getDescription())%><br> |
4840 |
24 Mar 09 |
martin |
617 |
<% |
4840 |
24 Mar 09 |
martin |
618 |
if (fixes != null && fixes.size() > 0) |
4745 |
10 Feb 09 |
nicklas |
619 |
{ |
4840 |
24 Mar 09 |
martin |
620 |
for (Fix fix : fixes) |
4745 |
10 Feb 09 |
nicklas |
621 |
{ |
4840 |
24 Mar 09 |
martin |
622 |
if (fix == null) continue; |
4840 |
24 Mar 09 |
martin |
623 |
BasicItem fixItem = fix.getItem(); |
6195 |
01 Nov 12 |
nicklas |
624 |
AnnotationType at = fix.getAnnotationType(); |
6939 |
21 Aug 15 |
nicklas |
625 |
Annotation a = fix.getAnnotation(); |
7207 |
19 Oct 16 |
nicklas |
626 |
boolean enabled = a != null ? |
7207 |
19 Oct 16 |
nicklas |
627 |
a.hasPermission(Permission.WRITE) : fixItem.hasPermission(Permission.WRITE); |
6195 |
01 Nov 12 |
nicklas |
628 |
String autoInit = ""; |
5807 |
14 Oct 11 |
nicklas |
629 |
if (enabled) |
4745 |
10 Feb 09 |
nicklas |
630 |
{ |
4840 |
24 Mar 09 |
martin |
631 |
if (fix.isAnnotationFix()) |
4745 |
10 Feb 09 |
nicklas |
632 |
{ |
6939 |
21 Aug 15 |
nicklas |
633 |
autoInit = "edit-annotation"; |
4745 |
10 Feb 09 |
nicklas |
634 |
} |
4840 |
24 Mar 09 |
martin |
635 |
else if (fix.isDataFileFix()) |
4840 |
24 Mar 09 |
martin |
636 |
{ |
6195 |
01 Nov 12 |
nicklas |
637 |
autoInit = "edit-data-file"; |
4840 |
24 Mar 09 |
martin |
638 |
} |
4745 |
10 Feb 09 |
nicklas |
639 |
else |
4745 |
10 Feb 09 |
nicklas |
640 |
{ |
6195 |
01 Nov 12 |
nicklas |
641 |
autoInit = "edit-item"; |
4745 |
10 Feb 09 |
nicklas |
642 |
} |
5807 |
14 Oct 11 |
nicklas |
643 |
} |
5807 |
14 Oct 11 |
nicklas |
644 |
%> |
5945 |
02 Feb 12 |
nicklas |
645 |
<base:icon image="fixit.png" |
5807 |
14 Oct 11 |
nicklas |
646 |
style="padding-bottom: 4px;" |
6195 |
01 Nov 12 |
nicklas |
647 |
id="<%=Integer.toString(fix.hashCode())%>" |
5945 |
02 Feb 12 |
nicklas |
648 |
enabled="<%=enabled %>" |
6195 |
01 Nov 12 |
nicklas |
649 |
subclass="auto-init" |
6195 |
01 Nov 12 |
nicklas |
650 |
data-auto-init="<%=autoInit%>" |
6195 |
01 Nov 12 |
nicklas |
651 |
data-item-type="<%=fixItem.getType().name()%>" |
6195 |
01 Nov 12 |
nicklas |
652 |
data-item-id="<%=fixItem.getId()%>" |
6195 |
01 Nov 12 |
nicklas |
653 |
data-annotation-type-id="<%=at != null ? at.getId() : ""%>" |
6939 |
21 Aug 15 |
nicklas |
654 |
data-annotation-id="<%=a != null ? a.getId() : "" %>" |
6195 |
01 Nov 12 |
nicklas |
655 |
tooltip="<%=enabled ? "Edit this item to fix the problem" : "You do not have permission to modify this item" %>" |
6195 |
01 Nov 12 |
nicklas |
656 |
><%=HTML.encodeTags(fix.getMessage())%></base:icon><br> |
6195 |
01 Nov 12 |
nicklas |
657 |
<% |
4745 |
10 Feb 09 |
nicklas |
658 |
} |
4745 |
10 Feb 09 |
nicklas |
659 |
} |
4840 |
24 Mar 09 |
martin |
660 |
%> |
4840 |
24 Mar 09 |
martin |
661 |
</td> |
4840 |
24 Mar 09 |
martin |
662 |
</tr> |
4840 |
24 Mar 09 |
martin |
663 |
<% |
4840 |
24 Mar 09 |
martin |
664 |
} |
4745 |
10 Feb 09 |
nicklas |
665 |
} |
4745 |
10 Feb 09 |
nicklas |
666 |
%> |
4840 |
24 Mar 09 |
martin |
667 |
</table> |
4745 |
10 Feb 09 |
nicklas |
668 |
<% |
4840 |
24 Mar 09 |
martin |
669 |
if (numFailures == 0) |
4840 |
24 Mar 09 |
martin |
670 |
{ |
4840 |
24 Mar 09 |
martin |
671 |
%> |
5957 |
14 Feb 12 |
nicklas |
672 |
<div class="messagecontainer note"> |
4840 |
24 Mar 09 |
martin |
673 |
No validation failures on this item |
5957 |
14 Feb 12 |
nicklas |
674 |
</div> |
4840 |
24 Mar 09 |
martin |
675 |
<% |
5957 |
14 Feb 12 |
nicklas |
676 |
} |
5957 |
14 Feb 12 |
nicklas |
677 |
%> |
5957 |
14 Feb 12 |
nicklas |
678 |
</base:section> |
5957 |
14 Feb 12 |
nicklas |
679 |
<% |
4745 |
10 Feb 09 |
nicklas |
680 |
} |
6052 |
23 Apr 12 |
nicklas |
681 |
|
6052 |
23 Apr 12 |
nicklas |
682 |
for (SectionAction section : invoker) |
6052 |
23 Apr 12 |
nicklas |
683 |
{ |
6052 |
23 Apr 12 |
nicklas |
684 |
%> |
6052 |
23 Apr 12 |
nicklas |
685 |
<base:section |
6052 |
23 Apr 12 |
nicklas |
686 |
id="<%=section.getId() %>" |
6052 |
23 Apr 12 |
nicklas |
687 |
showclazz="<%=section.getShowClazz() %>" |
6052 |
23 Apr 12 |
nicklas |
688 |
hideclazz="<%=section.getHideClazz() %>" |
6052 |
23 Apr 12 |
nicklas |
689 |
style="<%=section.getStyle() %>" |
6052 |
23 Apr 12 |
nicklas |
690 |
contentstyle="<%=section.getContentStyle() %>" |
6052 |
23 Apr 12 |
nicklas |
691 |
title="<%=section.getTitle() %>" |
6052 |
23 Apr 12 |
nicklas |
692 |
context="<%=cc %>" |
6052 |
23 Apr 12 |
nicklas |
693 |
><%=section.getContent() %></base:section> |
6052 |
23 Apr 12 |
nicklas |
694 |
<% |
6052 |
23 Apr 12 |
nicklas |
695 |
} |
4745 |
10 Feb 09 |
nicklas |
696 |
%> |
5918 |
21 Dec 11 |
nicklas |
697 |
</div> |
4745 |
10 Feb 09 |
nicklas |
698 |
</base:body> |
4745 |
10 Feb 09 |
nicklas |
699 |
</base:page> |
4745 |
10 Feb 09 |
nicklas |
700 |
<% |
4745 |
10 Feb 09 |
nicklas |
701 |
} |
4745 |
10 Feb 09 |
nicklas |
702 |
finally |
4745 |
10 Feb 09 |
nicklas |
703 |
{ |
4745 |
10 Feb 09 |
nicklas |
704 |
if (dc != null) dc.close(); |
4745 |
10 Feb 09 |
nicklas |
705 |
} |
4745 |
10 Feb 09 |
nicklas |
706 |
%> |