6916 |
22 May 15 |
nicklas |
1 |
<%-- $Id: view_bioassay.jsp 6909 2015-05-18 06:48:30Z nicklas $ |
6916 |
22 May 15 |
nicklas |
2 |
------------------------------------------------------------------ |
6916 |
22 May 15 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
6916 |
22 May 15 |
nicklas |
4 |
|
6916 |
22 May 15 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
6916 |
22 May 15 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
6916 |
22 May 15 |
nicklas |
7 |
|
6916 |
22 May 15 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
6916 |
22 May 15 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
6916 |
22 May 15 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
6916 |
22 May 15 |
nicklas |
11 |
of the License, or (at your option) any later version. |
6916 |
22 May 15 |
nicklas |
12 |
|
6916 |
22 May 15 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
6916 |
22 May 15 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
6916 |
22 May 15 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6916 |
22 May 15 |
nicklas |
16 |
GNU General Public License for more details. |
6916 |
22 May 15 |
nicklas |
17 |
|
6916 |
22 May 15 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
6916 |
22 May 15 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
6916 |
22 May 15 |
nicklas |
20 |
------------------------------------------------------------------ |
6916 |
22 May 15 |
nicklas |
21 |
|
6916 |
22 May 15 |
nicklas |
22 |
|
6916 |
22 May 15 |
nicklas |
23 |
@author Nicklas |
6916 |
22 May 15 |
nicklas |
24 |
@version 2.0 |
6916 |
22 May 15 |
nicklas |
25 |
--%> |
6916 |
22 May 15 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
6916 |
22 May 15 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl" |
6916 |
22 May 15 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
6916 |
22 May 15 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
6916 |
22 May 15 |
nicklas |
30 |
import="net.sf.basedb.core.ItemContext" |
6916 |
22 May 15 |
nicklas |
31 |
import="net.sf.basedb.core.Permission" |
6916 |
22 May 15 |
nicklas |
32 |
import="net.sf.basedb.core.Experiment" |
6916 |
22 May 15 |
nicklas |
33 |
import="net.sf.basedb.core.RawBioAssay" |
6916 |
22 May 15 |
nicklas |
34 |
import="net.sf.basedb.core.RootRawBioAssay" |
6916 |
22 May 15 |
nicklas |
35 |
import="net.sf.basedb.core.Type" |
6942 |
31 Aug 15 |
nicklas |
36 |
import="net.sf.basedb.core.Unit" |
6916 |
22 May 15 |
nicklas |
37 |
import="net.sf.basedb.core.Annotatable" |
6916 |
22 May 15 |
nicklas |
38 |
import="net.sf.basedb.core.AnnotationSet" |
6916 |
22 May 15 |
nicklas |
39 |
import="net.sf.basedb.core.AnnotationType" |
6916 |
22 May 15 |
nicklas |
40 |
import="net.sf.basedb.core.Annotation" |
6916 |
22 May 15 |
nicklas |
41 |
import="net.sf.basedb.core.ItemQuery" |
6916 |
22 May 15 |
nicklas |
42 |
import="net.sf.basedb.core.ItemResultList" |
6916 |
22 May 15 |
nicklas |
43 |
import="net.sf.basedb.core.Include" |
6916 |
22 May 15 |
nicklas |
44 |
import="net.sf.basedb.core.BaseException" |
6916 |
22 May 15 |
nicklas |
45 |
import="net.sf.basedb.core.PluginDefinition" |
6916 |
22 May 15 |
nicklas |
46 |
import="net.sf.basedb.core.ItemSubtype" |
6916 |
22 May 15 |
nicklas |
47 |
import="net.sf.basedb.core.Subtypable" |
6916 |
22 May 15 |
nicklas |
48 |
import="net.sf.basedb.core.PermissionDeniedException" |
6916 |
22 May 15 |
nicklas |
49 |
import="net.sf.basedb.core.Nameable" |
6916 |
22 May 15 |
nicklas |
50 |
import="net.sf.basedb.core.plugin.GuiContext" |
6916 |
22 May 15 |
nicklas |
51 |
import="net.sf.basedb.core.plugin.Plugin" |
6916 |
22 May 15 |
nicklas |
52 |
import="net.sf.basedb.core.query.Orders" |
6916 |
22 May 15 |
nicklas |
53 |
import="net.sf.basedb.core.query.Hql" |
6916 |
22 May 15 |
nicklas |
54 |
import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
6916 |
22 May 15 |
nicklas |
55 |
import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
6916 |
22 May 15 |
nicklas |
56 |
import="net.sf.basedb.core.snapshot.SnapshotManager" |
6916 |
22 May 15 |
nicklas |
57 |
import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
6916 |
22 May 15 |
nicklas |
58 |
import="net.sf.basedb.util.formatter.Formatter" |
6942 |
31 Aug 15 |
nicklas |
59 |
import="net.sf.basedb.util.units.UnitConverter" |
6916 |
22 May 15 |
nicklas |
60 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
6916 |
22 May 15 |
nicklas |
61 |
import="net.sf.basedb.clients.web.Base" |
6916 |
22 May 15 |
nicklas |
62 |
import="net.sf.basedb.clients.web.PermissionUtil" |
6916 |
22 May 15 |
nicklas |
63 |
import="net.sf.basedb.clients.web.util.HTML" |
6916 |
22 May 15 |
nicklas |
64 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6916 |
22 May 15 |
nicklas |
65 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
6916 |
22 May 15 |
nicklas |
66 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
67 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
6916 |
22 May 15 |
nicklas |
68 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
6916 |
22 May 15 |
nicklas |
69 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
6916 |
22 May 15 |
nicklas |
70 |
import="net.sf.basedb.util.Values" |
6916 |
22 May 15 |
nicklas |
71 |
import="java.util.Map" |
6916 |
22 May 15 |
nicklas |
72 |
import="java.util.List" |
6916 |
22 May 15 |
nicklas |
73 |
import="java.util.HashMap" |
6916 |
22 May 15 |
nicklas |
74 |
import="java.util.LinkedList" |
6942 |
31 Aug 15 |
nicklas |
75 |
import="java.util.Date" |
6916 |
22 May 15 |
nicklas |
76 |
%> |
6916 |
22 May 15 |
nicklas |
77 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
6916 |
22 May 15 |
nicklas |
78 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6916 |
22 May 15 |
nicklas |
79 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
6916 |
22 May 15 |
nicklas |
80 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
6916 |
22 May 15 |
nicklas |
81 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
6916 |
22 May 15 |
nicklas |
82 |
<%! |
6916 |
22 May 15 |
nicklas |
83 |
private static final Item itemType = Item.ROOTRAWBIOASSAY; |
6916 |
22 May 15 |
nicklas |
84 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
6916 |
22 May 15 |
nicklas |
85 |
%> |
6916 |
22 May 15 |
nicklas |
86 |
<% |
6916 |
22 May 15 |
nicklas |
87 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
6916 |
22 May 15 |
nicklas |
88 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
6916 |
22 May 15 |
nicklas |
89 |
final int itemId = cc.getId(); |
6916 |
22 May 15 |
nicklas |
90 |
final String ID = sc.getId(); |
6916 |
22 May 15 |
nicklas |
91 |
final float scale = Base.getScale(sc); |
6916 |
22 May 15 |
nicklas |
92 |
final String tabId = Values.getString(request.getParameter("tab"), "properties"); |
7954 |
12 May 21 |
nicklas |
93 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
6916 |
22 May 15 |
nicklas |
94 |
try |
6916 |
22 May 15 |
nicklas |
95 |
{ |
6916 |
22 May 15 |
nicklas |
96 |
RootRawBioAssay bioAssay = RootRawBioAssay.getById(dc, itemId); |
6916 |
22 May 15 |
nicklas |
97 |
Experiment experiment = bioAssay.getExperiment(); |
6916 |
22 May 15 |
nicklas |
98 |
String title = null; |
6916 |
22 May 15 |
nicklas |
99 |
|
6916 |
22 May 15 |
nicklas |
100 |
ItemQuery<AnnotationType> efQuery = experiment.getExperimentalFactors(); |
6916 |
22 May 15 |
nicklas |
101 |
efQuery.include(Include.ALL); |
6916 |
22 May 15 |
nicklas |
102 |
efQuery.order(Orders.asc(Hql.property("name"))); |
6916 |
22 May 15 |
nicklas |
103 |
ItemResultList<AnnotationType> experimentalFactors = efQuery.list(dc); |
6916 |
22 May 15 |
nicklas |
104 |
SnapshotManager manager = new SnapshotManager(); |
6916 |
22 May 15 |
nicklas |
105 |
AnnotationSetSnapshot snapshot = bioAssay.isAnnotated() ? |
6916 |
22 May 15 |
nicklas |
106 |
manager.getSnapshot(dc, bioAssay.getAnnotationSet().getId()) : null; |
6916 |
22 May 15 |
nicklas |
107 |
|
6962 |
01 Oct 15 |
nicklas |
108 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
6916 |
22 May 15 |
nicklas |
109 |
final boolean writePermission = bioAssay.hasPermission(Permission.WRITE); |
6916 |
22 May 15 |
nicklas |
110 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
6916 |
22 May 15 |
nicklas |
111 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssay); |
7604 |
25 Feb 19 |
nicklas |
112 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
6916 |
22 May 15 |
nicklas |
113 |
%> |
6916 |
22 May 15 |
nicklas |
114 |
<base:page title="<%=title%>" id="view-page"> |
6916 |
22 May 15 |
nicklas |
115 |
<base:head scripts="table.js,tabcontrol-2.js,~bioassays.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
6916 |
22 May 15 |
nicklas |
116 |
<ext:scripts context="<%=jspContext%>" /> |
6916 |
22 May 15 |
nicklas |
117 |
<ext:stylesheets context="<%=jspContext%>" /> |
6942 |
31 Aug 15 |
nicklas |
118 |
<style> |
6942 |
31 Aug 15 |
nicklas |
119 |
.edit-experimental-factor |
6942 |
31 Aug 15 |
nicklas |
120 |
{ |
6942 |
31 Aug 15 |
nicklas |
121 |
float: right; |
6942 |
31 Aug 15 |
nicklas |
122 |
} |
6942 |
31 Aug 15 |
nicklas |
123 |
</style> |
6916 |
22 May 15 |
nicklas |
124 |
</base:head> |
6916 |
22 May 15 |
nicklas |
125 |
<base:body> |
6916 |
22 May 15 |
nicklas |
126 |
<p:path><p:pathelement |
6916 |
22 May 15 |
nicklas |
127 |
title="Experiments" href="<%="../index.jsp?ID="+ID%>" |
6916 |
22 May 15 |
nicklas |
128 |
/><p:pathelement title="<%=HTML.encodeTags(experiment.getName())%>" |
6916 |
22 May 15 |
nicklas |
129 |
href="<%="../index.jsp?ID="+ID+"&cmd=ViewItem&item_id="+experiment.getId()%>" |
6916 |
22 May 15 |
nicklas |
130 |
/><p:pathelement title="<%=HTML.encodeTags(bioAssay.getName())%>" |
6916 |
22 May 15 |
nicklas |
131 |
/></p:path> |
6916 |
22 May 15 |
nicklas |
132 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
6916 |
22 May 15 |
nicklas |
133 |
|
6916 |
22 May 15 |
nicklas |
134 |
<t:tabcontrol |
6916 |
22 May 15 |
nicklas |
135 |
id="main" |
6916 |
22 May 15 |
nicklas |
136 |
subclass="content mastertabcontrol" |
6916 |
22 May 15 |
nicklas |
137 |
active="<%=tabId%>"> |
6916 |
22 May 15 |
nicklas |
138 |
<t:tab id="properties" title="Properties"> |
6916 |
22 May 15 |
nicklas |
139 |
<div> |
6916 |
22 May 15 |
nicklas |
140 |
<table class="fullform bottomborder"> |
6916 |
22 May 15 |
nicklas |
141 |
<tr> |
6916 |
22 May 15 |
nicklas |
142 |
<th class="itemstatus"> |
6916 |
22 May 15 |
nicklas |
143 |
</th> |
6916 |
22 May 15 |
nicklas |
144 |
<td style="padding: 0px;"> |
6916 |
22 May 15 |
nicklas |
145 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
6916 |
22 May 15 |
nicklas |
146 |
<tbl:button |
6916 |
22 May 15 |
nicklas |
147 |
id="btnEdit" |
6916 |
22 May 15 |
nicklas |
148 |
disabled="<%=!writePermission%>" |
6916 |
22 May 15 |
nicklas |
149 |
image="edit.png" |
6916 |
22 May 15 |
nicklas |
150 |
title="Edit…" |
6916 |
22 May 15 |
nicklas |
151 |
tooltip="<%=writePermission ? "Edit this bioassay" : "You do not have permission to edit this bioassay"%>" |
6916 |
22 May 15 |
nicklas |
152 |
/> |
6916 |
22 May 15 |
nicklas |
153 |
<tbl:button |
6916 |
22 May 15 |
nicklas |
154 |
id="btnImport" |
6916 |
22 May 15 |
nicklas |
155 |
image="import.png" |
6916 |
22 May 15 |
nicklas |
156 |
data-plugin-type="IMPORT" |
6916 |
22 May 15 |
nicklas |
157 |
title="Import…" |
6916 |
22 May 15 |
nicklas |
158 |
tooltip="Import data" |
6916 |
22 May 15 |
nicklas |
159 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
6916 |
22 May 15 |
nicklas |
160 |
/> |
6916 |
22 May 15 |
nicklas |
161 |
<tbl:button |
6916 |
22 May 15 |
nicklas |
162 |
id="btnExport" |
6916 |
22 May 15 |
nicklas |
163 |
image="export.png" |
6916 |
22 May 15 |
nicklas |
164 |
data-plugin-type="EXPORT" |
6916 |
22 May 15 |
nicklas |
165 |
title="Export…" |
6916 |
22 May 15 |
nicklas |
166 |
tooltip="Export data" |
6916 |
22 May 15 |
nicklas |
167 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
6916 |
22 May 15 |
nicklas |
168 |
/> |
6916 |
22 May 15 |
nicklas |
169 |
<tbl:button |
6916 |
22 May 15 |
nicklas |
170 |
id="btnRunPlugin" |
6916 |
22 May 15 |
nicklas |
171 |
image="runplugin.png" |
6916 |
22 May 15 |
nicklas |
172 |
data-plugin-type="OTHER" |
6916 |
22 May 15 |
nicklas |
173 |
title="Run plugin…" |
6916 |
22 May 15 |
nicklas |
174 |
tooltip="Run a plugin" |
6916 |
22 May 15 |
nicklas |
175 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
6916 |
22 May 15 |
nicklas |
176 |
/> |
6916 |
22 May 15 |
nicklas |
177 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
178 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
6916 |
22 May 15 |
nicklas |
179 |
<tbl:button |
6916 |
22 May 15 |
nicklas |
180 |
image="help.png" |
6916 |
22 May 15 |
nicklas |
181 |
subclass="auto-init" |
6916 |
22 May 15 |
nicklas |
182 |
data-auto-init="help" |
6916 |
22 May 15 |
nicklas |
183 |
data-help-id="rootrawbioassay.view.properties" |
6916 |
22 May 15 |
nicklas |
184 |
title="Help…" |
6916 |
22 May 15 |
nicklas |
185 |
tooltip="Get help about this page" |
6916 |
22 May 15 |
nicklas |
186 |
/> |
6916 |
22 May 15 |
nicklas |
187 |
</tbl:toolbar> |
6916 |
22 May 15 |
nicklas |
188 |
</td> |
6916 |
22 May 15 |
nicklas |
189 |
</tr> |
6916 |
22 May 15 |
nicklas |
190 |
<tr> |
6916 |
22 May 15 |
nicklas |
191 |
<th>Name</th> |
6916 |
22 May 15 |
nicklas |
192 |
<td><%=HTML.encodeTags(bioAssay.getName())%></td> |
6916 |
22 May 15 |
nicklas |
193 |
</tr> |
6916 |
22 May 15 |
nicklas |
194 |
<tr> |
6916 |
22 May 15 |
nicklas |
195 |
<th>Parent raw bioassay</th> |
6916 |
22 May 15 |
nicklas |
196 |
<td><base:propertyvalue item="<%=bioAssay%>" property="rawBioAssay" /> |
6916 |
22 May 15 |
nicklas |
197 |
<tr> |
6916 |
22 May 15 |
nicklas |
198 |
<th>Description</th> |
6916 |
22 May 15 |
nicklas |
199 |
<td><%=HTML.encodeTags(bioAssay.getDescription())%></td> |
6916 |
22 May 15 |
nicklas |
200 |
</tr> |
6916 |
22 May 15 |
nicklas |
201 |
</table> |
6916 |
22 May 15 |
nicklas |
202 |
</div> |
6916 |
22 May 15 |
nicklas |
203 |
|
6916 |
22 May 15 |
nicklas |
204 |
<base:section |
6916 |
22 May 15 |
nicklas |
205 |
id="experimentalFactors" |
6916 |
22 May 15 |
nicklas |
206 |
title="<%="Experimental factors (" + experimentalFactors.size() +")"%>" |
6916 |
22 May 15 |
nicklas |
207 |
context="<%=cc%>" |
6916 |
22 May 15 |
nicklas |
208 |
> |
6916 |
22 May 15 |
nicklas |
209 |
<% |
6916 |
22 May 15 |
nicklas |
210 |
if (experimentalFactors.size() == 0) |
6916 |
22 May 15 |
nicklas |
211 |
{ |
6916 |
22 May 15 |
nicklas |
212 |
%> |
6916 |
22 May 15 |
nicklas |
213 |
<div class="messagecontainer note"> |
6916 |
22 May 15 |
nicklas |
214 |
No experimental factors has been added to this experiment |
6916 |
22 May 15 |
nicklas |
215 |
(or, you don't have permission to view them). |
6916 |
22 May 15 |
nicklas |
216 |
</div> |
6916 |
22 May 15 |
nicklas |
217 |
<% |
6916 |
22 May 15 |
nicklas |
218 |
} |
6916 |
22 May 15 |
nicklas |
219 |
else |
6916 |
22 May 15 |
nicklas |
220 |
{ |
6916 |
22 May 15 |
nicklas |
221 |
%> |
6916 |
22 May 15 |
nicklas |
222 |
<div style="width: 100%; max-width: 1000px;"> |
6916 |
22 May 15 |
nicklas |
223 |
<tbl:table |
6916 |
22 May 15 |
nicklas |
224 |
id="tbl.experimentalFactors" |
6916 |
22 May 15 |
nicklas |
225 |
columns="all" |
6916 |
22 May 15 |
nicklas |
226 |
action="index.jsp" |
6916 |
22 May 15 |
nicklas |
227 |
> |
6916 |
22 May 15 |
nicklas |
228 |
<tbl:hidden name="item_id" value="<%=Integer.toString(itemId)%>" /> |
6916 |
22 May 15 |
nicklas |
229 |
<tbl:columndef |
6916 |
22 May 15 |
nicklas |
230 |
id="name" |
6916 |
22 May 15 |
nicklas |
231 |
title="Name" |
6916 |
22 May 15 |
nicklas |
232 |
/> |
6916 |
22 May 15 |
nicklas |
233 |
<tbl:columndef |
6916 |
22 May 15 |
nicklas |
234 |
id="type" |
6916 |
22 May 15 |
nicklas |
235 |
title="Value type" |
6916 |
22 May 15 |
nicklas |
236 |
/> |
6916 |
22 May 15 |
nicklas |
237 |
<tbl:columndef |
6916 |
22 May 15 |
nicklas |
238 |
id="values" |
6916 |
22 May 15 |
nicklas |
239 |
title="Values" |
6916 |
22 May 15 |
nicklas |
240 |
/> |
6916 |
22 May 15 |
nicklas |
241 |
<tbl:columndef |
6916 |
22 May 15 |
nicklas |
242 |
id="item" |
6942 |
31 Aug 15 |
nicklas |
243 |
title="Parent item" |
6916 |
22 May 15 |
nicklas |
244 |
/> |
6916 |
22 May 15 |
nicklas |
245 |
<tbl:columndef |
6942 |
31 Aug 15 |
nicklas |
246 |
id="note" |
6942 |
31 Aug 15 |
nicklas |
247 |
title="Note" |
6942 |
31 Aug 15 |
nicklas |
248 |
/> |
6962 |
01 Oct 15 |
nicklas |
249 |
<tbl:columndef |
6962 |
01 Oct 15 |
nicklas |
250 |
id="lastModified" |
6962 |
01 Oct 15 |
nicklas |
251 |
title="Last modified" |
6962 |
01 Oct 15 |
nicklas |
252 |
formatter="<%=dateTimeFormatter %>" |
6962 |
01 Oct 15 |
nicklas |
253 |
/> |
6942 |
31 Aug 15 |
nicklas |
254 |
<tbl:columndef |
6916 |
22 May 15 |
nicklas |
255 |
id="description" |
6916 |
22 May 15 |
nicklas |
256 |
title="Description" |
6916 |
22 May 15 |
nicklas |
257 |
/> |
6916 |
22 May 15 |
nicklas |
258 |
<tbl:data> |
6916 |
22 May 15 |
nicklas |
259 |
<tbl:headers> |
6916 |
22 May 15 |
nicklas |
260 |
<tbl:headerrow> |
6916 |
22 May 15 |
nicklas |
261 |
<tbl:columnheaders /> |
6916 |
22 May 15 |
nicklas |
262 |
</tbl:headerrow> |
6916 |
22 May 15 |
nicklas |
263 |
</tbl:headers> |
6916 |
22 May 15 |
nicklas |
264 |
<tbl:rows> |
6916 |
22 May 15 |
nicklas |
265 |
<% |
6916 |
22 May 15 |
nicklas |
266 |
AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(); |
6916 |
22 May 15 |
nicklas |
267 |
for (AnnotationType at : experimentalFactors) |
6916 |
22 May 15 |
nicklas |
268 |
{ |
6916 |
22 May 15 |
nicklas |
269 |
Type valueType = at.getValueType(); |
6916 |
22 May 15 |
nicklas |
270 |
annotationTypeFilter.setAnnotationType(at); |
6916 |
22 May 15 |
nicklas |
271 |
List<AnnotationSnapshot> all = snapshot == null ? |
6916 |
22 May 15 |
nicklas |
272 |
null : manager.findAnnotations(dc, snapshot, annotationTypeFilter, true); |
6942 |
31 Aug 15 |
nicklas |
273 |
|
6942 |
31 Aug 15 |
nicklas |
274 |
List<?> values = null; |
7605 |
26 Feb 19 |
nicklas |
275 |
Formatter<Object> formatter = FormatterFactory.getTypeFormatter(sc, valueType); |
6942 |
31 Aug 15 |
nicklas |
276 |
Nameable parentItem = null; |
6942 |
31 Aug 15 |
nicklas |
277 |
String parentType = ""; |
6916 |
22 May 15 |
nicklas |
278 |
if (all != null && all.size() > 0) |
6916 |
22 May 15 |
nicklas |
279 |
{ |
6916 |
22 May 15 |
nicklas |
280 |
for (AnnotationSnapshot a : all) |
6916 |
22 May 15 |
nicklas |
281 |
{ |
7210 |
19 Oct 16 |
nicklas |
282 |
boolean annotatePermission = a.hasPermission(dc, Permission.WRITE); |
6942 |
31 Aug 15 |
nicklas |
283 |
Unit unit = a.getActualUnit(dc); |
6942 |
31 Aug 15 |
nicklas |
284 |
UnitConverter converter = null; |
6942 |
31 Aug 15 |
nicklas |
285 |
if (unit != null) |
6916 |
22 May 15 |
nicklas |
286 |
{ |
6942 |
31 Aug 15 |
nicklas |
287 |
converter = unit.getUnitConverter(at.getDefaultUnit()); |
6942 |
31 Aug 15 |
nicklas |
288 |
formatter = unit.getFormatter(formatter); |
6916 |
22 May 15 |
nicklas |
289 |
} |
6942 |
31 Aug 15 |
nicklas |
290 |
values = a.getActualValues(converter, valueType); |
6942 |
31 Aug 15 |
nicklas |
291 |
|
6942 |
31 Aug 15 |
nicklas |
292 |
Date lastModified = a.getThisLastUpdate(); |
6962 |
01 Oct 15 |
nicklas |
293 |
boolean isUpToDate = a.isUpToDate(); |
6942 |
31 Aug 15 |
nicklas |
294 |
AnnotationSnapshot inherited = a.getInheritedFrom(); |
6942 |
31 Aug 15 |
nicklas |
295 |
if (inherited != null) |
6916 |
22 May 15 |
nicklas |
296 |
{ |
7603 |
22 Feb 19 |
nicklas |
297 |
parentType = inherited.getThisItemType().toString(); |
6942 |
31 Aug 15 |
nicklas |
298 |
if (lastModified == null) |
6942 |
31 Aug 15 |
nicklas |
299 |
{ |
6942 |
31 Aug 15 |
nicklas |
300 |
lastModified = inherited.getThisLastUpdate(); |
6942 |
31 Aug 15 |
nicklas |
301 |
} |
6916 |
22 May 15 |
nicklas |
302 |
try |
6916 |
22 May 15 |
nicklas |
303 |
{ |
6942 |
31 Aug 15 |
nicklas |
304 |
parentItem = (Nameable)inherited.getThisItem(dc); |
6942 |
31 Aug 15 |
nicklas |
305 |
if (parentItem instanceof Subtypable) |
6942 |
31 Aug 15 |
nicklas |
306 |
{ |
6942 |
31 Aug 15 |
nicklas |
307 |
ItemSubtype subtype = ((Subtypable)parentItem).getItemSubtype(); |
6942 |
31 Aug 15 |
nicklas |
308 |
if (subtype != null) parentType = subtype.getName(); |
6942 |
31 Aug 15 |
nicklas |
309 |
} |
6916 |
22 May 15 |
nicklas |
310 |
} |
6916 |
22 May 15 |
nicklas |
311 |
catch (PermissionDeniedException ex) |
6916 |
22 May 15 |
nicklas |
312 |
{} |
6916 |
22 May 15 |
nicklas |
313 |
} |
6916 |
22 May 15 |
nicklas |
314 |
%> |
6916 |
22 May 15 |
nicklas |
315 |
<tbl:row> |
6916 |
22 May 15 |
nicklas |
316 |
<tbl:cell column="name"><base:icon |
6942 |
31 Aug 15 |
nicklas |
317 |
image="deleted.png" |
6942 |
31 Aug 15 |
nicklas |
318 |
tooltip="This item has been scheduled for deletion" |
6942 |
31 Aug 15 |
nicklas |
319 |
visible="<%=at.isRemoved()%>" |
6916 |
22 May 15 |
nicklas |
320 |
/><%=Base.getLinkedName(ID, at, false, true)%></tbl:cell> |
6916 |
22 May 15 |
nicklas |
321 |
<tbl:cell column="description"><%=HTML.encodeTags(at.getDescription())%></tbl:cell> |
6916 |
22 May 15 |
nicklas |
322 |
<tbl:cell column="type"> |
6916 |
22 May 15 |
nicklas |
323 |
<%=valueType%> |
6916 |
22 May 15 |
nicklas |
324 |
<%=at.isEnumeration() ? "(enumeration)" : ""%> |
6916 |
22 May 15 |
nicklas |
325 |
</tbl:cell> |
6916 |
22 May 15 |
nicklas |
326 |
<tbl:cell column="values"> |
6942 |
31 Aug 15 |
nicklas |
327 |
<%=Values.getString(values, ", ", true, formatter)%> |
6942 |
31 Aug 15 |
nicklas |
328 |
<base:icon id="<%=Integer.toString(a.getThisAnnotationId())%>" |
6962 |
01 Oct 15 |
nicklas |
329 |
image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" |
6962 |
01 Oct 15 |
nicklas |
330 |
subclass="edit-experimental-factor auto-init" |
6962 |
01 Oct 15 |
nicklas |
331 |
data-auto-init="edit-experimental-factor" |
6942 |
31 Aug 15 |
nicklas |
332 |
data-item-type="ROOTRAWBIOASSAY" |
6942 |
31 Aug 15 |
nicklas |
333 |
data-item-id="<%=itemId%>" |
6942 |
31 Aug 15 |
nicklas |
334 |
data-annotation-type-id="<%=at.getId()%>" |
6942 |
31 Aug 15 |
nicklas |
335 |
data-annotation-id="<%=a.getThisAnnotationId()%>" |
7210 |
19 Oct 16 |
nicklas |
336 |
tooltip="Edit this annotation" |
7210 |
19 Oct 16 |
nicklas |
337 |
visible="<%=annotatePermission %>"/> |
6916 |
22 May 15 |
nicklas |
338 |
</tbl:cell> |
6942 |
31 Aug 15 |
nicklas |
339 |
<tbl:cell column="item"> |
6942 |
31 Aug 15 |
nicklas |
340 |
<% |
6942 |
31 Aug 15 |
nicklas |
341 |
if (parentItem != null) |
6942 |
31 Aug 15 |
nicklas |
342 |
{ |
6942 |
31 Aug 15 |
nicklas |
343 |
%> |
6942 |
31 Aug 15 |
nicklas |
344 |
<%=Base.getLinkedName(ID, parentItem, false, true)%> |
6942 |
31 Aug 15 |
nicklas |
345 |
<span class="itemsubtype">(<%=parentType%>)</span> |
6942 |
31 Aug 15 |
nicklas |
346 |
<% |
6942 |
31 Aug 15 |
nicklas |
347 |
} |
6942 |
31 Aug 15 |
nicklas |
348 |
else if (a.getSource() == Annotation.Source.CLONED) |
6942 |
31 Aug 15 |
nicklas |
349 |
{ |
6942 |
31 Aug 15 |
nicklas |
350 |
%> |
6942 |
31 Aug 15 |
nicklas |
351 |
<i>- missing -</i> |
6942 |
31 Aug 15 |
nicklas |
352 |
<% |
6942 |
31 Aug 15 |
nicklas |
353 |
} |
6942 |
31 Aug 15 |
nicklas |
354 |
%> |
6916 |
22 May 15 |
nicklas |
355 |
</tbl:cell> |
6942 |
31 Aug 15 |
nicklas |
356 |
<tbl:cell column="note"><%=a.getSource() == Annotation.Source.CLONED ? "Cloned" + (isUpToDate ? "; up-to-date" : "; modified") : "" %></tbl:cell> |
6962 |
01 Oct 15 |
nicklas |
357 |
<tbl:cell column="lastModified" value="<%=lastModified %>" /> |
6916 |
22 May 15 |
nicklas |
358 |
</tbl:row> |
6916 |
22 May 15 |
nicklas |
359 |
<% |
6916 |
22 May 15 |
nicklas |
360 |
} |
6916 |
22 May 15 |
nicklas |
361 |
} |
6916 |
22 May 15 |
nicklas |
362 |
else |
6916 |
22 May 15 |
nicklas |
363 |
{ |
6916 |
22 May 15 |
nicklas |
364 |
%> |
6916 |
22 May 15 |
nicklas |
365 |
<tbl:row> |
6916 |
22 May 15 |
nicklas |
366 |
<tbl:cell column="name"><base:icon |
6942 |
31 Aug 15 |
nicklas |
367 |
image="deleted.png" |
6942 |
31 Aug 15 |
nicklas |
368 |
tooltip="This item has been scheduled for deletion" |
6942 |
31 Aug 15 |
nicklas |
369 |
visible="<%=at.isRemoved()%>" |
6916 |
22 May 15 |
nicklas |
370 |
/><%=Base.getLinkedName(ID, at, false, true)%></tbl:cell> |
6916 |
22 May 15 |
nicklas |
371 |
<tbl:cell column="description"><%=HTML.encodeTags(at.getDescription())%></tbl:cell> |
6916 |
22 May 15 |
nicklas |
372 |
<tbl:cell column="type"> |
6916 |
22 May 15 |
nicklas |
373 |
<%=valueType%> |
6916 |
22 May 15 |
nicklas |
374 |
<%=at.isEnumeration() ? "(enumeration)" : ""%> |
6916 |
22 May 15 |
nicklas |
375 |
</tbl:cell> |
6916 |
22 May 15 |
nicklas |
376 |
</tbl:row> |
6916 |
22 May 15 |
nicklas |
377 |
<% |
6916 |
22 May 15 |
nicklas |
378 |
} |
6916 |
22 May 15 |
nicklas |
379 |
} |
6916 |
22 May 15 |
nicklas |
380 |
%> |
6916 |
22 May 15 |
nicklas |
381 |
</tbl:rows> |
6916 |
22 May 15 |
nicklas |
382 |
</tbl:data> |
6916 |
22 May 15 |
nicklas |
383 |
</tbl:table> |
6916 |
22 May 15 |
nicklas |
384 |
<div id="warning.missing" style="display: none; text-align: right;"> |
6916 |
22 May 15 |
nicklas |
385 |
<base:icon image="warning.png" /> = Some raw bioassays are missing this factor value |
6916 |
22 May 15 |
nicklas |
386 |
</div> |
6916 |
22 May 15 |
nicklas |
387 |
</div> |
6916 |
22 May 15 |
nicklas |
388 |
<% |
6916 |
22 May 15 |
nicklas |
389 |
} |
6916 |
22 May 15 |
nicklas |
390 |
%> |
6916 |
22 May 15 |
nicklas |
391 |
</base:section> |
6916 |
22 May 15 |
nicklas |
392 |
|
6916 |
22 May 15 |
nicklas |
393 |
</t:tab> |
6916 |
22 May 15 |
nicklas |
394 |
|
6916 |
22 May 15 |
nicklas |
395 |
<t:tab id="annotations" title="Annotations" |
6916 |
22 May 15 |
nicklas |
396 |
tooltip="View annotation values" clazz="white"> |
6916 |
22 May 15 |
nicklas |
397 |
<jsp:include page="../../../common/annotations/list_frameset.jsp"> |
6916 |
22 May 15 |
nicklas |
398 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6916 |
22 May 15 |
nicklas |
399 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6916 |
22 May 15 |
nicklas |
400 |
<jsp:param name="ID" value="<%=ID%>" /> |
6916 |
22 May 15 |
nicklas |
401 |
</jsp:include> |
6916 |
22 May 15 |
nicklas |
402 |
</t:tab> |
6916 |
22 May 15 |
nicklas |
403 |
|
6916 |
22 May 15 |
nicklas |
404 |
</t:tabcontrol> |
6916 |
22 May 15 |
nicklas |
405 |
|
6916 |
22 May 15 |
nicklas |
406 |
</base:body> |
6916 |
22 May 15 |
nicklas |
407 |
</base:page> |
6916 |
22 May 15 |
nicklas |
408 |
<% |
6916 |
22 May 15 |
nicklas |
409 |
} |
6916 |
22 May 15 |
nicklas |
410 |
finally |
6916 |
22 May 15 |
nicklas |
411 |
{ |
6916 |
22 May 15 |
nicklas |
412 |
if (dc != null) dc.close(); |
6916 |
22 May 15 |
nicklas |
413 |
} |
6916 |
22 May 15 |
nicklas |
414 |
%> |