1 | <%-- $Id: list_rawbioassays.jsp 6699 2015-01-30 10:32:48Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2005 Nicklas Nordborg |
---|
4 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
5 | Copyright (C) 2007 Johan Enell, Martin Svensson |
---|
6 | |
---|
7 | This file is part of BASE - BioArray Software Environment. |
---|
8 | Available at http://base.thep.lu.se/ |
---|
9 | |
---|
10 | BASE is free software; you can redistribute it and/or |
---|
11 | modify it under the terms of the GNU General Public License |
---|
12 | as published by the Free Software Foundation; either version 3 |
---|
13 | of the License, or (at your option) any later version. |
---|
14 | |
---|
15 | BASE is distributed in the hope that it will be useful, |
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | GNU General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU General Public License |
---|
21 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
22 | ------------------------------------------------------------------ |
---|
23 | |
---|
24 | @author Nicklas |
---|
25 | @version 2.0 |
---|
26 | --%> |
---|
27 | <%@ page pageEncoding="UTF-8" session="false" |
---|
28 | import="net.sf.basedb.core.SessionControl" |
---|
29 | import="net.sf.basedb.core.DbControl" |
---|
30 | import="net.sf.basedb.core.Item" |
---|
31 | import="net.sf.basedb.core.RawBioAssay" |
---|
32 | import="net.sf.basedb.core.Platform" |
---|
33 | import="net.sf.basedb.core.RawDataType" |
---|
34 | import="net.sf.basedb.core.RawDataTypes" |
---|
35 | import="net.sf.basedb.core.Experiment" |
---|
36 | import="net.sf.basedb.core.AnnotationType" |
---|
37 | import="net.sf.basedb.core.AnnotationSet" |
---|
38 | import="net.sf.basedb.core.Annotation" |
---|
39 | import="net.sf.basedb.core.File" |
---|
40 | import="net.sf.basedb.core.FileSetMember" |
---|
41 | import="net.sf.basedb.core.ItemQuery" |
---|
42 | import="net.sf.basedb.core.Include" |
---|
43 | import="net.sf.basedb.core.Type" |
---|
44 | import="net.sf.basedb.core.ItemResultIterator" |
---|
45 | import="net.sf.basedb.core.ItemResultList" |
---|
46 | import="net.sf.basedb.core.ItemContext" |
---|
47 | import="net.sf.basedb.core.Job" |
---|
48 | import="net.sf.basedb.core.Nameable" |
---|
49 | import="net.sf.basedb.core.Permission" |
---|
50 | import="net.sf.basedb.core.PluginDefinition" |
---|
51 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
52 | import="net.sf.basedb.core.Quantity" |
---|
53 | import="net.sf.basedb.core.Unit" |
---|
54 | import="net.sf.basedb.core.query.Hql" |
---|
55 | import="net.sf.basedb.core.query.Restrictions" |
---|
56 | import="net.sf.basedb.core.query.Expressions" |
---|
57 | import="net.sf.basedb.core.query.Orders" |
---|
58 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
59 | import="net.sf.basedb.core.plugin.Plugin" |
---|
60 | import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil" |
---|
61 | import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
---|
62 | import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
---|
63 | import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
---|
64 | import="net.sf.basedb.core.snapshot.SnapshotManager" |
---|
65 | import="net.sf.basedb.util.Enumeration" |
---|
66 | import="net.sf.basedb.util.ShareableUtil" |
---|
67 | import="net.sf.basedb.util.formatter.Formatter" |
---|
68 | import="net.sf.basedb.util.units.UnitUtil" |
---|
69 | import="net.sf.basedb.clients.web.Base" |
---|
70 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
71 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
72 | import="net.sf.basedb.clients.web.util.HTML" |
---|
73 | import="net.sf.basedb.util.Values" |
---|
74 | import="net.sf.basedb.util.formatter.Formatter" |
---|
75 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
76 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
77 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
78 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
79 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
80 | import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
---|
81 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
82 | import="java.util.Iterator" |
---|
83 | import="java.util.List" |
---|
84 | import="java.util.Map" |
---|
85 | import="java.util.Date" |
---|
86 | import="java.util.ArrayList" |
---|
87 | %> |
---|
88 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
89 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
90 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
91 | <%! |
---|
92 | private static final Item itemType = Item.RAWBIOASSAY; |
---|
93 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
94 | %> |
---|
95 | <% |
---|
96 | final String root = request.getContextPath()+"/"; |
---|
97 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
98 | final String ID = sc.getId(); |
---|
99 | final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
---|
100 | final boolean readPermission = sc.hasPermission(Permission.READ, itemType); |
---|
101 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
102 | |
---|
103 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
104 | final String callback = request.getParameter("callback"); |
---|
105 | final String title = mode.generateTitle("raw bioassay", "raw bioassays"); |
---|
106 | final DbControl dc = sc.newDbControl(); |
---|
107 | ItemResultIterator<RawBioAssay> rawBioAssays = null; |
---|
108 | List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>(); |
---|
109 | try |
---|
110 | { |
---|
111 | ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
---|
112 | SnapshotManager manager = new SnapshotManager(); |
---|
113 | for (AnnotationType at : annotationTypeQuery.list(dc)) |
---|
114 | { |
---|
115 | annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at)); |
---|
116 | } |
---|
117 | annotationTypeQuery = Base.getInheritedAnnotationColumns(cc.getSetting("columns")); |
---|
118 | for (AnnotationType at : annotationTypeQuery.list(dc)) |
---|
119 | { |
---|
120 | annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at, false, true)); |
---|
121 | } |
---|
122 | |
---|
123 | // Query for experiments relatated to the current raw bioassay |
---|
124 | final ItemQuery<Experiment> experimentQuery = Experiment.getQuery(); |
---|
125 | experimentQuery.include(cc.getInclude()); |
---|
126 | experimentQuery.join(Hql.innerJoin("rawBioAssays", "rba")); |
---|
127 | experimentQuery.restrict(Restrictions.eq(Hql.alias("rba"), Expressions.parameter("rawBioAssay"))); |
---|
128 | experimentQuery.order(Orders.asc(Hql.property("name"))); |
---|
129 | |
---|
130 | // Get all platforms |
---|
131 | final ItemQuery<Platform> platformQuery = Platform.getQuery(); |
---|
132 | platformQuery.include(cc.getInclude()); |
---|
133 | platformQuery.order(Orders.asc(Hql.property("name"))); |
---|
134 | platformQuery.setCacheResult(true); |
---|
135 | Enumeration<String, String> platforms = new Enumeration<String, String>(); |
---|
136 | for (Platform p : platformQuery.list(dc)) |
---|
137 | { |
---|
138 | platforms.add(Integer.toString(p.getId()), p.getName()); |
---|
139 | } |
---|
140 | |
---|
141 | Unit bytes = UnitUtil.getUnit(dc, Quantity.STORAGE_SIZE, "B"); |
---|
142 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
143 | try |
---|
144 | { |
---|
145 | final ItemQuery<RawBioAssay> query = Base.getConfiguredQuery(dc, cc, true, RawBioAssay.getQuery(), mode); |
---|
146 | rawBioAssays = query.iterate(dc); |
---|
147 | } |
---|
148 | catch (Throwable t) |
---|
149 | { |
---|
150 | t.printStackTrace(); |
---|
151 | cc.setMessage(t.getMessage()); |
---|
152 | } |
---|
153 | Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
---|
154 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
155 | int numListed = 0; |
---|
156 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
---|
157 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
158 | ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
---|
159 | %> |
---|
160 | <base:page title="<%=title==null ? "Raw bioassays" : title%>" type="<%=mode.getPageType()%>" id="list-page"> |
---|
161 | <base:head scripts="table.js,~bioassays.js" styles="table.css,toolbar.css"> |
---|
162 | <ext:scripts context="<%=jspContext%>" /> |
---|
163 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
164 | </base:head> |
---|
165 | |
---|
166 | <base:body> |
---|
167 | <h1><%=title==null ? "Raw bioassays" : title%></h1> |
---|
168 | <div class="content"> |
---|
169 | <tbl:table |
---|
170 | id="rawbioassays" |
---|
171 | columns="<%=cc.getSetting("columns")%>" |
---|
172 | sortby="<%=cc.getSortProperty()%>" |
---|
173 | direction="<%=cc.getSortDirection()%>" |
---|
174 | action="index.jsp" |
---|
175 | sc="<%=sc%>" |
---|
176 | item="<%=itemType%>" |
---|
177 | subclass="fulltable" |
---|
178 | filterrows="<%=cc.getFilterRows()%>" |
---|
179 | data-inherited-annotations="true" |
---|
180 | > |
---|
181 | <tbl:hidden |
---|
182 | name="mode" |
---|
183 | value="<%=mode.getName()%>" |
---|
184 | /> |
---|
185 | <tbl:hidden |
---|
186 | name="callback" |
---|
187 | value="<%=callback%>" |
---|
188 | skip="<%=callback == null%>" |
---|
189 | /> |
---|
190 | <tbl:columndef |
---|
191 | id="name" |
---|
192 | property="name" |
---|
193 | datatype="string" |
---|
194 | title="Name" |
---|
195 | sortable="true" |
---|
196 | filterable="true" |
---|
197 | exportable="true" |
---|
198 | show="always" |
---|
199 | /> |
---|
200 | <tbl:columndef |
---|
201 | id="id" |
---|
202 | clazz="uniquecol" |
---|
203 | property="id" |
---|
204 | datatype="int" |
---|
205 | title="ID" |
---|
206 | sortable="true" |
---|
207 | filterable="true" |
---|
208 | exportable="true" |
---|
209 | /> |
---|
210 | <tbl:columndef |
---|
211 | id="entryDate" |
---|
212 | property="entryDate" |
---|
213 | datatype="date" |
---|
214 | title="Registered" |
---|
215 | sortable="true" |
---|
216 | filterable="true" |
---|
217 | exportable="true" |
---|
218 | formatter="<%=dateFormatter%>" |
---|
219 | /> |
---|
220 | <tbl:columndef |
---|
221 | id="platform" |
---|
222 | property="platform" |
---|
223 | sortproperty="platform.name" |
---|
224 | exportproperty="platform.name:string" |
---|
225 | datatype="int" |
---|
226 | enumeration="<%=platforms%>" |
---|
227 | title="Platform" |
---|
228 | sortable="true" |
---|
229 | filterable="true" |
---|
230 | exportable="true" |
---|
231 | /> |
---|
232 | <tbl:columndef |
---|
233 | id="variant" |
---|
234 | property="variant.name" |
---|
235 | datatype="string" |
---|
236 | title="Variant" |
---|
237 | sortable="true" |
---|
238 | filterable="true" |
---|
239 | exportable="true" |
---|
240 | /> |
---|
241 | <% |
---|
242 | Enumeration<String, String> rawEnumeration = new Enumeration<String, String>(); |
---|
243 | for (RawDataType rdt : RawDataTypes.getRawDataTypes()) |
---|
244 | { |
---|
245 | rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName())); |
---|
246 | } |
---|
247 | rawEnumeration.sortValues(); |
---|
248 | %> |
---|
249 | <tbl:columndef |
---|
250 | id="rawDataType" |
---|
251 | property="rawDataType" |
---|
252 | datatype="string" |
---|
253 | enumeration="<%=rawEnumeration%>" |
---|
254 | title="Raw data type" |
---|
255 | sortable="true" |
---|
256 | filterable="true" |
---|
257 | exportable="true" |
---|
258 | /> |
---|
259 | <tbl:columndef |
---|
260 | id="hasData" |
---|
261 | property="hasData" |
---|
262 | datatype="boolean" |
---|
263 | title="Has data" |
---|
264 | sortable="true" |
---|
265 | filterable="true" |
---|
266 | exportable="true" |
---|
267 | /> |
---|
268 | <tbl:columndef |
---|
269 | id="spots" |
---|
270 | property="spots" |
---|
271 | datatype="int" |
---|
272 | title="Db spots" |
---|
273 | sortable="true" |
---|
274 | filterable="true" |
---|
275 | exportable="true" |
---|
276 | /> |
---|
277 | <tbl:columndef |
---|
278 | id="numFileSpots" |
---|
279 | property="numFileSpots" |
---|
280 | datatype="int" |
---|
281 | title="File spots" |
---|
282 | sortable="true" |
---|
283 | filterable="true" |
---|
284 | exportable="true" |
---|
285 | /> |
---|
286 | <tbl:columndef |
---|
287 | id="bytes" |
---|
288 | property="bytes" |
---|
289 | datatype="long" |
---|
290 | title="Bytes" |
---|
291 | sortable="true" |
---|
292 | filterable="true" |
---|
293 | exportable="true" |
---|
294 | unit="<%=bytes%>" |
---|
295 | /> |
---|
296 | <tbl:columndef |
---|
297 | id="parentBioAssay" |
---|
298 | property="parentBioAssay.name" |
---|
299 | datatype="string" |
---|
300 | title="Parent bioassay" |
---|
301 | sortable="true" |
---|
302 | filterable="true" |
---|
303 | exportable="true" |
---|
304 | /> |
---|
305 | <tbl:columndef |
---|
306 | id="parentExtract" |
---|
307 | property="parentExtract.name" |
---|
308 | datatype="string" |
---|
309 | title="Parent extract" |
---|
310 | sortable="true" |
---|
311 | filterable="true" |
---|
312 | exportable="true" |
---|
313 | /> |
---|
314 | <tbl:columndef |
---|
315 | id="software" |
---|
316 | property="software.name" |
---|
317 | datatype="string" |
---|
318 | title="Software" |
---|
319 | sortable="true" |
---|
320 | filterable="true" |
---|
321 | exportable="true" |
---|
322 | /> |
---|
323 | <tbl:columndef |
---|
324 | id="protocol" |
---|
325 | property="protocol.name" |
---|
326 | datatype="string" |
---|
327 | title="Protocol" |
---|
328 | sortable="true" |
---|
329 | filterable="true" |
---|
330 | exportable="true" |
---|
331 | /> |
---|
332 | <tbl:columndef |
---|
333 | id="arrayDesign" |
---|
334 | property="arrayDesign.name" |
---|
335 | datatype="string" |
---|
336 | title="Array design" |
---|
337 | sortable="true" |
---|
338 | filterable="true" |
---|
339 | exportable="true" |
---|
340 | /> |
---|
341 | <tbl:columndef |
---|
342 | id="plugin" |
---|
343 | property="job.pluginDefinition.name" |
---|
344 | datatype="string" |
---|
345 | title="Plugin" |
---|
346 | sortable="true" |
---|
347 | filterable="true" |
---|
348 | exportable="true" |
---|
349 | tooltip="The plug-in that was used to import raw data" |
---|
350 | /> |
---|
351 | <tbl:columndef |
---|
352 | id="configuration" |
---|
353 | property="job.pluginConfiguration.name" |
---|
354 | datatype="string" |
---|
355 | title="Configuration" |
---|
356 | sortable="true" |
---|
357 | filterable="true" |
---|
358 | exportable="true" |
---|
359 | tooltip="The configuration/file format that was used to import raw data" |
---|
360 | /> |
---|
361 | <tbl:columndef |
---|
362 | id="importdate" |
---|
363 | property="job.ended" |
---|
364 | datatype="date" |
---|
365 | title="Import date" |
---|
366 | sortable="true" |
---|
367 | filterable="true" |
---|
368 | exportable="true" |
---|
369 | tooltip="The date and time of the raw data import" |
---|
370 | formatter="<%=dateTimeFormatter%>" |
---|
371 | /> |
---|
372 | <tbl:columndef |
---|
373 | id="experiments" |
---|
374 | title="Experiments" |
---|
375 | property="&experiments(name)" |
---|
376 | datatype="string" |
---|
377 | filterable="true" |
---|
378 | exportable="true" |
---|
379 | /> |
---|
380 | <tbl:columndef |
---|
381 | id="files" |
---|
382 | title="Files" |
---|
383 | property="&fileSet.members(file.name)" |
---|
384 | datatype="string" |
---|
385 | filterable="true" |
---|
386 | exportable="true" |
---|
387 | /> |
---|
388 | <tbl:columndef |
---|
389 | id="owner" |
---|
390 | property="owner.name" |
---|
391 | datatype="string" |
---|
392 | title="Owner" |
---|
393 | sortable="true" |
---|
394 | filterable="true" |
---|
395 | exportable="true" |
---|
396 | /> |
---|
397 | <tbl:columndef |
---|
398 | id="description" |
---|
399 | property="description" |
---|
400 | datatype="string" |
---|
401 | title="Description" |
---|
402 | sortable="true" |
---|
403 | filterable="true" |
---|
404 | exportable="true" |
---|
405 | /> |
---|
406 | <% |
---|
407 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
408 | { |
---|
409 | AnnotationType at = loader.getAnnotationType(); |
---|
410 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
411 | Enumeration<String, String> annotationEnum = null; |
---|
412 | if (at.isEnumeration()) |
---|
413 | { |
---|
414 | annotationEnum = new Enumeration<String, String>(); |
---|
415 | List<?> values = at.getValues(); |
---|
416 | for (Object value : values) |
---|
417 | { |
---|
418 | String encoded = HTML.encodeTags(value.toString()); |
---|
419 | annotationEnum.add(encoded, encoded); |
---|
420 | } |
---|
421 | } |
---|
422 | %> |
---|
423 | <tbl:columndef |
---|
424 | id="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+at.getId()%>" |
---|
425 | title="<%=HTML.encodeTags(at.getName())+(loader.isSearchingInheritedAnnotations() ? " [I]" : " [A]")%>" |
---|
426 | property="<%=(loader.isSearchingInheritedAnnotations() ? "##" : "#")+at.getId()%>" |
---|
427 | annotation="true" |
---|
428 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
429 | enumeration="<%=annotationEnum%>" |
---|
430 | smartenum="<%=at.getDisplayAsList() %>" |
---|
431 | sortable="<%=at.getMultiplicity() == 1 && !loader.isSearchingInheritedAnnotations()%>" |
---|
432 | filterable="true" |
---|
433 | exportable="true" |
---|
434 | formatter="<%=formatter%>" |
---|
435 | unit="<%=at.getDefaultUnit()%>" |
---|
436 | /> |
---|
437 | <% |
---|
438 | } |
---|
439 | %> |
---|
440 | <tbl:columndef |
---|
441 | id="permission" |
---|
442 | title="Permission" |
---|
443 | /> |
---|
444 | <tbl:columndef |
---|
445 | id="sharedTo" |
---|
446 | title="Shared to" |
---|
447 | filterable="true" |
---|
448 | filterproperty="!sharedTo.name" |
---|
449 | datatype="string" |
---|
450 | /> |
---|
451 | <tbl:columndef |
---|
452 | id="xt-columns" |
---|
453 | extensions="<%=columnsInvoker%>" |
---|
454 | jspcontext="<%=jspContext%>" |
---|
455 | /> |
---|
456 | <div class="panelgroup bg-filled-50 bottomborder"> |
---|
457 | <tbl:toolbar |
---|
458 | subclass="bottomborder" |
---|
459 | visible="<%=mode.hasToolbar()%>" |
---|
460 | > |
---|
461 | <tbl:button |
---|
462 | id="btnNewItem" |
---|
463 | disabled="<%=!createPermission%>" |
---|
464 | image="new.png" |
---|
465 | title="New…" |
---|
466 | tooltip="<%=createPermission ? "Create new raw bioassay" : "You do not have permission to create raw bioassays"%>" |
---|
467 | /> |
---|
468 | <tbl:button |
---|
469 | id="btnDeleteItems" |
---|
470 | image="delete.png" |
---|
471 | title="Delete" |
---|
472 | tooltip="Delete the selected items" |
---|
473 | /> |
---|
474 | <tbl:button |
---|
475 | id="btnRestoreItems" |
---|
476 | image="restore.png" |
---|
477 | title="Restore" |
---|
478 | tooltip="Restore the selected (deleted) items" |
---|
479 | /> |
---|
480 | <tbl:button |
---|
481 | id="btnShareItems" |
---|
482 | image="share.png" |
---|
483 | title="Share…" |
---|
484 | tooltip="Share the selected items" |
---|
485 | /> |
---|
486 | <tbl:button |
---|
487 | id="btnSetOwner" |
---|
488 | image="take_ownership.png" |
---|
489 | title="Set owner…" |
---|
490 | tooltip="Change owner of the selected items" |
---|
491 | /> |
---|
492 | <tbl:button |
---|
493 | id="btnColumns" |
---|
494 | image="columns.png" |
---|
495 | title="Columns…" |
---|
496 | tooltip="Show, hide and re-order columns" |
---|
497 | /> |
---|
498 | <tbl:button |
---|
499 | id="btnNewExperiment" |
---|
500 | image="add.png" |
---|
501 | title="New experiment…" |
---|
502 | tooltip="Create a new experiment from the selected raw bioassays" |
---|
503 | visible="<%=sc.hasPermission(Permission.CREATE, Item.EXPERIMENT)%>" |
---|
504 | /> |
---|
505 | <tbl:button |
---|
506 | id="btnInheritAnnotations" |
---|
507 | image="inherit.png" |
---|
508 | title="Inherit annotations…" |
---|
509 | tooltip="Batch inherit annotations from parent items" |
---|
510 | /> |
---|
511 | <tbl:button |
---|
512 | id="btnImport" |
---|
513 | data-plugin-type="IMPORT" |
---|
514 | image="import.png" |
---|
515 | title="Import…" |
---|
516 | tooltip="Import data" |
---|
517 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
518 | /> |
---|
519 | <tbl:button |
---|
520 | id="btnExport" |
---|
521 | data-plugin-type="EXPORT" |
---|
522 | image="export.png" |
---|
523 | title="Export…" |
---|
524 | tooltip="Export data" |
---|
525 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
526 | /> |
---|
527 | <tbl:button |
---|
528 | id="btnRunPlugin" |
---|
529 | data-plugin-type="OTHER" |
---|
530 | image="runplugin.png" |
---|
531 | title="Run plugin…" |
---|
532 | tooltip="Run a plugin" |
---|
533 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
534 | /> |
---|
535 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
536 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
537 | </tbl:toolbar> |
---|
538 | <tbl:panel> |
---|
539 | <tbl:presetselector /> |
---|
540 | <tbl:navigator |
---|
541 | page="<%=cc.getPage()%>" |
---|
542 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
543 | totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" |
---|
544 | visible="<%=mode.hasNavigator()%>" |
---|
545 | /> |
---|
546 | </tbl:panel> |
---|
547 | </div> |
---|
548 | <tbl:data> |
---|
549 | <tbl:headers> |
---|
550 | <tbl:headerrow> |
---|
551 | <tbl:header colspan="3" /> |
---|
552 | <tbl:columnheaders /> |
---|
553 | </tbl:headerrow> |
---|
554 | <% |
---|
555 | int numFilters = cc.getNumPropertyFilters(); |
---|
556 | int numRows = cc.getFilterRows(); |
---|
557 | for (int filterNo = 0; filterNo < numRows; filterNo++) |
---|
558 | { |
---|
559 | boolean lastRow = filterNo == numRows-1; |
---|
560 | %> |
---|
561 | <tbl:headerrow> |
---|
562 | <tbl:header subclass="index" /> |
---|
563 | <tbl:header |
---|
564 | subclass="check" |
---|
565 | visible="<%=mode.hasCheck()%>" |
---|
566 | ><base:icon |
---|
567 | id="check.uncheck" |
---|
568 | image="check_uncheck.png" |
---|
569 | tooltip="Check/uncheck all" |
---|
570 | visible="<%=lastRow%>" |
---|
571 | /></tbl:header> |
---|
572 | <tbl:header |
---|
573 | subclass="check" |
---|
574 | visible="<%=mode.hasRadio()%>" |
---|
575 | /> |
---|
576 | <tbl:header |
---|
577 | subclass="icons" |
---|
578 | visible="<%=mode.hasIcons()%>" |
---|
579 | > |
---|
580 | <base:icon |
---|
581 | subclass="link table-filter-row-action" |
---|
582 | image="add.png" |
---|
583 | tooltip="Add extra filter row" |
---|
584 | visible="<%=lastRow%>" |
---|
585 | /><base:icon |
---|
586 | subclass="link table-filter-row-action" |
---|
587 | image="remove.png" |
---|
588 | tooltip="Remove this filter row" |
---|
589 | visible="<%=numRows > 1 || numFilters > 0 %>" |
---|
590 | data-remove-row="<%=filterNo%>" |
---|
591 | /> |
---|
592 | </tbl:header> |
---|
593 | <tbl:propertyfilter row="<%=filterNo%>" /> |
---|
594 | </tbl:headerrow> |
---|
595 | <% |
---|
596 | } |
---|
597 | %> |
---|
598 | </tbl:headers> |
---|
599 | <tbl:rows> |
---|
600 | <% |
---|
601 | if (cc.getMessage() != null) |
---|
602 | { |
---|
603 | %> |
---|
604 | <tbl:panel subclass="bg-filled-50"> |
---|
605 | <div class="messagecontainer error"><%=cc.getMessage()%></div> |
---|
606 | </tbl:panel> |
---|
607 | <% |
---|
608 | cc.setMessage(null); |
---|
609 | } |
---|
610 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
611 | int selectedItemId = cc.getId(); |
---|
612 | if (rawBioAssays != null) |
---|
613 | { |
---|
614 | while (rawBioAssays.hasNext()) |
---|
615 | { |
---|
616 | RawBioAssay item = rawBioAssays.next(); |
---|
617 | Job job = null; |
---|
618 | try |
---|
619 | { |
---|
620 | job = item.getJob(); |
---|
621 | } |
---|
622 | catch (Throwable t) |
---|
623 | {} |
---|
624 | int itemId = item.getId(); |
---|
625 | |
---|
626 | |
---|
627 | boolean deletePermission = item.hasPermission(Permission.DELETE); |
---|
628 | boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
---|
629 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
630 | String tooltip = mode.isSelectionMode() ? |
---|
631 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
632 | String name = HTML.encodeTags(item.getName()); |
---|
633 | index++; |
---|
634 | numListed++; |
---|
635 | %> |
---|
636 | <tbl:row> |
---|
637 | <tbl:header |
---|
638 | clazz="index" |
---|
639 | ><%=index%></tbl:header> |
---|
640 | <tbl:header |
---|
641 | clazz="check" |
---|
642 | visible="<%=mode.hasCheck()%>" |
---|
643 | ><input |
---|
644 | type="checkbox" |
---|
645 | name="<%=itemId%>" |
---|
646 | value="<%=itemId%>" |
---|
647 | title="<%=name%>" |
---|
648 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
649 | ></tbl:header> |
---|
650 | <tbl:header |
---|
651 | clazz="check" |
---|
652 | visible="<%=mode.hasRadio()%>" |
---|
653 | ><input |
---|
654 | type="radio" |
---|
655 | name="item_id" |
---|
656 | value="<%=itemId%>" |
---|
657 | title="<%=name%>" |
---|
658 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
659 | ></tbl:header> |
---|
660 | <tbl:header |
---|
661 | clazz="icons" |
---|
662 | visible="<%=mode.hasIcons()%>" |
---|
663 | ><base:icon |
---|
664 | image="deleted.png" |
---|
665 | id="<%="delete."+itemId %>" |
---|
666 | subclass="<%=deletePermission ? "table-delete-item" : null %>" |
---|
667 | data-item-id="<%=itemId%>" |
---|
668 | tooltip="This item has been scheduled for deletion" |
---|
669 | visible="<%=item.isRemoved()%>" |
---|
670 | /><base:icon |
---|
671 | image="shared.png" |
---|
672 | id="<%="share."+itemId %>" |
---|
673 | subclass="<%=sharePermission ? "table-share-item" : null %>" |
---|
674 | data-item-id="<%=itemId%>" |
---|
675 | tooltip="This item is shared to other users, groups and/or projects" |
---|
676 | visible="<%=item.isShared()%>" |
---|
677 | /> </tbl:header> |
---|
678 | <tbl:cell column="name"><div |
---|
679 | class="link table-item" |
---|
680 | data-item-id="<%=itemId%>" |
---|
681 | data-no-edit="<%=writePermission ? 0 : 1 %>" |
---|
682 | tabindex="0" |
---|
683 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
684 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
685 | <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" /> |
---|
686 | <tbl:cell column="spots"><%=item.getNumDbSpots()%></tbl:cell> |
---|
687 | <tbl:cell column="numFileSpots"><%=item.getNumFileSpots()%></tbl:cell> |
---|
688 | <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell> |
---|
689 | <tbl:cell column="platform" |
---|
690 | ><base:propertyvalue |
---|
691 | item="<%=item%>" |
---|
692 | property="platform" |
---|
693 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
694 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
695 | /></tbl:cell> |
---|
696 | <tbl:cell column="variant" |
---|
697 | ><base:propertyvalue |
---|
698 | item="<%=item%>" |
---|
699 | property="variant" |
---|
700 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
701 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
702 | /></tbl:cell> |
---|
703 | <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell> |
---|
704 | <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell> |
---|
705 | <tbl:cell column="parentBioAssay" |
---|
706 | ><base:propertyvalue |
---|
707 | item="<%=item%>" |
---|
708 | property="parentBioAssay" |
---|
709 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
710 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
711 | /></tbl:cell> |
---|
712 | <tbl:cell column="parentExtract" |
---|
713 | ><base:propertyvalue |
---|
714 | item="<%=item%>" |
---|
715 | property="parentExtract" |
---|
716 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
717 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
718 | /></tbl:cell> |
---|
719 | <tbl:cell column="software" |
---|
720 | ><base:propertyvalue |
---|
721 | item="<%=item%>" |
---|
722 | property="software" |
---|
723 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
724 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
725 | /></tbl:cell> |
---|
726 | <tbl:cell column="protocol" |
---|
727 | ><base:propertyvalue |
---|
728 | item="<%=item%>" |
---|
729 | property="protocol" |
---|
730 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
731 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
732 | /></tbl:cell> |
---|
733 | <tbl:cell column="arrayDesign" |
---|
734 | ><base:propertyvalue |
---|
735 | item="<%=item%>" |
---|
736 | property="arrayDesign" |
---|
737 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
738 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
739 | /></tbl:cell> |
---|
740 | <tbl:cell column="plugin"> |
---|
741 | <base:propertyvalue |
---|
742 | item="<%=item%>" |
---|
743 | property="job.pluginDefinition" |
---|
744 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
745 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
746 | /> |
---|
747 | </tbl:cell> |
---|
748 | <tbl:cell column="configuration"> |
---|
749 | <base:propertyvalue |
---|
750 | item="<%=item%>" |
---|
751 | property="job.pluginConfiguration" |
---|
752 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
753 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
754 | /> |
---|
755 | </tbl:cell> |
---|
756 | <tbl:cell |
---|
757 | column="importdate" |
---|
758 | value="<%=job == null ? null : job.getEnded() %>" |
---|
759 | /> |
---|
760 | <tbl:cell column="files"> |
---|
761 | <% |
---|
762 | if (item.hasFileSet()) |
---|
763 | { |
---|
764 | for (FileSetMember member : item.getFileSet().getMembers().list(dc)) |
---|
765 | { |
---|
766 | try |
---|
767 | { |
---|
768 | %> |
---|
769 | <%=Base.getLinkedFile(ID, member.getFile(), false, true, true, root) %><br> |
---|
770 | <% |
---|
771 | } |
---|
772 | catch (PermissionDeniedException ex) |
---|
773 | {} |
---|
774 | } |
---|
775 | } |
---|
776 | else |
---|
777 | { |
---|
778 | %> |
---|
779 | <i>- none -</i> |
---|
780 | <% |
---|
781 | } |
---|
782 | %> |
---|
783 | </tbl:cell> |
---|
784 | <tbl:cell column="experiments"> |
---|
785 | <% |
---|
786 | experimentQuery.setParameter("rawBioAssay", itemId, Type.INT); |
---|
787 | try |
---|
788 | { |
---|
789 | String separator = ""; |
---|
790 | for (Experiment e : experimentQuery.list(dc)) |
---|
791 | { |
---|
792 | out.write(separator); |
---|
793 | if (mode.hasPropertyLink()) |
---|
794 | { |
---|
795 | out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink())); |
---|
796 | } |
---|
797 | else |
---|
798 | { |
---|
799 | out.write(HTML.encodeTags(e.getName())); |
---|
800 | } |
---|
801 | separator = ", "; |
---|
802 | } |
---|
803 | } |
---|
804 | catch (Throwable t) |
---|
805 | { |
---|
806 | %> |
---|
807 | <div class="error"><%=t.getMessage()%></div> |
---|
808 | <% |
---|
809 | } |
---|
810 | %> |
---|
811 | </tbl:cell> |
---|
812 | <tbl:cell column="owner" |
---|
813 | ><base:propertyvalue |
---|
814 | item="<%=item%>" |
---|
815 | property="owner" |
---|
816 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
817 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
818 | /></tbl:cell> |
---|
819 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
820 | <% |
---|
821 | if (item.isAnnotated()) |
---|
822 | { |
---|
823 | AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId()); |
---|
824 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
825 | { |
---|
826 | if (loader.find(snapshot)) |
---|
827 | { |
---|
828 | %> |
---|
829 | <tbl:cell |
---|
830 | column="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+loader.getId()%>" |
---|
831 | ><tbl:cellvalue |
---|
832 | list="<%=loader.getValues()%>" |
---|
833 | suffix="<%=loader.getUnitSymbol()%>" |
---|
834 | /></tbl:cell> |
---|
835 | <% |
---|
836 | } |
---|
837 | } |
---|
838 | } |
---|
839 | %> |
---|
840 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
841 | <tbl:cell column="sharedTo"> |
---|
842 | <% |
---|
843 | Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); |
---|
844 | while(sharees.hasNext()) |
---|
845 | { |
---|
846 | Nameable n = sharees.next(); |
---|
847 | if (mode.hasPropertyLink()) |
---|
848 | { |
---|
849 | out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); |
---|
850 | } |
---|
851 | else |
---|
852 | { |
---|
853 | out.write(HTML.encodeTags(n.getName())); |
---|
854 | } |
---|
855 | out.write(sharees.hasNext() ? ", " : ""); |
---|
856 | } |
---|
857 | %> |
---|
858 | </tbl:cell> |
---|
859 | <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
---|
860 | <tbl:cell column="xt-columns" /> |
---|
861 | </tbl:xt-cells> |
---|
862 | </tbl:row> |
---|
863 | <% |
---|
864 | } |
---|
865 | } |
---|
866 | if (numListed == 0) |
---|
867 | { |
---|
868 | %> |
---|
869 | <tbl:panel subclass="bg-filled-50"> |
---|
870 | <div class="messagecontainer note"> |
---|
871 | <%=rawBioAssays == null || rawBioAssays.getTotalCount() == 0 ? "No raw bioassays were found" : "No raw bioassays on this page. Please select another page!" %> |
---|
872 | </div> |
---|
873 | </tbl:panel> |
---|
874 | <% |
---|
875 | } |
---|
876 | %> |
---|
877 | </tbl:rows> |
---|
878 | </tbl:data> |
---|
879 | </tbl:table> |
---|
880 | </div> |
---|
881 | |
---|
882 | <base:buttongroup subclass="dialogbuttons"> |
---|
883 | <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
884 | <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
885 | <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
886 | </base:buttongroup> |
---|
887 | |
---|
888 | </base:body> |
---|
889 | </base:page> |
---|
890 | <% |
---|
891 | } |
---|
892 | finally |
---|
893 | { |
---|
894 | if (rawBioAssays != null) rawBioAssays.close(); |
---|
895 | if (dc != null) dc.close(); |
---|
896 | } |
---|
897 | %> |
---|