1 | <%-- $Id: list_bioassays.jsp 5674 2011-06-27 12:29:52Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
4 | Copyright (C) 2007 Johan Enell |
---|
5 | |
---|
6 | This file is part of BASE - BioArray Software Environment. |
---|
7 | Available at http://base.thep.lu.se/ |
---|
8 | |
---|
9 | BASE is free software; you can redistribute it and/or |
---|
10 | modify it under the terms of the GNU General Public License |
---|
11 | as published by the Free Software Foundation; either version 3 |
---|
12 | of the License, or (at your option) any later version. |
---|
13 | |
---|
14 | BASE is distributed in the hope that it will be useful, |
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | GNU General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License |
---|
20 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | ------------------------------------------------------------------ |
---|
22 | |
---|
23 | @author Nicklas |
---|
24 | @version 2.0 |
---|
25 | --%> |
---|
26 | <%@ page pageEncoding="UTF-8" session="false" |
---|
27 | import="net.sf.basedb.core.SessionControl" |
---|
28 | import="net.sf.basedb.core.DbControl" |
---|
29 | import="net.sf.basedb.core.Item" |
---|
30 | import="net.sf.basedb.core.ItemContext" |
---|
31 | import="net.sf.basedb.core.Experiment" |
---|
32 | import="net.sf.basedb.core.BioAssaySet" |
---|
33 | import="net.sf.basedb.core.BioAssay" |
---|
34 | import="net.sf.basedb.core.RawBioAssay" |
---|
35 | import="net.sf.basedb.core.AnnotationSet" |
---|
36 | import="net.sf.basedb.core.AnnotationType" |
---|
37 | import="net.sf.basedb.core.Annotation" |
---|
38 | import="net.sf.basedb.core.ItemQuery" |
---|
39 | import="net.sf.basedb.core.ItemResultIterator" |
---|
40 | import="net.sf.basedb.core.ItemResultList" |
---|
41 | import="net.sf.basedb.core.Permission" |
---|
42 | import="net.sf.basedb.core.PluginDefinition" |
---|
43 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
44 | import="net.sf.basedb.core.RawDataType" |
---|
45 | import="net.sf.basedb.core.Type" |
---|
46 | import="net.sf.basedb.core.Include" |
---|
47 | import="net.sf.basedb.core.query.Restrictions" |
---|
48 | import="net.sf.basedb.core.query.Expressions" |
---|
49 | import="net.sf.basedb.core.query.Orders" |
---|
50 | import="net.sf.basedb.core.query.Hql" |
---|
51 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
52 | import="net.sf.basedb.core.plugin.Plugin" |
---|
53 | import="net.sf.basedb.core.snapshot.SnapshotManager" |
---|
54 | import="net.sf.basedb.util.Tree" |
---|
55 | import="net.sf.basedb.util.Enumeration" |
---|
56 | import="net.sf.basedb.util.BioAssaySetUtil" |
---|
57 | import="net.sf.basedb.clients.web.Base" |
---|
58 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
59 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
60 | import="net.sf.basedb.clients.web.util.HTML" |
---|
61 | import="net.sf.basedb.util.Values" |
---|
62 | import="net.sf.basedb.util.formatter.Formatter" |
---|
63 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
64 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
65 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
66 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
67 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
68 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
69 | import="java.util.List" |
---|
70 | import="java.util.LinkedList" |
---|
71 | import="java.util.Map" |
---|
72 | import="java.util.HashMap" |
---|
73 | import="java.util.Iterator" |
---|
74 | import="java.util.Collection" |
---|
75 | %> |
---|
76 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
77 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
78 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
79 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
80 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
81 | <%! |
---|
82 | private static final Item itemType = Item.BIOASSAY; |
---|
83 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
84 | %> |
---|
85 | <% |
---|
86 | final int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id")); |
---|
87 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
88 | final String ID = sc.getId(); |
---|
89 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
90 | |
---|
91 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
92 | final String callback = request.getParameter("callback"); |
---|
93 | final String title = mode.generateTitle("bioassay", "bioassays"); |
---|
94 | final DbControl dc = sc.newDbControl(); |
---|
95 | ItemResultIterator<BioAssay> bioAssays = null; |
---|
96 | ItemResultList<AnnotationType> annotationTypes = null; |
---|
97 | ItemResultList<AnnotationType> experimentalFactors = null; |
---|
98 | try |
---|
99 | { |
---|
100 | final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
---|
101 | final BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId); |
---|
102 | final Experiment experiment = bioAssaySet.getExperiment(); |
---|
103 | final boolean hasDbSpots = bioAssaySet.getNumSpots() > 0; |
---|
104 | final ItemQuery<AnnotationType> experimentalFactorQuery = experiment.getExperimentalFactors(); |
---|
105 | experimentalFactorQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); |
---|
106 | final int experimentId = experiment.getId(); |
---|
107 | final RawDataType rawDataType = experiment.getRawDataType(); |
---|
108 | final boolean createPermission = experiment.hasPermission(Permission.WRITE); |
---|
109 | final boolean deletePermission = createPermission; |
---|
110 | final boolean writePermission = createPermission; |
---|
111 | |
---|
112 | // Query for raw bioassays related to the current bioassay |
---|
113 | final ItemQuery<RawBioAssay> rawQuery = RawBioAssay.getQuery(); |
---|
114 | rawQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); |
---|
115 | rawQuery.join(Hql.innerJoin("bioAssays", "bas")); |
---|
116 | rawQuery.restrict(Restrictions.eq(Hql.alias("bas"), Expressions.parameter("bioAssay"))); |
---|
117 | rawQuery.order(Orders.asc(Hql.property("name"))); |
---|
118 | |
---|
119 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
120 | annotationTypes = annotationTypeQuery.list(dc); |
---|
121 | experimentalFactors = experimentalFactorQuery.list(dc); |
---|
122 | final SnapshotManager snapshotManager = new SnapshotManager(); |
---|
123 | try |
---|
124 | { |
---|
125 | final ItemQuery<BioAssay> query = Base.getConfiguredQuery(dc, cc, true, bioAssaySet.getBioAssays(), mode); |
---|
126 | query.join(Hql.leftJoin("rawParents", "rba")); |
---|
127 | query.setDistinct(true); |
---|
128 | bioAssays = query.iterate(dc); |
---|
129 | } |
---|
130 | catch (Throwable t) |
---|
131 | { |
---|
132 | t.printStackTrace(); |
---|
133 | cc.setMessage(t.getMessage()); |
---|
134 | } |
---|
135 | int numListed = 0; |
---|
136 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, |
---|
137 | guiContext, bioAssaySet); |
---|
138 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
139 | ExtensionsInvoker overviewPlotInvoker = ExtensionsControl.useExtensions(jspContext, |
---|
140 | "net.sf.basedb.clients.web.bioassayset.overviewplots"); |
---|
141 | %> |
---|
142 | <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> |
---|
143 | <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css"> |
---|
144 | <ext:scripts context="<%=jspContext%>" /> |
---|
145 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
146 | <script language="JavaScript"> |
---|
147 | var submitPage = 'index.jsp'; |
---|
148 | var formId = 'bioAssaySets'; |
---|
149 | function editItem(itemId) |
---|
150 | { |
---|
151 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); |
---|
152 | } |
---|
153 | function viewItem(itemId) |
---|
154 | { |
---|
155 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); |
---|
156 | } |
---|
157 | function itemOnClick(evt, itemId) |
---|
158 | { |
---|
159 | Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected); |
---|
160 | } |
---|
161 | function configureColumns() |
---|
162 | { |
---|
163 | Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
164 | } |
---|
165 | function runPlugin(cmd) |
---|
166 | { |
---|
167 | Table.submitToPopup(formId, cmd, 740, 540); |
---|
168 | } |
---|
169 | function returnSelected() |
---|
170 | { |
---|
171 | Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); |
---|
172 | window.close(); |
---|
173 | } |
---|
174 | function presetOnChange() |
---|
175 | { |
---|
176 | Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
177 | } |
---|
178 | function switchTab(tabControlId, tabId) |
---|
179 | { |
---|
180 | if (tabId == 'properties' || tabId == 'overviewplots' || tabId == 'annotations') |
---|
181 | { |
---|
182 | location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=ViewItem&experiment_id=<%=experiment.getId()%>&item_id=<%=bioAssaySetId%>&tab='+tabId; |
---|
183 | } |
---|
184 | else if (tabId == 'spotdata') |
---|
185 | { |
---|
186 | location.href = '../spotdata/index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&bioassayset_id=<%=bioAssaySetId%>'; |
---|
187 | } |
---|
188 | else |
---|
189 | { |
---|
190 | TabControl.setActiveTab(tabControlId, tabId); |
---|
191 | } |
---|
192 | } |
---|
193 | function openPlotTool(bioAssayId) |
---|
194 | { |
---|
195 | Main.openPopup('../plotter/index.jsp?ID=<%=ID%>&bioassay_id='+bioAssayId, 'Plotter', 1000, 700); |
---|
196 | } |
---|
197 | function viewSpotData(bioAssayId) |
---|
198 | { |
---|
199 | location.href = '../spotdata/index.jsp?ID=<%=ID%>&bioassay_id='+bioAssayId; |
---|
200 | } |
---|
201 | </script> |
---|
202 | </base:head> |
---|
203 | |
---|
204 | <base:body> |
---|
205 | <p> |
---|
206 | <% |
---|
207 | if (!mode.isSelectionMode()) |
---|
208 | { |
---|
209 | %> |
---|
210 | <p:path> |
---|
211 | <p:pathelement title="Experiments" href="<%="../index.jsp?ID="+ID%>" /> |
---|
212 | <p:pathelement title="<%=HTML.encodeTags(experiment.getName())%>" |
---|
213 | href="<%="../bioassaysets/index.jsp?ID="+ID+"&experiment_id="+experiment.getId()%>" /> |
---|
214 | <p:pathelement title="<%=HTML.encodeTags(bioAssaySet.getName())%>" /> |
---|
215 | </p:path> |
---|
216 | <% |
---|
217 | } |
---|
218 | %> |
---|
219 | |
---|
220 | <t:tabcontrol id="main" active="bioassays" switch="switchTab" notabs="<%=mode.isSelectionMode()%>"> |
---|
221 | <t:tab id="properties" title="Properties" /> |
---|
222 | |
---|
223 | <t:tab id="annotations" title="Annotations" |
---|
224 | tooltip="View annotation values" /> |
---|
225 | |
---|
226 | <t:tab id="bioassays" title="Bioassays"> |
---|
227 | <% |
---|
228 | if (cc.getMessage() != null) |
---|
229 | { |
---|
230 | %> |
---|
231 | <div class="error"><%=cc.getMessage()%></div> |
---|
232 | <% |
---|
233 | cc.setMessage(null); |
---|
234 | } |
---|
235 | %> |
---|
236 | <tbl:table |
---|
237 | id="bioAssaySets" |
---|
238 | clazz="itemlist" |
---|
239 | columns="<%=cc.getSetting("columns")%>" |
---|
240 | sortby="<%=cc.getSortProperty()%>" |
---|
241 | direction="<%=cc.getSortDirection()%>" |
---|
242 | title="<%=title%>" |
---|
243 | action="index.jsp" |
---|
244 | sc="<%=sc%>" |
---|
245 | item="<%=itemType%>" |
---|
246 | > |
---|
247 | <tbl:hidden |
---|
248 | name="mode" |
---|
249 | value="<%=mode.getName()%>" |
---|
250 | /> |
---|
251 | <tbl:hidden |
---|
252 | name="bioassayset_id" |
---|
253 | value="<%=String.valueOf(bioAssaySetId)%>" |
---|
254 | /> |
---|
255 | <tbl:hidden |
---|
256 | name="callback" |
---|
257 | value="<%=callback%>" |
---|
258 | skip="<%=callback == null%>" |
---|
259 | /> |
---|
260 | <tbl:columndef |
---|
261 | id="name" |
---|
262 | property="name" |
---|
263 | datatype="string" |
---|
264 | title="Name" |
---|
265 | sortable="true" |
---|
266 | filterable="true" |
---|
267 | exportable="true" |
---|
268 | show="always" |
---|
269 | /> |
---|
270 | <tbl:columndef |
---|
271 | id="id" |
---|
272 | clazz="uniquecol" |
---|
273 | property="id" |
---|
274 | datatype="int" |
---|
275 | title="ID" |
---|
276 | sortable="true" |
---|
277 | filterable="true" |
---|
278 | exportable="true" |
---|
279 | /> |
---|
280 | <tbl:columndef |
---|
281 | id="spots" |
---|
282 | property="numSpots" |
---|
283 | datatype="int" |
---|
284 | title="Spots in db" |
---|
285 | sortable="true" |
---|
286 | filterable="true" |
---|
287 | exportable="true" |
---|
288 | /> |
---|
289 | <tbl:columndef |
---|
290 | id="fileSpots" |
---|
291 | property="numFileSpots" |
---|
292 | datatype="int" |
---|
293 | title="Spots in file" |
---|
294 | sortable="true" |
---|
295 | filterable="true" |
---|
296 | exportable="true" |
---|
297 | /> |
---|
298 | <tbl:columndef |
---|
299 | id="rawBioAssays" |
---|
300 | title="Raw bioassays" |
---|
301 | /> |
---|
302 | <tbl:columndef |
---|
303 | id="description" |
---|
304 | property="description" |
---|
305 | datatype="string" |
---|
306 | title="Description" |
---|
307 | sortable="true" |
---|
308 | filterable="true" |
---|
309 | exportable="true" |
---|
310 | /> |
---|
311 | <tbl:columndef |
---|
312 | id="tools" |
---|
313 | title="Tools" |
---|
314 | show="<%=mode.isSelectionMode() ? "never" : "auto"%>" |
---|
315 | /> |
---|
316 | <% |
---|
317 | for (AnnotationType at : annotationTypes) |
---|
318 | { |
---|
319 | Enumeration<String, String> annotationEnum = null; |
---|
320 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
321 | if (at.isEnumeration()) |
---|
322 | { |
---|
323 | annotationEnum = new Enumeration<String, String>(); |
---|
324 | List<?> values = at.getValues(); |
---|
325 | for (Object value : values) |
---|
326 | { |
---|
327 | String encoded = formatter.format(value); |
---|
328 | annotationEnum.add(encoded, encoded); |
---|
329 | } |
---|
330 | } |
---|
331 | %> |
---|
332 | <tbl:columndef |
---|
333 | id="<%="at"+at.getId()%>" |
---|
334 | title="<%=HTML.encodeTags(at.getName())+" [A]"%>" |
---|
335 | property="<%="#"+at.getId()%>" |
---|
336 | annotation="true" |
---|
337 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
338 | enumeration="<%=annotationEnum%>" |
---|
339 | smartenum="<%=at.getDisplayAsList() %>" |
---|
340 | sortable="false" |
---|
341 | filterable="true" |
---|
342 | exportable="true" |
---|
343 | formatter="<%=formatter%>" |
---|
344 | unit="<%=at.getDefaultUnit()%>" |
---|
345 | /> |
---|
346 | <% |
---|
347 | } |
---|
348 | %> |
---|
349 | <% |
---|
350 | for (AnnotationType at : experimentalFactors) |
---|
351 | { |
---|
352 | Enumeration<String, String> annotationEnum = null; |
---|
353 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
354 | if (at.isEnumeration()) |
---|
355 | { |
---|
356 | annotationEnum = new Enumeration<String, String>(); |
---|
357 | List<?> values = at.getValues(); |
---|
358 | for (Object value : values) |
---|
359 | { |
---|
360 | String encoded = formatter.format(value); |
---|
361 | annotationEnum.add(encoded, encoded); |
---|
362 | } |
---|
363 | } |
---|
364 | %> |
---|
365 | <tbl:columndef |
---|
366 | id="<%="ef"+at.getId()%>" |
---|
367 | title="<%=HTML.encodeTags(at.getName())+" [EF]"%>" |
---|
368 | property="<%="$rba.##"+at.getId()%>" |
---|
369 | exportproperty="<%="#" + at.getId() %>" |
---|
370 | annotation="true" |
---|
371 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
372 | enumeration="<%=annotationEnum%>" |
---|
373 | sortable="false" |
---|
374 | filterable="true" |
---|
375 | exportable="true" |
---|
376 | formatter="<%=formatter%>" |
---|
377 | /> |
---|
378 | <% |
---|
379 | } |
---|
380 | %> |
---|
381 | <tbl:toolbar |
---|
382 | visible="<%=mode.hasToolbar()%>" |
---|
383 | > |
---|
384 | <tbl:button |
---|
385 | image="columns.gif" |
---|
386 | onclick="configureColumns()" |
---|
387 | title="Columns…" |
---|
388 | tooltip="Show, hide and re-order columns" |
---|
389 | /> |
---|
390 | <tbl:button |
---|
391 | image="import.gif" |
---|
392 | onclick="runPlugin('ImportItems')" |
---|
393 | title="Import…" |
---|
394 | tooltip="Import data" |
---|
395 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
396 | /> |
---|
397 | <tbl:button |
---|
398 | image="export.gif" |
---|
399 | onclick="runPlugin('ExportItems')" |
---|
400 | title="Export…" |
---|
401 | tooltip="Export data" |
---|
402 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
403 | /> |
---|
404 | <tbl:button |
---|
405 | disabled="<%=!createPermission%>" |
---|
406 | image="<%=createPermission ? "filter.gif" : "filter_disabled.gif"%>" |
---|
407 | onclick="<%="runPlugin('NewFilteredBioAssaySet')"%>" |
---|
408 | title="Filter bioassay set…" |
---|
409 | tooltip="<%=createPermission ? |
---|
410 | "Create a new bioassay set by filtering this bioassayset" : |
---|
411 | "You do not have permission analyze this experiment"%>" |
---|
412 | visible="<%=!mode.isSelectionMode()%>" |
---|
413 | /> |
---|
414 | <tbl:button |
---|
415 | image="runplugin.gif" |
---|
416 | onclick="runPlugin('RunListPlugin')" |
---|
417 | title="Run plugin…" |
---|
418 | tooltip="Run a plugin" |
---|
419 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER) && !mode.isSelectionMode()%>" |
---|
420 | /> |
---|
421 | <tbl:button |
---|
422 | disabled="<%=!createPermission%>" |
---|
423 | image="<%=createPermission ? "runplugin.gif" : "runplugin_disabled.gif"%>" |
---|
424 | onclick="<%="runPlugin('RunListAnalysisPlugin')"%>" |
---|
425 | title="Run analysis…" |
---|
426 | tooltip="<%=createPermission ? "Run an analysis plugin" : |
---|
427 | "You do not have permission to analyze this experiment"%>" |
---|
428 | visible="<%=pluginCount.containsKey(Plugin.MainType.ANALYZE) && !mode.isSelectionMode()%>" |
---|
429 | /> |
---|
430 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
431 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
432 | </tbl:toolbar> |
---|
433 | <tbl:navigator |
---|
434 | page="<%=cc.getPage()%>" |
---|
435 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
436 | totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>" |
---|
437 | visible="<%=mode.hasNavigator()%>" |
---|
438 | /> |
---|
439 | <tbl:data> |
---|
440 | <tbl:columns> |
---|
441 | <tbl:presetselector |
---|
442 | clazz="columnheader" |
---|
443 | colspan="3" |
---|
444 | onchange="presetOnChange()" |
---|
445 | /> |
---|
446 | </tbl:columns> |
---|
447 | <tr> |
---|
448 | <tbl:header |
---|
449 | clazz="index" |
---|
450 | > </tbl:header> |
---|
451 | <tbl:header |
---|
452 | clazz="check" |
---|
453 | visible="<%=mode.hasCheck()%>" |
---|
454 | ><base:icon |
---|
455 | image="check_uncheck.gif" |
---|
456 | tooltip="Check/uncheck all" |
---|
457 | onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;" |
---|
458 | /></tbl:header> |
---|
459 | <tbl:header |
---|
460 | clazz="check" |
---|
461 | visible="<%=mode.hasRadio()%>" |
---|
462 | /> |
---|
463 | <tbl:header |
---|
464 | clazz="icons" |
---|
465 | visible="<%=mode.hasIcons()%>" |
---|
466 | > </tbl:header> |
---|
467 | <tbl:propertyfilter /> |
---|
468 | </tr> |
---|
469 | |
---|
470 | <tbl:rows> |
---|
471 | <% |
---|
472 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
473 | int selectedItemId = cc.getId(); |
---|
474 | if (bioAssays != null) |
---|
475 | { |
---|
476 | while (bioAssays.hasNext()) |
---|
477 | { |
---|
478 | BioAssay item = bioAssays.next(); |
---|
479 | boolean bioAssayHasDbSpots = item.getNumSpots() > 0; |
---|
480 | int itemId = item.getId(); |
---|
481 | String name = HTML.encodeTags(item.getName()); |
---|
482 | String tooltip = mode.isSelectionMode() ? |
---|
483 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
484 | index++; |
---|
485 | numListed++; |
---|
486 | %> |
---|
487 | <tbl:row> |
---|
488 | <tbl:header |
---|
489 | clazz="index" |
---|
490 | ><%=index%></tbl:header> |
---|
491 | <tbl:header |
---|
492 | clazz="check" |
---|
493 | visible="<%=mode.hasCheck()%>" |
---|
494 | ><input |
---|
495 | type="checkbox" |
---|
496 | name="<%=itemId%>" |
---|
497 | value="<%=itemId%>" |
---|
498 | title="<%=name%>" |
---|
499 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
500 | ></tbl:header> |
---|
501 | <tbl:header |
---|
502 | clazz="check" |
---|
503 | visible="<%=mode.hasRadio()%>" |
---|
504 | ><input |
---|
505 | type="radio" |
---|
506 | name="item_id" |
---|
507 | value="<%=itemId%>" |
---|
508 | title="<%=name%>" |
---|
509 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
510 | ></tbl:header> |
---|
511 | <tbl:header |
---|
512 | clazz="icons" |
---|
513 | visible="<%=mode.hasIcons()%>" |
---|
514 | > </tbl:header> |
---|
515 | <tbl:cell column="name"><div class="link" |
---|
516 | onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" |
---|
517 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
518 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
519 | <tbl:cell column="spots"><%=item.getNumSpots()%></tbl:cell> |
---|
520 | <tbl:cell column="fileSpots"><%=item.getNumFileSpots()%></tbl:cell> |
---|
521 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
522 | <tbl:cell column="rawBioAssays"> |
---|
523 | <% |
---|
524 | rawQuery.setParameter("bioAssay", itemId, Type.INT); |
---|
525 | try |
---|
526 | { |
---|
527 | String separator = ""; |
---|
528 | for (RawBioAssay rba : rawQuery.list(dc)) |
---|
529 | { |
---|
530 | out.write(separator); |
---|
531 | if (mode.hasPropertyLink()) |
---|
532 | { |
---|
533 | out.write(Base.getLinkedName(ID, rba, false, mode.hasEditLink())); |
---|
534 | } |
---|
535 | else |
---|
536 | { |
---|
537 | out.write(HTML.encodeTags(rba.getName())); |
---|
538 | } |
---|
539 | separator = ", "; |
---|
540 | } |
---|
541 | } |
---|
542 | catch (Throwable t) |
---|
543 | { |
---|
544 | %> |
---|
545 | <div class="error"><%=t.getMessage()%></div> |
---|
546 | <% |
---|
547 | } |
---|
548 | %> |
---|
549 | </tbl:cell> |
---|
550 | <% |
---|
551 | AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; |
---|
552 | if (as != null) |
---|
553 | { |
---|
554 | for (AnnotationType at : annotationTypes) |
---|
555 | { |
---|
556 | if (as.hasAnnotation(at)) |
---|
557 | { |
---|
558 | Annotation a = as.getAnnotation(at); |
---|
559 | String suffix = a.getUnitSymbol(null); |
---|
560 | if (suffix != null) suffix = " " + suffix; |
---|
561 | %> |
---|
562 | <tbl:cell |
---|
563 | column="<%="at"+at.getId()%>" |
---|
564 | ><tbl:cellvalue |
---|
565 | list="<%=a.getValues(null)%>" |
---|
566 | suffix="<%=suffix%>" |
---|
567 | /></tbl:cell> |
---|
568 | <% |
---|
569 | } |
---|
570 | } |
---|
571 | } |
---|
572 | for (AnnotationType at : experimentalFactors) |
---|
573 | { |
---|
574 | %> |
---|
575 | <tbl:cell column="<%="ef"+at.getId()%>" |
---|
576 | ><tbl:cellvalue |
---|
577 | list="<%=BioAssaySetUtil.getAnnotationValues(dc, snapshotManager, item, at)%>" |
---|
578 | /></tbl:cell> |
---|
579 | <% |
---|
580 | } |
---|
581 | %> |
---|
582 | <tbl:cell column="tools"> |
---|
583 | <nobr> |
---|
584 | <% |
---|
585 | if (bioAssayHasDbSpots) |
---|
586 | { |
---|
587 | %> |
---|
588 | <a href="javascript:openPlotTool(<%=itemId%>)" |
---|
589 | title="A simple plot tool"><img |
---|
590 | src="../../../images/plotter.gif" border="0"></a> |
---|
591 | <a href="javascript:viewSpotData(<%=itemId%>)" |
---|
592 | title="View spot data as a table"><img |
---|
593 | src="../../../images/table.gif" border="0"></a> |
---|
594 | <% |
---|
595 | } |
---|
596 | %> |
---|
597 | </nobr> |
---|
598 | </tbl:cell> |
---|
599 | </tbl:row> |
---|
600 | <% |
---|
601 | } |
---|
602 | } |
---|
603 | %> |
---|
604 | </tbl:rows> |
---|
605 | </tbl:data> |
---|
606 | <% |
---|
607 | if (numListed == 0) |
---|
608 | { |
---|
609 | %> |
---|
610 | <tbl:panel><%=bioAssays == null || bioAssays.getTotalCount() == 0 ? "No bioassays were found" : "No bioassays on this page. Please select another page!" %></tbl:panel> |
---|
611 | <% |
---|
612 | } |
---|
613 | else |
---|
614 | { |
---|
615 | %> |
---|
616 | <tbl:navigator |
---|
617 | page="<%=cc.getPage()%>" |
---|
618 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
619 | totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>" |
---|
620 | visible="<%=mode.hasNavigator()%>" |
---|
621 | locked="true" |
---|
622 | /> |
---|
623 | <% |
---|
624 | } |
---|
625 | %> |
---|
626 | |
---|
627 | </tbl:table> |
---|
628 | <base:buttongroup align="center" clazz="fixedatbottom"> |
---|
629 | <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
630 | <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
631 | <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
632 | </base:buttongroup> |
---|
633 | </t:tab> |
---|
634 | |
---|
635 | <t:tab id="spotdata" title="Spot data" visible="<%=hasDbSpots%>" /> |
---|
636 | |
---|
637 | <t:tab id="overviewplots" title="Overview plots" |
---|
638 | visible="<%=overviewPlotInvoker.getNumExtensions() > 0%>" /> |
---|
639 | |
---|
640 | </t:tabcontrol> |
---|
641 | |
---|
642 | </base:body> |
---|
643 | </base:page> |
---|
644 | <% |
---|
645 | } |
---|
646 | finally |
---|
647 | { |
---|
648 | if (bioAssays != null) bioAssays.close(); |
---|
649 | if (dc != null) dc.close(); |
---|
650 | } |
---|
651 | %> |
---|