1 | <%-- $Id $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2011 Nicklas Nordborg |
---|
4 | |
---|
5 | This file is part of BASE - BioArray Software Environment. |
---|
6 | Available at http://base.thep.lu.se/ |
---|
7 | |
---|
8 | BASE is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License |
---|
10 | as published by the Free Software Foundation; either version 3 |
---|
11 | of the License, or (at your option) any later version. |
---|
12 | |
---|
13 | BASE is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | GNU General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | ------------------------------------------------------------------ |
---|
21 | |
---|
22 | --%> |
---|
23 | <%@page import="net.sf.basedb.core.RawBioAssay"%> |
---|
24 | <%@ page pageEncoding="UTF-8" session="false" |
---|
25 | import="net.sf.basedb.core.SessionControl" |
---|
26 | import="net.sf.basedb.core.DbControl" |
---|
27 | import="net.sf.basedb.core.DerivedBioAssay" |
---|
28 | import="net.sf.basedb.core.PhysicalBioAssay" |
---|
29 | import="net.sf.basedb.core.Item" |
---|
30 | import="net.sf.basedb.core.ItemContext" |
---|
31 | import="net.sf.basedb.core.Permission" |
---|
32 | import="net.sf.basedb.core.Job" |
---|
33 | import="net.sf.basedb.core.PluginDefinition" |
---|
34 | import="net.sf.basedb.core.PluginConfiguration" |
---|
35 | import="net.sf.basedb.core.User" |
---|
36 | import="net.sf.basedb.core.ItemQuery" |
---|
37 | import="net.sf.basedb.core.ItemResultList" |
---|
38 | import="net.sf.basedb.core.Include" |
---|
39 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
40 | import="net.sf.basedb.core.PluginDefinition" |
---|
41 | import="net.sf.basedb.core.ParameterInfo" |
---|
42 | import="net.sf.basedb.core.RawDataType" |
---|
43 | import="net.sf.basedb.core.BasicItem" |
---|
44 | import="net.sf.basedb.core.Nameable" |
---|
45 | import="net.sf.basedb.core.File" |
---|
46 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
47 | import="net.sf.basedb.core.plugin.Plugin" |
---|
48 | import="net.sf.basedb.core.query.Orders" |
---|
49 | import="net.sf.basedb.core.query.Hql" |
---|
50 | import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
---|
51 | import="net.sf.basedb.clients.web.Base" |
---|
52 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
53 | import="net.sf.basedb.clients.web.util.HTML" |
---|
54 | import="net.sf.basedb.util.Values" |
---|
55 | import="net.sf.basedb.util.formatter.Formatter" |
---|
56 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
57 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
58 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
59 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
60 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
61 | import="net.sf.basedb.clients.web.extensions.plot.OverviewPlotAction" |
---|
62 | import="net.sf.basedb.clients.web.extensions.plot.PlotGenerator" |
---|
63 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
64 | import="net.sf.basedb.util.extensions.ActionIterator" |
---|
65 | import="java.util.Date" |
---|
66 | import="java.util.Map" |
---|
67 | import="java.util.Set" |
---|
68 | import="java.util.List" |
---|
69 | import="java.util.Iterator" |
---|
70 | %> |
---|
71 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
72 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
73 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
74 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
75 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
76 | <%! |
---|
77 | private static final Item itemType = Item.DERIVEDBIOASSAY; |
---|
78 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
---|
79 | %> |
---|
80 | <% |
---|
81 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
82 | final String ID = sc.getId(); |
---|
83 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
84 | final int itemId = cc.getId(); |
---|
85 | final String tab = Values.getString(request.getParameter("tab"), "properties"); |
---|
86 | |
---|
87 | final float scale = Base.getScale(sc); |
---|
88 | final String root = request.getContextPath(); |
---|
89 | final DbControl dc = sc.newDbControl(); |
---|
90 | try |
---|
91 | { |
---|
92 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
93 | |
---|
94 | String title = null; |
---|
95 | final DerivedBioAssay bioAssay = DerivedBioAssay.getById(dc, itemId); |
---|
96 | |
---|
97 | Job job = null; |
---|
98 | boolean readJob = true; |
---|
99 | PluginDefinition plugin = null; |
---|
100 | boolean readPlugin = true; |
---|
101 | PluginConfiguration configuration = null; |
---|
102 | boolean readConfiguration = true; |
---|
103 | |
---|
104 | try |
---|
105 | { |
---|
106 | job = bioAssay.getJob(); |
---|
107 | } |
---|
108 | catch (PermissionDeniedException ex) |
---|
109 | { |
---|
110 | readJob = false; |
---|
111 | readPlugin = false; |
---|
112 | readConfiguration = false; |
---|
113 | } |
---|
114 | if (job != null) |
---|
115 | { |
---|
116 | try |
---|
117 | { |
---|
118 | plugin = job.getPluginDefinition(); |
---|
119 | } |
---|
120 | catch (PermissionDeniedException ex) |
---|
121 | { |
---|
122 | readPlugin = false; |
---|
123 | } |
---|
124 | try |
---|
125 | { |
---|
126 | configuration = job.getPluginConfiguration(); |
---|
127 | } |
---|
128 | catch (PermissionDeniedException ex) |
---|
129 | { |
---|
130 | readConfiguration = false; |
---|
131 | } |
---|
132 | } |
---|
133 | |
---|
134 | final boolean usePermission = bioAssay.hasPermission(Permission.USE); |
---|
135 | final boolean writePermission = bioAssay.hasPermission(Permission.WRITE); |
---|
136 | final boolean deletePermission = bioAssay.hasPermission(Permission.DELETE); |
---|
137 | final boolean sharePermission = bioAssay.hasPermission(Permission.SET_PERMISSION); |
---|
138 | final boolean setOwnerPermission = bioAssay.hasPermission(Permission.SET_OWNER); |
---|
139 | final boolean isRemoved = bioAssay.isRemoved(); |
---|
140 | final boolean isUsed = isRemoved && bioAssay.isUsed(); |
---|
141 | final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
---|
142 | final boolean isOwner = bioAssay.isOwner(); |
---|
143 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
144 | Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
---|
145 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssay); |
---|
146 | ExtensionsInvoker toolbarInvoker = ToolbarUtil.useExtensions(jspContext); |
---|
147 | %> |
---|
148 | <base:page title="<%=title%>"> |
---|
149 | <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
---|
150 | <ext:scripts context="<%=jspContext%>" /> |
---|
151 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
152 | <script language="JavaScript"> |
---|
153 | function editItem() |
---|
154 | { |
---|
155 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true); |
---|
156 | } |
---|
157 | function deleteItem() |
---|
158 | { |
---|
159 | location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>'); |
---|
160 | } |
---|
161 | function restoreItem() |
---|
162 | { |
---|
163 | location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>'); |
---|
164 | } |
---|
165 | function shareItem() |
---|
166 | { |
---|
167 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareBioAssay', 600, 400); |
---|
168 | } |
---|
169 | function setOwner() |
---|
170 | { |
---|
171 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); |
---|
172 | } |
---|
173 | function switchTab(tabControlId, tabId) |
---|
174 | { |
---|
175 | if (TabControl.isActive(tabControlId, tabId)) return; |
---|
176 | if ((tabId == 'overview' || tabId == 'history') && tabId != '<%=tab%>') |
---|
177 | { |
---|
178 | location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId; |
---|
179 | } |
---|
180 | else |
---|
181 | { |
---|
182 | TabControl.setActiveTab(tabControlId, tabId); |
---|
183 | } |
---|
184 | } |
---|
185 | function runItemPlugin(cmd) |
---|
186 | { |
---|
187 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); |
---|
188 | } |
---|
189 | function newChildBioAssay() |
---|
190 | { |
---|
191 | Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&parent_id=<%=itemId%>'); |
---|
192 | } |
---|
193 | function newRawBioAssay() |
---|
194 | { |
---|
195 | Main.viewOrEditItem('<%=ID%>', 'RAWBIOASSAY', 0, true, '&bioassay_id=<%=itemId%>'); |
---|
196 | } |
---|
197 | </script> |
---|
198 | </base:head> |
---|
199 | <base:body> |
---|
200 | <p> |
---|
201 | <p:path> |
---|
202 | <p:pathelement title="Derived bioassays" href="<%="index.jsp?ID="+ID%>" /> |
---|
203 | <p:pathelement title="<%=HTML.encodeTags(bioAssay.getName())%>" /> |
---|
204 | </p:path> |
---|
205 | |
---|
206 | <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false"> |
---|
207 | <t:tab id="properties" title="Properties"> |
---|
208 | <tbl:toolbar |
---|
209 | > |
---|
210 | <tbl:button |
---|
211 | disabled="<%=writePermission ? false : true%>" |
---|
212 | image="<%=writePermission ? "edit.gif" : "edit_disabled.gif"%>" |
---|
213 | onclick="editItem()" |
---|
214 | title="Edit…" |
---|
215 | tooltip="<%=writePermission ? "Edit this bioassay" : "You do not have permission to edit this bioassay"%>" |
---|
216 | /> |
---|
217 | <tbl:button |
---|
218 | disabled="<%=deletePermission ? false : true%>" |
---|
219 | image="<%=deletePermission ? "delete.gif" : "delete_disabled.gif"%>" |
---|
220 | onclick="deleteItem()" |
---|
221 | title="Delete" |
---|
222 | visible="<%=!bioAssay.isRemoved()%>" |
---|
223 | tooltip="<%=deletePermission ? "Delete this bioassay" : "You do not have permission to delete this bioassay"%>" |
---|
224 | /> |
---|
225 | <tbl:button |
---|
226 | disabled="<%=writePermission ? false : true%>" |
---|
227 | image="<%=writePermission ? "restore.gif" : "restore_disabled.gif"%>" |
---|
228 | onclick="restoreItem()" |
---|
229 | title="Restore" |
---|
230 | visible="<%=bioAssay.isRemoved()%>" |
---|
231 | tooltip="<%=writePermission ? "Restore this bioassay" : "You do not have permission to restore this bioassay"%>" |
---|
232 | /> |
---|
233 | <tbl:button |
---|
234 | disabled="<%=sharePermission ? false : true%>" |
---|
235 | image="<%=sharePermission ? "share.gif" : "share_disabled.gif"%>" |
---|
236 | onclick="shareItem()" |
---|
237 | title="Share…" |
---|
238 | tooltip="<%=sharePermission ? "Share this bioassay to other user, groups and projects" : "You do not have permission to share this bioassay"%>" |
---|
239 | /> |
---|
240 | <tbl:button |
---|
241 | disabled="<%=setOwnerPermission ? false : true%>" |
---|
242 | image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" |
---|
243 | onclick="setOwner()" |
---|
244 | title="Set owner…" |
---|
245 | tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" |
---|
246 | /> |
---|
247 | <tbl:button |
---|
248 | image="add.png" |
---|
249 | onclick="newChildBioAssay()" |
---|
250 | title="New child bioassay…" |
---|
251 | tooltip="Create a child bioassay from this bioassay" |
---|
252 | visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY) && usePermission%>" |
---|
253 | /> |
---|
254 | <tbl:button |
---|
255 | image="add.png" |
---|
256 | onclick="newRawBioAssay()" |
---|
257 | title="New raw bioassay…" |
---|
258 | tooltip="Create a raw bioassay from this bioassay" |
---|
259 | visible="<%=sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY) && usePermission%>" |
---|
260 | /> |
---|
261 | <tbl:button |
---|
262 | image="import.gif" |
---|
263 | onclick="runItemPlugin('ImportItem')" |
---|
264 | title="Import…" |
---|
265 | tooltip="Import data" |
---|
266 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
267 | /> |
---|
268 | <tbl:button |
---|
269 | image="export.gif" |
---|
270 | onclick="runItemPlugin('ExportItem')" |
---|
271 | title="Export…" |
---|
272 | tooltip="Export data" |
---|
273 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
274 | /> |
---|
275 | <tbl:button |
---|
276 | image="runplugin.gif" |
---|
277 | onclick="runItemPlugin('RunPlugin')" |
---|
278 | title="Run plugin…" |
---|
279 | tooltip="Run a plugin" |
---|
280 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
281 | /> |
---|
282 | <ext:render extensions="<%=toolbarInvoker%>" context="<%=jspContext%>" |
---|
283 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
284 | <tbl:button |
---|
285 | image="help.gif" |
---|
286 | onclick="<%="Main.openHelp('" + ID +"', 'derivedbioassay.view.properties')"%>" |
---|
287 | title="Help…" |
---|
288 | tooltip="Get help about this page" |
---|
289 | /> |
---|
290 | </tbl:toolbar> |
---|
291 | <div class="boxedbottom"> |
---|
292 | <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioAssay)%></i></div> |
---|
293 | <% |
---|
294 | if (isRemoved || bioAssay.isShared()) |
---|
295 | { |
---|
296 | %> |
---|
297 | <div class="itemstatus"> |
---|
298 | <base:icon |
---|
299 | image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>" |
---|
300 | onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>" |
---|
301 | tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>" |
---|
302 | visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon> |
---|
303 | <base:icon image="used.gif" |
---|
304 | onclick="showUsingItems()" |
---|
305 | tooltip="Show the items that are using this one" |
---|
306 | visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon> |
---|
307 | <base:icon image="shared.gif" |
---|
308 | visible="<%=bioAssay.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> |
---|
309 | </div> |
---|
310 | <% |
---|
311 | } |
---|
312 | %> |
---|
313 | |
---|
314 | <table width="100%"> |
---|
315 | <tr valign="top"> |
---|
316 | <td width="50%"> |
---|
317 | <h4>Bioassay set</h4> |
---|
318 | <table class="form" cellspacing=0> |
---|
319 | <tr> |
---|
320 | <td class="prompt">Name</td> |
---|
321 | <td><%=HTML.encodeTags(bioAssay.getName())%></td> |
---|
322 | </tr> |
---|
323 | <tr> |
---|
324 | <td class="prompt">Type</td> |
---|
325 | <td><base:propertyvalue item="<%=bioAssay%>" property="itemSubtype" /></td> |
---|
326 | </tr> |
---|
327 | <tr> |
---|
328 | <td class="prompt">Physical bioassay</td> |
---|
329 | <td><base:propertyvalue item="<%=bioAssay%>" property="physicalBioAssay" /></td> |
---|
330 | </tr> |
---|
331 | <tr> |
---|
332 | <td class="prompt">Parent bioassay</td> |
---|
333 | <td><base:propertyvalue item="<%=bioAssay%>" property="parent" /></td> |
---|
334 | </tr> |
---|
335 | <tr> |
---|
336 | <td class="prompt">Extract</td> |
---|
337 | <td><base:propertyvalue item="<%=bioAssay%>" property="extract" /></td> |
---|
338 | </tr> |
---|
339 | <tr> |
---|
340 | <td class="prompt">Protocol</td> |
---|
341 | <td><base:propertyvalue item="<%=bioAssay%>" property="protocol" /></td> |
---|
342 | </tr> |
---|
343 | <tr> |
---|
344 | <td class="prompt">Hardware</td> |
---|
345 | <td><base:propertyvalue item="<%=bioAssay%>" property="hardware" /></td> |
---|
346 | </tr> |
---|
347 | <tr> |
---|
348 | <td class="prompt">Software</td> |
---|
349 | <td><base:propertyvalue item="<%=bioAssay%>" property="software" /></td> |
---|
350 | </tr> |
---|
351 | <tr> |
---|
352 | <td class="prompt">Owner</td> |
---|
353 | <td><base:propertyvalue item="<%=bioAssay%>" property="owner" /></td> |
---|
354 | </tr> |
---|
355 | <tr> |
---|
356 | <td class="prompt">Description</td> |
---|
357 | <td><%=HTML.niceFormat(bioAssay.getDescription())%></td> |
---|
358 | </tr> |
---|
359 | </table> |
---|
360 | |
---|
361 | <% |
---|
362 | if (job != null) |
---|
363 | { |
---|
364 | %> |
---|
365 | <h4>Job</h4> |
---|
366 | <table class="form" cellspacing=0> |
---|
367 | |
---|
368 | <tr> |
---|
369 | <td class="prompt">Job</td> |
---|
370 | <td><%=Base.getLinkedName(ID, job, !readJob, false)%></td> |
---|
371 | </tr> |
---|
372 | <tr valign=top> |
---|
373 | <td class="prompt">Started</td> |
---|
374 | <td> |
---|
375 | <%=dateTimeFormatter.format(job.getStarted())%> |
---|
376 | </td> |
---|
377 | </tr> |
---|
378 | <tr valign=top> |
---|
379 | <td class="prompt">Ended</td> |
---|
380 | <td> |
---|
381 | <%=dateTimeFormatter.format(job.getEnded())%> |
---|
382 | </td> |
---|
383 | </tr> |
---|
384 | <tr valign=top> |
---|
385 | <td class="prompt">Server</td> |
---|
386 | <td> |
---|
387 | <%=HTML.encodeTags(job.getServer())%> |
---|
388 | </td> |
---|
389 | </tr> |
---|
390 | <tr> |
---|
391 | <td class="prompt">Description</td> |
---|
392 | <td><%=HTML.niceFormat(job.getDescription())%></td> |
---|
393 | </tr> |
---|
394 | </table> |
---|
395 | <% |
---|
396 | } |
---|
397 | %> |
---|
398 | </td> |
---|
399 | <td width="50%"> |
---|
400 | <h4>Plugin & parameters</h4> |
---|
401 | <table class="form" cellspacing=0> |
---|
402 | <tr> |
---|
403 | <td class="prompt">Plugin</td> |
---|
404 | <td><%=Base.getLinkedName(ID, plugin, |
---|
405 | !readPlugin, plugin != null && plugin.hasPermission(Permission.WRITE))%></td> |
---|
406 | </tr> |
---|
407 | <tr> |
---|
408 | <td class="prompt">Plugin configuration</td> |
---|
409 | <td><%=Base.getLinkedName(ID, configuration, !readConfiguration, |
---|
410 | configuration != null && configuration.hasPermission(Permission.WRITE))%></td> |
---|
411 | </tr> |
---|
412 | <% |
---|
413 | if (job != null) |
---|
414 | { |
---|
415 | for (String name : job.getParameterNames()) |
---|
416 | { |
---|
417 | StringBuilder sb = new StringBuilder(); |
---|
418 | String displayValue = ""; |
---|
419 | String description = ""; |
---|
420 | try |
---|
421 | { |
---|
422 | ParameterInfo pi = job.getParameterInfo(name); |
---|
423 | if (pi.getLabel() != null) name = HTML.encodeTags(pi.getLabel()); |
---|
424 | description = HTML.encodeTags(pi.getDescription()); |
---|
425 | List<?> values = pi.getValues(); |
---|
426 | int i = 0; |
---|
427 | for (Object value : values) |
---|
428 | { |
---|
429 | if (value != null) |
---|
430 | { |
---|
431 | if (i > 0) sb.append(", "); |
---|
432 | i++; |
---|
433 | if (value instanceof BasicItem) |
---|
434 | { |
---|
435 | BasicItem item = (BasicItem)value; |
---|
436 | String itemName = ""; |
---|
437 | if (item instanceof File) |
---|
438 | { |
---|
439 | itemName = ((File)item).getPath().toString(); |
---|
440 | } |
---|
441 | else if (item instanceof Nameable) |
---|
442 | { |
---|
443 | itemName = ((Nameable)item).getName(); |
---|
444 | } |
---|
445 | else |
---|
446 | { |
---|
447 | itemName = item.toString(); |
---|
448 | } |
---|
449 | sb.append(Base.getLink(ID, HTML.encodeTags(itemName), |
---|
450 | item.getType(), item.getId(), item.hasPermission(Permission.WRITE))); |
---|
451 | } |
---|
452 | else if (value instanceof Date) |
---|
453 | { |
---|
454 | sb.append(dateFormatter.format((Date)value)); |
---|
455 | } |
---|
456 | else |
---|
457 | { |
---|
458 | sb.append(HTML.encodeTags(value.toString())); |
---|
459 | } |
---|
460 | } |
---|
461 | } |
---|
462 | displayValue = sb.toString(); |
---|
463 | } |
---|
464 | catch (Throwable ex) |
---|
465 | { |
---|
466 | displayValue = "<i>ERROR: "+ex.getMessage()+"</i>"; |
---|
467 | } |
---|
468 | %> |
---|
469 | <tr> |
---|
470 | <td class="prompt"><span title="<%=description%>"><%=name%></span></td> |
---|
471 | <td> |
---|
472 | <%=displayValue%> |
---|
473 | </td> |
---|
474 | </tr> |
---|
475 | <% |
---|
476 | } |
---|
477 | } |
---|
478 | %> |
---|
479 | </table> |
---|
480 | |
---|
481 | </td> |
---|
482 | </tr> |
---|
483 | </table> |
---|
484 | |
---|
485 | <% |
---|
486 | ItemQuery<DerivedBioAssay> childQuery = bioAssay.getChildren(); |
---|
487 | childQuery.include(Include.ALL); |
---|
488 | childQuery.order(Orders.asc(Hql.property("name"))); |
---|
489 | ItemResultList<DerivedBioAssay> children = childQuery.list(dc); |
---|
490 | if (children.size() == 0) |
---|
491 | { |
---|
492 | %> |
---|
493 | <h4>Child bioassays</h4> |
---|
494 | This bioassay doesn't have any child bioassays |
---|
495 | (or you don't have permission to view them). |
---|
496 | <% |
---|
497 | } |
---|
498 | else |
---|
499 | { |
---|
500 | %> |
---|
501 | <base:section |
---|
502 | id="children" |
---|
503 | title="<%="Child bioassays (" + children.size() + ")"%>" |
---|
504 | context="<%=cc%>" |
---|
505 | > |
---|
506 | <tbl:table |
---|
507 | id="children" |
---|
508 | clazz="itemlist" |
---|
509 | columns="all" |
---|
510 | > |
---|
511 | <tbl:columndef |
---|
512 | id="name" |
---|
513 | title="Name" |
---|
514 | /> |
---|
515 | <tbl:columndef |
---|
516 | id="itemSubtype" |
---|
517 | title="Type" |
---|
518 | /> |
---|
519 | <tbl:columndef |
---|
520 | id="description" |
---|
521 | title="Description" |
---|
522 | /> |
---|
523 | <tbl:data> |
---|
524 | <tbl:columns> |
---|
525 | </tbl:columns> |
---|
526 | <tbl:rows> |
---|
527 | <% |
---|
528 | for (DerivedBioAssay item : children) |
---|
529 | { |
---|
530 | %> |
---|
531 | <tbl:row> |
---|
532 | <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> |
---|
533 | <tbl:cell column="itemSubtype"><base:propertyvalue item="<%=item%>" property="itemSubtype" /></tbl:cell> |
---|
534 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
535 | </tbl:row> |
---|
536 | <% |
---|
537 | } |
---|
538 | %> |
---|
539 | </tbl:rows> |
---|
540 | </tbl:data> |
---|
541 | </tbl:table> |
---|
542 | </base:section> |
---|
543 | <% |
---|
544 | } |
---|
545 | %> |
---|
546 | |
---|
547 | <% |
---|
548 | ItemQuery<RawBioAssay> rawQuery = bioAssay.getRawBioAssays(); |
---|
549 | rawQuery.include(Include.ALL); |
---|
550 | rawQuery.order(Orders.asc(Hql.property("name"))); |
---|
551 | ItemResultList<RawBioAssay> rawBioAssays = rawQuery.list(dc); |
---|
552 | if (rawBioAssays.size() == 0) |
---|
553 | { |
---|
554 | %> |
---|
555 | <h4>Raw bioassays</h4> |
---|
556 | This bioassay doesn't have any child raw bioassays |
---|
557 | (or you don't have permission to view them). |
---|
558 | <% |
---|
559 | } |
---|
560 | else |
---|
561 | { |
---|
562 | %> |
---|
563 | <base:section |
---|
564 | id="children" |
---|
565 | title="<%="Raw bioassays (" + rawBioAssays.size() + ")"%>" |
---|
566 | context="<%=cc%>" |
---|
567 | > |
---|
568 | <tbl:table |
---|
569 | id="rawBioAssays" |
---|
570 | clazz="itemlist" |
---|
571 | columns="all" |
---|
572 | > |
---|
573 | <tbl:columndef |
---|
574 | id="name" |
---|
575 | title="Name" |
---|
576 | /> |
---|
577 | <tbl:columndef |
---|
578 | id="platform" |
---|
579 | title="Platform" |
---|
580 | /> |
---|
581 | <tbl:columndef |
---|
582 | id="description" |
---|
583 | title="Description" |
---|
584 | /> |
---|
585 | <tbl:data> |
---|
586 | <tbl:columns> |
---|
587 | </tbl:columns> |
---|
588 | <tbl:rows> |
---|
589 | <% |
---|
590 | for (RawBioAssay item : rawBioAssays) |
---|
591 | { |
---|
592 | %> |
---|
593 | <tbl:row> |
---|
594 | <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> |
---|
595 | <tbl:cell column="platform"><base:propertyvalue item="<%=item%>" property="platform" /></tbl:cell> |
---|
596 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
597 | </tbl:row> |
---|
598 | <% |
---|
599 | } |
---|
600 | %> |
---|
601 | </tbl:rows> |
---|
602 | </tbl:data> |
---|
603 | </tbl:table> |
---|
604 | </base:section> |
---|
605 | <% |
---|
606 | } |
---|
607 | %> |
---|
608 | |
---|
609 | <jsp:include page="../../common/datafiles/list_files.jsp"> |
---|
610 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
611 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
612 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
613 | </jsp:include> |
---|
614 | |
---|
615 | <jsp:include page="../../common/anytoany/list_anytoany.jsp"> |
---|
616 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
617 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
618 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
619 | <jsp:param name="title" value="Other items related to this bioassay set" /> |
---|
620 | </jsp:include> |
---|
621 | </div> |
---|
622 | </t:tab> |
---|
623 | |
---|
624 | <t:tab id="annotations" title="Annotations & parameters" |
---|
625 | tooltip="View annotation values and protocol parameters"> |
---|
626 | <div class="boxed"> |
---|
627 | <jsp:include page="../../common/annotations/list_annotations.jsp"> |
---|
628 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
629 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
630 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
631 | </jsp:include> |
---|
632 | </div> |
---|
633 | |
---|
634 | </t:tab> |
---|
635 | |
---|
636 | <t:tab id="overview" title="Overview" |
---|
637 | tooltip="Display a tree overview of related items"> |
---|
638 | <% |
---|
639 | if ("overview".equals(tab)) |
---|
640 | { |
---|
641 | %> |
---|
642 | <jsp:include page="../../common/overview/overview.jsp"> |
---|
643 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
644 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
645 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
646 | </jsp:include> |
---|
647 | <% |
---|
648 | } |
---|
649 | %> |
---|
650 | </t:tab> |
---|
651 | <t:tab id="history" title="Change history" |
---|
652 | tooltip="Displays a log of all modifications made to this item" |
---|
653 | visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> |
---|
654 | <% |
---|
655 | if ("history".equals(tab)) |
---|
656 | { |
---|
657 | %> |
---|
658 | <jsp:include page="../../common/history/frameset.jsp"> |
---|
659 | <jsp:param name="source_type" value="<%=itemType.name()%>" /> |
---|
660 | <jsp:param name="source_id" value="<%=itemId%>" /> |
---|
661 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
662 | </jsp:include> |
---|
663 | <% |
---|
664 | } |
---|
665 | %> |
---|
666 | </t:tab> |
---|
667 | </t:tabcontrol> |
---|
668 | |
---|
669 | </base:body> |
---|
670 | </base:page> |
---|
671 | <% |
---|
672 | } |
---|
673 | finally |
---|
674 | { |
---|
675 | if (dc != null) dc.close(); |
---|
676 | } |
---|
677 | |
---|
678 | %> |
---|