4704 |
11 Dec 08 |
martin |
1 |
<%-- $Id$ |
4704 |
11 Dec 08 |
martin |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
4704 |
11 Dec 08 |
martin |
Copyright (C) 2007 Martin Svensson |
4704 |
11 Dec 08 |
martin |
5 |
|
4704 |
11 Dec 08 |
martin |
6 |
This file is part of BASE - BioArray Software Environment. |
4704 |
11 Dec 08 |
martin |
7 |
Available at http://base.thep.lu.se/ |
4704 |
11 Dec 08 |
martin |
8 |
|
4704 |
11 Dec 08 |
martin |
9 |
BASE is free software; you can redistribute it and/or |
4704 |
11 Dec 08 |
martin |
10 |
modify it under the terms of the GNU General Public License |
4704 |
11 Dec 08 |
martin |
11 |
as published by the Free Software Foundation; either version 3 |
4704 |
11 Dec 08 |
martin |
12 |
of the License, or (at your option) any later version. |
4704 |
11 Dec 08 |
martin |
13 |
|
4704 |
11 Dec 08 |
martin |
14 |
BASE is distributed in the hope that it will be useful, |
4704 |
11 Dec 08 |
martin |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4704 |
11 Dec 08 |
martin |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4704 |
11 Dec 08 |
martin |
17 |
GNU General Public License for more details. |
4704 |
11 Dec 08 |
martin |
18 |
|
4704 |
11 Dec 08 |
martin |
19 |
You should have received a copy of the GNU General Public License |
4704 |
11 Dec 08 |
martin |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4704 |
11 Dec 08 |
martin |
21 |
------------------------------------------------------------------ |
4704 |
11 Dec 08 |
martin |
22 |
|
4704 |
11 Dec 08 |
martin |
23 |
@author Martin |
4704 |
11 Dec 08 |
martin |
24 |
@version 2.10 |
4704 |
11 Dec 08 |
martin |
25 |
--%> |
5426 |
24 Sep 10 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
4704 |
11 Dec 08 |
martin |
27 |
import="net.sf.basedb.core.SessionControl" |
4704 |
11 Dec 08 |
martin |
28 |
import="net.sf.basedb.core.DbControl" |
4704 |
11 Dec 08 |
martin |
29 |
import="net.sf.basedb.core.SystemItems" |
4704 |
11 Dec 08 |
martin |
30 |
import="net.sf.basedb.core.Group" |
4704 |
11 Dec 08 |
martin |
31 |
import="net.sf.basedb.core.Item" |
4704 |
11 Dec 08 |
martin |
32 |
import="net.sf.basedb.core.ItemContext" |
4704 |
11 Dec 08 |
martin |
33 |
import="net.sf.basedb.core.Permission" |
4704 |
11 Dec 08 |
martin |
34 |
import="net.sf.basedb.core.AnnotationType" |
4704 |
11 Dec 08 |
martin |
35 |
import="net.sf.basedb.core.AnnotationSet" |
4704 |
11 Dec 08 |
martin |
36 |
import="net.sf.basedb.core.BioPlate" |
5348 |
20 May 10 |
nicklas |
37 |
import="net.sf.basedb.core.BioWell" |
5348 |
20 May 10 |
nicklas |
38 |
import="net.sf.basedb.core.MeasuredBioMaterial" |
4704 |
11 Dec 08 |
martin |
39 |
import="net.sf.basedb.core.PlateGeometry" |
4704 |
11 Dec 08 |
martin |
40 |
import="net.sf.basedb.core.User" |
4704 |
11 Dec 08 |
martin |
41 |
import="net.sf.basedb.core.ItemQuery" |
4704 |
11 Dec 08 |
martin |
42 |
import="net.sf.basedb.core.Include" |
4704 |
11 Dec 08 |
martin |
43 |
import="net.sf.basedb.core.ItemResultList" |
4704 |
11 Dec 08 |
martin |
44 |
import="net.sf.basedb.core.MultiPermissions" |
4704 |
11 Dec 08 |
martin |
45 |
import="net.sf.basedb.core.PermissionDeniedException" |
4704 |
11 Dec 08 |
martin |
46 |
import="net.sf.basedb.core.PluginDefinition" |
4704 |
11 Dec 08 |
martin |
47 |
import="net.sf.basedb.core.plugin.GuiContext" |
4704 |
11 Dec 08 |
martin |
48 |
import="net.sf.basedb.core.plugin.Plugin" |
4704 |
11 Dec 08 |
martin |
49 |
import="net.sf.basedb.core.Project" |
4704 |
11 Dec 08 |
martin |
50 |
import="net.sf.basedb.core.query.Orders" |
4704 |
11 Dec 08 |
martin |
51 |
import="net.sf.basedb.core.query.Hql" |
4704 |
11 Dec 08 |
martin |
52 |
import="net.sf.basedb.clients.web.Base" |
5050 |
17 Aug 09 |
nicklas |
53 |
import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
4704 |
11 Dec 08 |
martin |
54 |
import="net.sf.basedb.clients.web.PermissionUtil" |
4704 |
11 Dec 08 |
martin |
55 |
import="net.sf.basedb.clients.web.util.HTML" |
4704 |
11 Dec 08 |
martin |
56 |
import="net.sf.basedb.util.Values" |
5324 |
28 Apr 10 |
nicklas |
57 |
import="net.sf.basedb.util.formatter.Formatter" |
5348 |
20 May 10 |
nicklas |
58 |
import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
5324 |
28 Apr 10 |
nicklas |
59 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4882 |
03 Apr 09 |
nicklas |
60 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4882 |
03 Apr 09 |
nicklas |
61 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4882 |
03 Apr 09 |
nicklas |
62 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
63 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
4882 |
03 Apr 09 |
nicklas |
64 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
4882 |
03 Apr 09 |
nicklas |
65 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
4704 |
11 Dec 08 |
martin |
66 |
import="java.util.Collections" |
4704 |
11 Dec 08 |
martin |
67 |
import="java.util.Date" |
4704 |
11 Dec 08 |
martin |
68 |
import="java.util.Map" |
4704 |
11 Dec 08 |
martin |
69 |
import="java.util.Set" |
4704 |
11 Dec 08 |
martin |
70 |
import="java.util.List" |
4704 |
11 Dec 08 |
martin |
71 |
%> |
4704 |
11 Dec 08 |
martin |
72 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4704 |
11 Dec 08 |
martin |
73 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
4704 |
11 Dec 08 |
martin |
74 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
4704 |
11 Dec 08 |
martin |
75 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
4882 |
03 Apr 09 |
nicklas |
76 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
4704 |
11 Dec 08 |
martin |
77 |
<%! |
4704 |
11 Dec 08 |
martin |
78 |
private static final Item itemType = Item.BIOPLATE; |
4704 |
11 Dec 08 |
martin |
79 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
4704 |
11 Dec 08 |
martin |
80 |
%> |
4704 |
11 Dec 08 |
martin |
81 |
<% |
4704 |
11 Dec 08 |
martin |
82 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4704 |
11 Dec 08 |
martin |
83 |
final String ID = sc.getId(); |
4704 |
11 Dec 08 |
martin |
84 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
4704 |
11 Dec 08 |
martin |
85 |
final int itemId = cc.getId(); |
6261 |
27 Mar 13 |
nicklas |
86 |
final String tab = Values.getStringOrNull(request.getParameter("tab")); |
4704 |
11 Dec 08 |
martin |
87 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
88 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
4704 |
11 Dec 08 |
martin |
89 |
try |
4704 |
11 Dec 08 |
martin |
90 |
{ |
4704 |
11 Dec 08 |
martin |
91 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
4704 |
11 Dec 08 |
martin |
92 |
|
4704 |
11 Dec 08 |
martin |
93 |
String title = null; |
4704 |
11 Dec 08 |
martin |
94 |
BioPlate bioplate = BioPlate.getById(dc, itemId); |
5549 |
26 Jan 11 |
nicklas |
95 |
Item bioMaterialType = bioplate.getBioPlateType().getBioMaterialType(); |
5348 |
20 May 10 |
nicklas |
96 |
PlateGeometry geometry = bioplate.getPlateGeometry(); |
4704 |
11 Dec 08 |
martin |
97 |
|
4704 |
11 Dec 08 |
martin |
98 |
final boolean writePermission = bioplate.hasPermission(Permission.WRITE); |
4704 |
11 Dec 08 |
martin |
99 |
final boolean deletePermission = bioplate.hasPermission(Permission.DELETE); |
4704 |
11 Dec 08 |
martin |
100 |
final boolean sharePermission = bioplate.hasPermission(Permission.SET_PERMISSION); |
4704 |
11 Dec 08 |
martin |
101 |
final boolean setOwnerPermission = bioplate.hasPermission(Permission.SET_OWNER); |
4704 |
11 Dec 08 |
martin |
102 |
final boolean isRemoved = bioplate.isRemoved(); |
4704 |
11 Dec 08 |
martin |
103 |
final boolean isUsed = isRemoved && bioplate.isUsed(); |
4704 |
11 Dec 08 |
martin |
104 |
final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
4704 |
11 Dec 08 |
martin |
105 |
final boolean isOwner = bioplate.isOwner(); |
4882 |
03 Apr 09 |
nicklas |
106 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioplate); |
7604 |
25 Feb 19 |
nicklas |
107 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
5324 |
28 Apr 10 |
nicklas |
108 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
4704 |
11 Dec 08 |
martin |
109 |
%> |
6261 |
27 Mar 13 |
nicklas |
110 |
<base:page title="<%=title%>" id="view-page"> |
6261 |
27 Mar 13 |
nicklas |
111 |
<base:head scripts="tabcontrol-2.js,table.js,~bioplates.js" |
5348 |
20 May 10 |
nicklas |
112 |
styles="toolbar.css,table.css,headertabcontrol.css,path.css,plate.css"> |
4882 |
03 Apr 09 |
nicklas |
113 |
<ext:scripts context="<%=jspContext%>" /> |
4882 |
03 Apr 09 |
nicklas |
114 |
<ext:stylesheets context="<%=jspContext%>" /> |
4704 |
11 Dec 08 |
martin |
115 |
</base:head> |
6192 |
31 Oct 12 |
nicklas |
116 |
<base:body> |
5937 |
27 Jan 12 |
nicklas |
117 |
<p:path><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
118 |
title="Bioplates" href="<%="index.jsp?ID="+ID%>" /><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
119 |
title="<%=HTML.encodeTags(bioplate.getName())%>" /></p:path> |
6261 |
27 Mar 13 |
nicklas |
120 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
4704 |
11 Dec 08 |
martin |
121 |
|
5937 |
27 Jan 12 |
nicklas |
122 |
<t:tabcontrol id="main" |
5937 |
27 Jan 12 |
nicklas |
123 |
subclass="content mastertabcontrol" |
6261 |
27 Mar 13 |
nicklas |
124 |
active="<%=tab%>"> |
4704 |
11 Dec 08 |
martin |
125 |
<t:tab id="properties" title="Properties"> |
5937 |
27 Jan 12 |
nicklas |
126 |
<div> |
6611 |
20 Nov 14 |
nicklas |
127 |
<table class="fullform bottomborder"> |
5937 |
27 Jan 12 |
nicklas |
128 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
129 |
<th class="itemstatus"> |
4704 |
11 Dec 08 |
martin |
130 |
<base:icon |
5946 |
03 Feb 12 |
nicklas |
131 |
image="shared.png" |
5937 |
27 Jan 12 |
nicklas |
132 |
visible="<%=bioplate.isShared()%>" |
5937 |
27 Jan 12 |
nicklas |
133 |
tooltip="This item is shared to other users, groups and/or projects" |
5937 |
27 Jan 12 |
nicklas |
134 |
/> |
5937 |
27 Jan 12 |
nicklas |
135 |
<base:icon |
6261 |
27 Mar 13 |
nicklas |
136 |
id="btnDeletePermanently" |
5946 |
03 Feb 12 |
nicklas |
137 |
image="deleted.png" |
5937 |
27 Jan 12 |
nicklas |
138 |
tooltip="This item has been flagged for deletion. Click to delete it now." |
5937 |
27 Jan 12 |
nicklas |
139 |
enabled="<%=deletePermanentlyPermission %>" |
5937 |
27 Jan 12 |
nicklas |
140 |
visible="<%=isRemoved%>" |
5937 |
27 Jan 12 |
nicklas |
141 |
/> |
6261 |
27 Mar 13 |
nicklas |
142 |
<base:icon |
6261 |
27 Mar 13 |
nicklas |
143 |
id="btnUsingItems" |
6261 |
27 Mar 13 |
nicklas |
144 |
image="used.png" |
5937 |
27 Jan 12 |
nicklas |
145 |
tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" |
5937 |
27 Jan 12 |
nicklas |
146 |
visible="<%=isRemoved && isUsed%>" /> |
5937 |
27 Jan 12 |
nicklas |
147 |
</th> |
6611 |
20 Nov 14 |
nicklas |
148 |
<td style="padding: 0px;" colspan="2"> |
6605 |
18 Nov 14 |
nicklas |
149 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5937 |
27 Jan 12 |
nicklas |
150 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
151 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
152 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
153 |
image="edit.png" |
5937 |
27 Jan 12 |
nicklas |
154 |
title="Edit…" |
5937 |
27 Jan 12 |
nicklas |
155 |
tooltip="<%=writePermission ? "Edit this bioplate" : "You do not have permission to edit this bioplate"%>" |
5937 |
27 Jan 12 |
nicklas |
156 |
/> |
5937 |
27 Jan 12 |
nicklas |
157 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
158 |
id="btnDelete" |
5942 |
01 Feb 12 |
nicklas |
159 |
disabled="<%=!deletePermission%>" |
5946 |
03 Feb 12 |
nicklas |
160 |
image="delete.png" |
5937 |
27 Jan 12 |
nicklas |
161 |
title="Delete" |
5937 |
27 Jan 12 |
nicklas |
162 |
visible="<%=!bioplate.isRemoved()%>" |
5937 |
27 Jan 12 |
nicklas |
163 |
tooltip="<%=deletePermission ? "Delete this bioplate" : "You do not have permission to delete this bioplate"%>" |
5937 |
27 Jan 12 |
nicklas |
164 |
/> |
5937 |
27 Jan 12 |
nicklas |
165 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
166 |
id="btnRestore" |
5942 |
01 Feb 12 |
nicklas |
167 |
disabled="<%=!writePermission%>" |
5946 |
03 Feb 12 |
nicklas |
168 |
image="restore.png" |
5937 |
27 Jan 12 |
nicklas |
169 |
title="Restore" |
5937 |
27 Jan 12 |
nicklas |
170 |
visible="<%=bioplate.isRemoved()%>" |
5937 |
27 Jan 12 |
nicklas |
171 |
tooltip="<%=writePermission ? "Restore this bioplate" : "You do not have permission to restore this bioplate"%>" |
5937 |
27 Jan 12 |
nicklas |
172 |
/> |
5937 |
27 Jan 12 |
nicklas |
173 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
174 |
id="btnShare" |
5942 |
01 Feb 12 |
nicklas |
175 |
disabled="<%=!sharePermission%>" |
5945 |
02 Feb 12 |
nicklas |
176 |
image="share.png" |
5937 |
27 Jan 12 |
nicklas |
177 |
title="Share…" |
5937 |
27 Jan 12 |
nicklas |
178 |
tooltip="<%=sharePermission ? "Share this bioplate to other user, groups and projects" : "You do not have permission to share this bioplate"%>" |
5937 |
27 Jan 12 |
nicklas |
179 |
/> |
5937 |
27 Jan 12 |
nicklas |
180 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
181 |
id="btnSetOwner" |
5942 |
01 Feb 12 |
nicklas |
182 |
disabled="<%=!setOwnerPermission%>" |
5937 |
27 Jan 12 |
nicklas |
183 |
image="take_ownership.png" |
5937 |
27 Jan 12 |
nicklas |
184 |
title="Set owner…" |
5937 |
27 Jan 12 |
nicklas |
185 |
tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" |
5937 |
27 Jan 12 |
nicklas |
186 |
/> |
5937 |
27 Jan 12 |
nicklas |
187 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
188 |
id="btnMoveBioMaterial" |
5937 |
27 Jan 12 |
nicklas |
189 |
image="move_to_plate.png" |
5937 |
27 Jan 12 |
nicklas |
190 |
title="Move biomaterial…" |
5937 |
27 Jan 12 |
nicklas |
191 |
tooltip="Move biomaterial on this plate to another plate" |
5937 |
27 Jan 12 |
nicklas |
192 |
/> |
5937 |
27 Jan 12 |
nicklas |
193 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
194 |
id="btnCreateChildBioPlate" |
5937 |
27 Jan 12 |
nicklas |
195 |
image="add.png" |
5937 |
27 Jan 12 |
nicklas |
196 |
title="<%="Create child bioplate" + (bioMaterialType == Item.EXTRACT ? "/bioassay" : "") +"…"%>" |
5937 |
27 Jan 12 |
nicklas |
197 |
tooltip="Create one or more child biomaterial plates" |
5937 |
27 Jan 12 |
nicklas |
198 |
visible="<%=bioMaterialType != null%>" |
5937 |
27 Jan 12 |
nicklas |
199 |
/> |
5937 |
27 Jan 12 |
nicklas |
200 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
201 |
id="btnImport" |
5946 |
03 Feb 12 |
nicklas |
202 |
image="import.png" |
6261 |
27 Mar 13 |
nicklas |
203 |
data-plugin-type="IMPORT" |
5937 |
27 Jan 12 |
nicklas |
204 |
title="Import…" |
5937 |
27 Jan 12 |
nicklas |
205 |
tooltip="Import data" |
5937 |
27 Jan 12 |
nicklas |
206 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
5937 |
27 Jan 12 |
nicklas |
207 |
/> |
5937 |
27 Jan 12 |
nicklas |
208 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
209 |
id="btnExport" |
6261 |
27 Mar 13 |
nicklas |
210 |
image="export.png" |
6261 |
27 Mar 13 |
nicklas |
211 |
data-plugin-type="EXPORT" |
5937 |
27 Jan 12 |
nicklas |
212 |
title="Export…" |
5937 |
27 Jan 12 |
nicklas |
213 |
tooltip="Export data" |
5937 |
27 Jan 12 |
nicklas |
214 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5937 |
27 Jan 12 |
nicklas |
215 |
/> |
5937 |
27 Jan 12 |
nicklas |
216 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
217 |
id="btnRunPlugin" |
6261 |
27 Mar 13 |
nicklas |
218 |
image="runplugin.png" |
6261 |
27 Mar 13 |
nicklas |
219 |
data-plugin-type="OTHER" |
5937 |
27 Jan 12 |
nicklas |
220 |
title="Run plugin…" |
5937 |
27 Jan 12 |
nicklas |
221 |
tooltip="Run a plugin" |
5937 |
27 Jan 12 |
nicklas |
222 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5937 |
27 Jan 12 |
nicklas |
223 |
/> |
5937 |
27 Jan 12 |
nicklas |
224 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
225 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5937 |
27 Jan 12 |
nicklas |
226 |
<tbl:button |
5937 |
27 Jan 12 |
nicklas |
227 |
image="help.png" |
6261 |
27 Mar 13 |
nicklas |
228 |
subclass="auto-init" |
6261 |
27 Mar 13 |
nicklas |
229 |
data-auto-init="help" |
6261 |
27 Mar 13 |
nicklas |
230 |
data-help-id="plate.view.properties" |
5937 |
27 Jan 12 |
nicklas |
231 |
title="Help…" |
5937 |
27 Jan 12 |
nicklas |
232 |
tooltip="Get help about this page" |
5937 |
27 Jan 12 |
nicklas |
233 |
/> |
5937 |
27 Jan 12 |
nicklas |
234 |
</tbl:toolbar> |
5937 |
27 Jan 12 |
nicklas |
235 |
</td> |
5937 |
27 Jan 12 |
nicklas |
236 |
</tr> |
4704 |
11 Dec 08 |
martin |
237 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
238 |
<th>Name</th> |
4704 |
11 Dec 08 |
martin |
239 |
<td><%=HTML.encodeTags(bioplate.getName())%></td> |
6611 |
20 Nov 14 |
nicklas |
240 |
<td rowspan="12" style="width: 50%; vertical-align: top;"> |
6611 |
20 Nov 14 |
nicklas |
241 |
|
6611 |
20 Nov 14 |
nicklas |
242 |
<table class="plate" style="margin-top: 1em;" id="bioplate"> |
5348 |
20 May 10 |
nicklas |
243 |
<% |
5348 |
20 May 10 |
nicklas |
244 |
int columns = geometry.getColumns(); |
5348 |
20 May 10 |
nicklas |
245 |
int rows = geometry.getRows(); |
5348 |
20 May 10 |
nicklas |
246 |
WellCoordinateFormatter rowF = new WellCoordinateFormatter(true); |
5348 |
20 May 10 |
nicklas |
247 |
WellCoordinateFormatter colF = new WellCoordinateFormatter(false); |
5348 |
20 May 10 |
nicklas |
248 |
%> |
6615 |
24 Nov 14 |
nicklas |
249 |
<tr> |
6615 |
24 Nov 14 |
nicklas |
250 |
<td class="bg-filled-100"> |
6615 |
24 Nov 14 |
nicklas |
251 |
<div class="notify" id="wellInfo" style="display:none; width: 20em; min-height: 3em;"></div> |
6615 |
24 Nov 14 |
nicklas |
252 |
</td> |
5348 |
20 May 10 |
nicklas |
253 |
<% |
5348 |
20 May 10 |
nicklas |
254 |
for (int c = 0; c < columns; ++c) |
5348 |
20 May 10 |
nicklas |
255 |
{ |
5348 |
20 May 10 |
nicklas |
256 |
%> |
6611 |
20 Nov 14 |
nicklas |
257 |
<td class="columnheader bg-filled-100"><%=colF.format(c)%></td> |
5348 |
20 May 10 |
nicklas |
258 |
<% |
5348 |
20 May 10 |
nicklas |
259 |
} |
5348 |
20 May 10 |
nicklas |
260 |
%> |
5348 |
20 May 10 |
nicklas |
261 |
</tr> |
5348 |
20 May 10 |
nicklas |
262 |
<% |
5348 |
20 May 10 |
nicklas |
263 |
for (int r = 0; r < rows; ++r) |
5348 |
20 May 10 |
nicklas |
264 |
{ |
5348 |
20 May 10 |
nicklas |
265 |
String row = rowF.format(r); |
5348 |
20 May 10 |
nicklas |
266 |
%> |
6611 |
20 Nov 14 |
nicklas |
267 |
<tr><td class="rowheader bg-filled-100"><%=row%></td> |
5348 |
20 May 10 |
nicklas |
268 |
<% |
5348 |
20 May 10 |
nicklas |
269 |
for (int c = 0; c < columns; ++c) |
5348 |
20 May 10 |
nicklas |
270 |
{ |
5348 |
20 May 10 |
nicklas |
271 |
BioWell well = bioplate.getBioWell(r, c); |
5937 |
27 Jan 12 |
nicklas |
272 |
if (well == null) continue; |
5348 |
20 May 10 |
nicklas |
273 |
boolean isEmpty = well.isEmpty(); |
5459 |
29 Oct 10 |
nicklas |
274 |
boolean hasBeenUsed = well.hasBeenUsed(); |
5459 |
29 Oct 10 |
nicklas |
275 |
boolean canAddBioMaterial = well.canAddBioMaterial(); |
5459 |
29 Oct 10 |
nicklas |
276 |
boolean canClearBioMaterial = well.canClearBioMaterial(); |
5538 |
11 Jan 11 |
nicklas |
277 |
boolean usePermission = well.hasPermission(Permission.USE); |
5538 |
11 Jan 11 |
nicklas |
278 |
|
5538 |
11 Jan 11 |
nicklas |
279 |
boolean deniedBioMaterial = false; |
6261 |
27 Mar 13 |
nicklas |
280 |
boolean allowEdit = false; |
6261 |
27 Mar 13 |
nicklas |
281 |
boolean showInfo = false; |
5538 |
11 Jan 11 |
nicklas |
282 |
|
6261 |
27 Mar 13 |
nicklas |
283 |
String cls = "well auto-init"; |
5348 |
20 May 10 |
nicklas |
284 |
String tooltip = ""; |
5538 |
11 Jan 11 |
nicklas |
285 |
if (isEmpty) |
5348 |
20 May 10 |
nicklas |
286 |
{ |
5348 |
20 May 10 |
nicklas |
287 |
cls += " empty"; |
5538 |
11 Jan 11 |
nicklas |
288 |
if (usePermission && canAddBioMaterial) |
5348 |
20 May 10 |
nicklas |
289 |
{ |
5538 |
11 Jan 11 |
nicklas |
290 |
// The used is allowed to add biomaterial to the empty well |
5538 |
11 Jan 11 |
nicklas |
291 |
cls += " editable"; |
6261 |
27 Mar 13 |
nicklas |
292 |
allowEdit = true; |
5348 |
20 May 10 |
nicklas |
293 |
tooltip = "Add biomaterial to this well"; |
5348 |
20 May 10 |
nicklas |
294 |
} |
5538 |
11 Jan 11 |
nicklas |
295 |
else if (hasBeenUsed) |
5459 |
29 Oct 10 |
nicklas |
296 |
{ |
5538 |
11 Jan 11 |
nicklas |
297 |
// The well has been used and it is not allowed to add biomaterial |
5927 |
16 Jan 12 |
nicklas |
298 |
cls += " wasused"; |
6261 |
27 Mar 13 |
nicklas |
299 |
showInfo = true; |
5538 |
11 Jan 11 |
nicklas |
300 |
tooltip = "This well has already been used"; |
5459 |
29 Oct 10 |
nicklas |
301 |
} |
5348 |
20 May 10 |
nicklas |
302 |
else |
5348 |
20 May 10 |
nicklas |
303 |
{ |
5538 |
11 Jan 11 |
nicklas |
304 |
// The user doesn't have permission to add biomaterial |
5538 |
11 Jan 11 |
nicklas |
305 |
cls += " locked"; |
5538 |
11 Jan 11 |
nicklas |
306 |
tooltip = "You are not allowed to add biomaterial to this well"; |
5348 |
20 May 10 |
nicklas |
307 |
} |
5348 |
20 May 10 |
nicklas |
308 |
} |
5348 |
20 May 10 |
nicklas |
309 |
else |
5348 |
20 May 10 |
nicklas |
310 |
{ |
5927 |
16 Jan 12 |
nicklas |
311 |
cls += " used"; |
5538 |
11 Jan 11 |
nicklas |
312 |
try |
5348 |
20 May 10 |
nicklas |
313 |
{ |
5538 |
11 Jan 11 |
nicklas |
314 |
MeasuredBioMaterial bioMaterial = well.getBioMaterial(); |
6261 |
27 Mar 13 |
nicklas |
315 |
showInfo = true; |
5538 |
11 Jan 11 |
nicklas |
316 |
if (usePermission && canClearBioMaterial && bioMaterial.hasPermission(Permission.WRITE)) |
5538 |
11 Jan 11 |
nicklas |
317 |
{ |
5538 |
11 Jan 11 |
nicklas |
318 |
// The user is allowed to replace/remove the biomaterial in the well |
5538 |
11 Jan 11 |
nicklas |
319 |
cls += " editable"; |
6261 |
27 Mar 13 |
nicklas |
320 |
allowEdit = true; |
5538 |
11 Jan 11 |
nicklas |
321 |
if (canAddBioMaterial) |
5538 |
11 Jan 11 |
nicklas |
322 |
{ |
5538 |
11 Jan 11 |
nicklas |
323 |
// Replace and/or remove |
5538 |
11 Jan 11 |
nicklas |
324 |
tooltip = "Change biomaterial in this well"; |
5538 |
11 Jan 11 |
nicklas |
325 |
} |
5538 |
11 Jan 11 |
nicklas |
326 |
else |
5538 |
11 Jan 11 |
nicklas |
327 |
{ |
5538 |
11 Jan 11 |
nicklas |
328 |
// Remove only |
5538 |
11 Jan 11 |
nicklas |
329 |
tooltip = "Remove the biomaterial from this well"; |
5538 |
11 Jan 11 |
nicklas |
330 |
} |
5538 |
11 Jan 11 |
nicklas |
331 |
} |
5538 |
11 Jan 11 |
nicklas |
332 |
else |
5538 |
11 Jan 11 |
nicklas |
333 |
{ |
5538 |
11 Jan 11 |
nicklas |
334 |
cls += " locked"; |
5538 |
11 Jan 11 |
nicklas |
335 |
tooltip = "This well is locked for modifications"; |
5538 |
11 Jan 11 |
nicklas |
336 |
} |
5348 |
20 May 10 |
nicklas |
337 |
} |
5538 |
11 Jan 11 |
nicklas |
338 |
catch (PermissionDeniedException ex) |
5459 |
29 Oct 10 |
nicklas |
339 |
{ |
5538 |
11 Jan 11 |
nicklas |
340 |
cls += " denied"; |
5538 |
11 Jan 11 |
nicklas |
341 |
tooltip = "Access denied"; |
5459 |
29 Oct 10 |
nicklas |
342 |
} |
5348 |
20 May 10 |
nicklas |
343 |
} |
5348 |
20 May 10 |
nicklas |
344 |
%> |
6261 |
27 Mar 13 |
nicklas |
345 |
<td class="<%=cls%>" |
6261 |
27 Mar 13 |
nicklas |
346 |
id="well.<%=well.getId()%>" |
6261 |
27 Mar 13 |
nicklas |
347 |
data-auto-init="well" |
6261 |
27 Mar 13 |
nicklas |
348 |
data-allow-edit="<%=allowEdit ? 1 : 0 %>" |
6261 |
27 Mar 13 |
nicklas |
349 |
data-show-info="<%=showInfo ? 1 : 0 %>" |
6261 |
27 Mar 13 |
nicklas |
350 |
data-item-id="<%=well.getId()%>" |
6261 |
27 Mar 13 |
nicklas |
351 |
data-coordinate="<%=well.getCoordinate()%>" |
5348 |
20 May 10 |
nicklas |
352 |
title="<%=tooltip%>"></td> |
5348 |
20 May 10 |
nicklas |
353 |
<% |
5348 |
20 May 10 |
nicklas |
354 |
} |
5348 |
20 May 10 |
nicklas |
355 |
%> |
5348 |
20 May 10 |
nicklas |
356 |
</tr> |
5348 |
20 May 10 |
nicklas |
357 |
<% |
5348 |
20 May 10 |
nicklas |
358 |
} |
5348 |
20 May 10 |
nicklas |
359 |
%> |
5348 |
20 May 10 |
nicklas |
360 |
</table> |
6611 |
20 Nov 14 |
nicklas |
361 |
|
6611 |
20 Nov 14 |
nicklas |
362 |
|
6611 |
20 Nov 14 |
nicklas |
363 |
</td> |
6611 |
20 Nov 14 |
nicklas |
364 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
365 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
366 |
<th>Barcode</th> |
6611 |
20 Nov 14 |
nicklas |
367 |
<td><%=HTML.encodeTags(bioplate.getBarcode())%></td> |
6611 |
20 Nov 14 |
nicklas |
368 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
369 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
370 |
<th>Created</th> |
6611 |
20 Nov 14 |
nicklas |
371 |
<td><%=dateFormatter.format(bioplate.getEventDate())%></td> |
6611 |
20 Nov 14 |
nicklas |
372 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
373 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
374 |
<th>Registered</th> |
6611 |
20 Nov 14 |
nicklas |
375 |
<td><%=dateFormatter.format(bioplate.getEntryDate())%></td> |
6611 |
20 Nov 14 |
nicklas |
376 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
377 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
378 |
<th>Destroyed</th> |
6611 |
20 Nov 14 |
nicklas |
379 |
<td><%=bioplate.isDestroyed() ? "yes" : "no"%></td> |
6611 |
20 Nov 14 |
nicklas |
380 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
381 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
382 |
<th>Bioplate type</th> |
6611 |
20 Nov 14 |
nicklas |
383 |
<td><base:propertyvalue item="<%=bioplate%>" property="bioPlateType" /></td> |
6611 |
20 Nov 14 |
nicklas |
384 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
385 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
386 |
<th>Geometry</th> |
6611 |
20 Nov 14 |
nicklas |
387 |
<td><base:propertyvalue item="<%=bioplate%>" property="plateGeometry" /></td> |
6611 |
20 Nov 14 |
nicklas |
388 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
389 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
390 |
<th>Free (total) wells</th> |
6611 |
20 Nov 14 |
nicklas |
391 |
<td><%=bioplate.getFreeWells()%> (<%=bioplate.getTotalWells()%>)</td> |
6611 |
20 Nov 14 |
nicklas |
392 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
393 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
394 |
<th>Storage location</th> |
6611 |
20 Nov 14 |
nicklas |
395 |
<td><base:propertyvalue item="<%=bioplate%>" property="freezer" /></td> |
6611 |
20 Nov 14 |
nicklas |
396 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
397 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
398 |
<th class="subprompt"></th> |
6611 |
20 Nov 14 |
nicklas |
399 |
<td> |
6611 |
20 Nov 14 |
nicklas |
400 |
<b>Section</b>: <%=HTML.encodeTags(Values.getString(bioplate.getSection(), "-")) %>; |
6611 |
20 Nov 14 |
nicklas |
401 |
<b>Tray</b>: <%=HTML.encodeTags(Values.getString(bioplate.getTray(), "-")) %>; |
6611 |
20 Nov 14 |
nicklas |
402 |
<b>Position</b>: <%=HTML.encodeTags(Values.getString(bioplate.getPosition(), "-")) %> |
6611 |
20 Nov 14 |
nicklas |
403 |
</td> |
6611 |
20 Nov 14 |
nicklas |
404 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
405 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
406 |
<th>Owner</th> |
6611 |
20 Nov 14 |
nicklas |
407 |
<td><base:propertyvalue item="<%=bioplate%>" property="owner" /></td> |
6611 |
20 Nov 14 |
nicklas |
408 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
409 |
<tr> |
6611 |
20 Nov 14 |
nicklas |
410 |
<th>Permissions</th> |
6611 |
20 Nov 14 |
nicklas |
411 |
<td><%=PermissionUtil.getFullPermissionNames(bioplate)%></td> |
6611 |
20 Nov 14 |
nicklas |
412 |
</tr> |
6611 |
20 Nov 14 |
nicklas |
413 |
<tr class="dynamic"> |
6611 |
20 Nov 14 |
nicklas |
414 |
<th>Description</th> |
6611 |
20 Nov 14 |
nicklas |
415 |
<td><%=HTML.niceFormat(bioplate.getDescription())%></td> |
6611 |
20 Nov 14 |
nicklas |
416 |
</tr> |
5937 |
27 Jan 12 |
nicklas |
417 |
</table> |
5937 |
27 Jan 12 |
nicklas |
418 |
</div> |
5937 |
27 Jan 12 |
nicklas |
419 |
|
6611 |
20 Nov 14 |
nicklas |
420 |
<jsp:include page="../../common/anytoany/list_anytoany.jsp"> |
6611 |
20 Nov 14 |
nicklas |
421 |
<jsp:param name="ID" value="<%=ID%>" /> |
6611 |
20 Nov 14 |
nicklas |
422 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6611 |
20 Nov 14 |
nicklas |
423 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6611 |
20 Nov 14 |
nicklas |
424 |
<jsp:param name="title" value="Other items related to this bioplate" /> |
6611 |
20 Nov 14 |
nicklas |
425 |
</jsp:include> |
6611 |
20 Nov 14 |
nicklas |
426 |
<jsp:include page="../../common/share/list_share.jsp"> |
6611 |
20 Nov 14 |
nicklas |
427 |
<jsp:param name="ID" value="<%=ID%>" /> |
6611 |
20 Nov 14 |
nicklas |
428 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6611 |
20 Nov 14 |
nicklas |
429 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6611 |
20 Nov 14 |
nicklas |
430 |
<jsp:param name="title" value="Shared to" /> |
6611 |
20 Nov 14 |
nicklas |
431 |
</jsp:include> |
4704 |
11 Dec 08 |
martin |
432 |
</t:tab> |
4704 |
11 Dec 08 |
martin |
433 |
|
5935 |
26 Jan 12 |
nicklas |
434 |
<t:tab id="annotations" title="Annotations" |
6261 |
27 Mar 13 |
nicklas |
435 |
tooltip="View annotation values" clazz="white"> |
6255 |
22 Mar 13 |
nicklas |
436 |
<jsp:include page="../../common/annotations/list_frameset.jsp"> |
4704 |
11 Dec 08 |
martin |
437 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
4704 |
11 Dec 08 |
martin |
438 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
4704 |
11 Dec 08 |
martin |
439 |
<jsp:param name="ID" value="<%=ID%>" /> |
4704 |
11 Dec 08 |
martin |
440 |
</jsp:include> |
4704 |
11 Dec 08 |
martin |
441 |
</t:tab> |
5935 |
26 Jan 12 |
nicklas |
442 |
|
4704 |
11 Dec 08 |
martin |
443 |
<t:tab id="wells" title="Wells" /> |
5525 |
06 Dec 10 |
nicklas |
444 |
<t:tab id="events" title="Plate events" /> |
6041 |
02 Apr 12 |
nicklas |
445 |
<t:tab id="overview" title="Overview" |
6261 |
27 Mar 13 |
nicklas |
446 |
tooltip="Display a tree overview of related items"> |
6242 |
25 Feb 13 |
nicklas |
447 |
<jsp:include page="../../common/overview/overview.jsp"> |
6242 |
25 Feb 13 |
nicklas |
448 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6242 |
25 Feb 13 |
nicklas |
449 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6242 |
25 Feb 13 |
nicklas |
450 |
<jsp:param name="ID" value="<%=ID%>" /> |
6242 |
25 Feb 13 |
nicklas |
451 |
</jsp:include> |
6041 |
02 Apr 12 |
nicklas |
452 |
</t:tab> |
7166 |
07 Jun 16 |
nicklas |
453 |
<t:tab id="history" title="History" |
7166 |
07 Jun 16 |
nicklas |
454 |
tooltip="Displays a log with the history of this item" |
6261 |
27 Mar 13 |
nicklas |
455 |
visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> |
6244 |
25 Feb 13 |
nicklas |
456 |
<jsp:include page="../../common/history/frameset.jsp"> |
6244 |
25 Feb 13 |
nicklas |
457 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6244 |
25 Feb 13 |
nicklas |
458 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6244 |
25 Feb 13 |
nicklas |
459 |
<jsp:param name="ID" value="<%=ID%>" /> |
6244 |
25 Feb 13 |
nicklas |
460 |
</jsp:include> |
5050 |
17 Aug 09 |
nicklas |
461 |
</t:tab> |
5937 |
27 Jan 12 |
nicklas |
462 |
</t:tabcontrol> |
5937 |
27 Jan 12 |
nicklas |
463 |
|
4704 |
11 Dec 08 |
martin |
464 |
</base:body> |
4704 |
11 Dec 08 |
martin |
465 |
</base:page> |
4704 |
11 Dec 08 |
martin |
466 |
<% |
4704 |
11 Dec 08 |
martin |
467 |
} |
4704 |
11 Dec 08 |
martin |
468 |
finally |
4704 |
11 Dec 08 |
martin |
469 |
{ |
4704 |
11 Dec 08 |
martin |
470 |
if (dc != null) dc.close(); |
4704 |
11 Dec 08 |
martin |
471 |
} |
4704 |
11 Dec 08 |
martin |
472 |
%> |