1 | <%-- $Id: list_experiments.jsp 5951 2012-02-09 14:19:17Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
4 | Copyright (C) 2007 Johan Enell, Martin Svensson |
---|
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.Experiment" |
---|
31 | import="net.sf.basedb.core.RawDataType" |
---|
32 | import="net.sf.basedb.core.RawDataTypes" |
---|
33 | import="net.sf.basedb.core.ItemQuery" |
---|
34 | import="net.sf.basedb.core.Include" |
---|
35 | import="net.sf.basedb.core.ItemResultIterator" |
---|
36 | import="net.sf.basedb.core.ItemResultList" |
---|
37 | import="net.sf.basedb.core.ItemContext" |
---|
38 | import="net.sf.basedb.core.Nameable" |
---|
39 | import="net.sf.basedb.core.Permission" |
---|
40 | import="net.sf.basedb.core.PluginDefinition" |
---|
41 | import="net.sf.basedb.core.Quantity" |
---|
42 | import="net.sf.basedb.core.Unit" |
---|
43 | import="net.sf.basedb.core.query.Hql" |
---|
44 | import="net.sf.basedb.core.query.Restrictions" |
---|
45 | import="net.sf.basedb.core.query.Expressions" |
---|
46 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
47 | import="net.sf.basedb.core.plugin.Plugin" |
---|
48 | import="net.sf.basedb.util.Enumeration" |
---|
49 | import="net.sf.basedb.util.ShareableUtil" |
---|
50 | import="net.sf.basedb.util.units.UnitUtil" |
---|
51 | import="net.sf.basedb.clients.web.Base" |
---|
52 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
53 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
54 | import="net.sf.basedb.clients.web.util.HTML" |
---|
55 | import="net.sf.basedb.util.Values" |
---|
56 | import="net.sf.basedb.util.formatter.Formatter" |
---|
57 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
58 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
59 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
60 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
61 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
62 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
63 | import="java.util.Iterator" |
---|
64 | import="java.util.List" |
---|
65 | import="java.util.Map" |
---|
66 | import="java.util.Date" |
---|
67 | %> |
---|
68 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
69 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
70 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
71 | <%! |
---|
72 | private static final Item itemType = Item.EXPERIMENT; |
---|
73 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
74 | %> |
---|
75 | <% |
---|
76 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
77 | final String ID = sc.getId(); |
---|
78 | final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
---|
79 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
80 | |
---|
81 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
82 | final String callback = request.getParameter("callback"); |
---|
83 | final String title = mode.generateTitle("experiment", "experiments"); |
---|
84 | final DbControl dc = sc.newDbControl(); |
---|
85 | ItemResultIterator<Experiment> experiments = null; |
---|
86 | try |
---|
87 | { |
---|
88 | Unit bytes = UnitUtil.getUnit(dc, Quantity.STORAGE_SIZE, "B"); |
---|
89 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
90 | try |
---|
91 | { |
---|
92 | final ItemQuery<Experiment> query = Base.getConfiguredQuery(dc, cc, true, Experiment.getQuery(), mode); |
---|
93 | experiments = query.iterate(dc); |
---|
94 | } |
---|
95 | catch (Throwable t) |
---|
96 | { |
---|
97 | cc.setMessage(t.getMessage()); |
---|
98 | } |
---|
99 | int numListed = 0; |
---|
100 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
101 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
---|
102 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
103 | %> |
---|
104 | <base:page title="<%=title==null ? "Experiments" : title%>" type="<%=mode.getPageType()%>"> |
---|
105 | <base:head scripts="menu.js,table.js" styles="menu.css,table.css,toolbar.css"> |
---|
106 | <ext:scripts context="<%=jspContext%>" /> |
---|
107 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
108 | <script language="JavaScript"> |
---|
109 | var submitPage = 'index.jsp'; |
---|
110 | var formId = 'experiments'; |
---|
111 | function newItem() |
---|
112 | { |
---|
113 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true); |
---|
114 | } |
---|
115 | function editItem(itemId) |
---|
116 | { |
---|
117 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); |
---|
118 | } |
---|
119 | function viewItem(itemId) |
---|
120 | { |
---|
121 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); |
---|
122 | } |
---|
123 | function itemOnClick(evt, itemId) |
---|
124 | { |
---|
125 | Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected); |
---|
126 | } |
---|
127 | function deleteItems() |
---|
128 | { |
---|
129 | var frm = document.forms[formId]; |
---|
130 | if (Forms.numChecked(frm) == 0) |
---|
131 | { |
---|
132 | alert('Please select at least one item in the list'); |
---|
133 | return; |
---|
134 | } |
---|
135 | frm.action = submitPage; |
---|
136 | frm.cmd.value = 'DeleteItems'; |
---|
137 | frm.submit(); |
---|
138 | } |
---|
139 | function restoreItems() |
---|
140 | { |
---|
141 | var frm = document.forms[formId]; |
---|
142 | if (Forms.numChecked(frm) == 0) |
---|
143 | { |
---|
144 | alert('Please select at least one item in the list'); |
---|
145 | return; |
---|
146 | } |
---|
147 | frm.action = submitPage; |
---|
148 | frm.cmd.value = 'RestoreItems'; |
---|
149 | frm.submit(); |
---|
150 | } |
---|
151 | function setOwner() |
---|
152 | { |
---|
153 | Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); |
---|
154 | } |
---|
155 | function deleteItemPermanently(itemId) |
---|
156 | { |
---|
157 | Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); |
---|
158 | } |
---|
159 | function shareItem(itemId) |
---|
160 | { |
---|
161 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'SharedExperiments', 600, 400); |
---|
162 | } |
---|
163 | function shareItems() |
---|
164 | { |
---|
165 | Table.shareItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'ShareItems'); |
---|
166 | } |
---|
167 | function configureColumns() |
---|
168 | { |
---|
169 | Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
170 | } |
---|
171 | function runPlugin(cmd) |
---|
172 | { |
---|
173 | Table.submitToPopup(formId, cmd, 750, 500); |
---|
174 | } |
---|
175 | function returnSelected() |
---|
176 | { |
---|
177 | Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); |
---|
178 | window.close(); |
---|
179 | } |
---|
180 | function presetOnChange() |
---|
181 | { |
---|
182 | Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
183 | } |
---|
184 | </script> |
---|
185 | </base:head> |
---|
186 | |
---|
187 | <base:body> |
---|
188 | <% |
---|
189 | if (cc.getMessage() != null) |
---|
190 | { |
---|
191 | %> |
---|
192 | <div class="error"><%=cc.getMessage()%></div> |
---|
193 | <% |
---|
194 | cc.setMessage(null); |
---|
195 | } |
---|
196 | %> |
---|
197 | <tbl:table |
---|
198 | id="experiments" |
---|
199 | |
---|
200 | columns="<%=cc.getSetting("columns")%>" |
---|
201 | sortby="<%=cc.getSortProperty()%>" |
---|
202 | direction="<%=cc.getSortDirection()%>" |
---|
203 | title="<%=title%>" |
---|
204 | action="index.jsp" |
---|
205 | sc="<%=sc%>" |
---|
206 | item="<%=itemType%>" |
---|
207 | > |
---|
208 | <tbl:hidden |
---|
209 | name="mode" |
---|
210 | value="<%=mode.getName()%>" |
---|
211 | /> |
---|
212 | <tbl:hidden |
---|
213 | name="callback" |
---|
214 | value="<%=callback%>" |
---|
215 | skip="<%=callback == null%>" |
---|
216 | /> |
---|
217 | <tbl:columndef |
---|
218 | id="name" |
---|
219 | property="name" |
---|
220 | datatype="string" |
---|
221 | title="Name" |
---|
222 | sortable="true" |
---|
223 | filterable="true" |
---|
224 | exportable="true" |
---|
225 | show="always" |
---|
226 | /> |
---|
227 | <tbl:columndef |
---|
228 | id="id" |
---|
229 | clazz="uniquecol" |
---|
230 | property="id" |
---|
231 | datatype="int" |
---|
232 | title="ID" |
---|
233 | sortable="true" |
---|
234 | filterable="true" |
---|
235 | exportable="true" |
---|
236 | /> |
---|
237 | <tbl:columndef |
---|
238 | id="entryDate" |
---|
239 | property="entryDate" |
---|
240 | datatype="date" |
---|
241 | title="Registered" |
---|
242 | sortable="true" |
---|
243 | filterable="true" |
---|
244 | exportable="true" |
---|
245 | formatter="<%=dateFormatter%>" |
---|
246 | /> |
---|
247 | <% |
---|
248 | Enumeration<String, String> rawEnumeration = new Enumeration<String, String>(); |
---|
249 | for (RawDataType rdt : RawDataTypes.getRawDataTypes()) |
---|
250 | { |
---|
251 | rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName())); |
---|
252 | } |
---|
253 | rawEnumeration.sortValues(); |
---|
254 | %> |
---|
255 | <tbl:columndef |
---|
256 | id="rawDataType" |
---|
257 | property="rawDataType" |
---|
258 | datatype="string" |
---|
259 | enumeration="<%=rawEnumeration%>" |
---|
260 | title="Raw data type" |
---|
261 | sortable="true" |
---|
262 | filterable="true" |
---|
263 | exportable="true" |
---|
264 | /> |
---|
265 | <tbl:columndef |
---|
266 | id="bytes" |
---|
267 | property="bytes" |
---|
268 | datatype="long" |
---|
269 | title="Bytes" |
---|
270 | sortable="true" |
---|
271 | filterable="true" |
---|
272 | exportable="true" |
---|
273 | unit="<%=bytes%>" |
---|
274 | /> |
---|
275 | <tbl:columndef |
---|
276 | id="directory" |
---|
277 | property="directory.name" |
---|
278 | datatype="string" |
---|
279 | title="Directory" |
---|
280 | sortable="true" |
---|
281 | filterable="true" |
---|
282 | exportable="true" |
---|
283 | /> |
---|
284 | <tbl:columndef |
---|
285 | id="reporterCloneTemplate" |
---|
286 | property="virtualDb.reporterCloneTemplate.name" |
---|
287 | datatype="string" |
---|
288 | title="Reporter clone template" |
---|
289 | sortable="true" |
---|
290 | filterable="true" |
---|
291 | exportable="true" |
---|
292 | /> |
---|
293 | <tbl:columndef |
---|
294 | id="title" |
---|
295 | property="title" |
---|
296 | datatype="string" |
---|
297 | title="Title" |
---|
298 | sortable="true" |
---|
299 | filterable="true" |
---|
300 | exportable="true" |
---|
301 | /> |
---|
302 | <tbl:columndef |
---|
303 | id="abstract" |
---|
304 | property="abstract" |
---|
305 | datatype="string" |
---|
306 | title="Abstract" |
---|
307 | sortable="true" |
---|
308 | filterable="true" |
---|
309 | exportable="true" |
---|
310 | /> |
---|
311 | <tbl:columndef |
---|
312 | id="affiliations" |
---|
313 | property="affiliations" |
---|
314 | datatype="string" |
---|
315 | title="Affiliations" |
---|
316 | sortable="true" |
---|
317 | filterable="true" |
---|
318 | exportable="true" |
---|
319 | /> |
---|
320 | <tbl:columndef |
---|
321 | id="authors" |
---|
322 | property="authors" |
---|
323 | datatype="string" |
---|
324 | title="Authors" |
---|
325 | sortable="true" |
---|
326 | filterable="true" |
---|
327 | exportable="true" |
---|
328 | /> |
---|
329 | <tbl:columndef |
---|
330 | id="experimentDesign" |
---|
331 | property="experimentDesign" |
---|
332 | datatype="string" |
---|
333 | title="Experiment design" |
---|
334 | sortable="true" |
---|
335 | filterable="true" |
---|
336 | exportable="true" |
---|
337 | /> |
---|
338 | <tbl:columndef |
---|
339 | id="experimentType" |
---|
340 | property="experimentType" |
---|
341 | datatype="string" |
---|
342 | title="Experiment type" |
---|
343 | sortable="true" |
---|
344 | filterable="true" |
---|
345 | exportable="true" |
---|
346 | /> |
---|
347 | <tbl:columndef |
---|
348 | id="publication" |
---|
349 | property="publication" |
---|
350 | datatype="string" |
---|
351 | title="Publication" |
---|
352 | sortable="true" |
---|
353 | filterable="true" |
---|
354 | exportable="true" |
---|
355 | /> |
---|
356 | <tbl:columndef |
---|
357 | id="publicationDate" |
---|
358 | property="publicationDate" |
---|
359 | datatype="date" |
---|
360 | title="Publication date" |
---|
361 | sortable="true" |
---|
362 | filterable="true" |
---|
363 | exportable="true" |
---|
364 | formatter="<%=dateFormatter%>" |
---|
365 | /> |
---|
366 | <tbl:columndef |
---|
367 | id="pubMedId" |
---|
368 | property="pubMedId" |
---|
369 | datatype="string" |
---|
370 | title="PubMedId" |
---|
371 | sortable="true" |
---|
372 | filterable="true" |
---|
373 | exportable="true" |
---|
374 | /> |
---|
375 | <tbl:columndef |
---|
376 | id="owner" |
---|
377 | property="owner.name" |
---|
378 | datatype="string" |
---|
379 | title="Owner" |
---|
380 | sortable="true" |
---|
381 | filterable="true" |
---|
382 | exportable="true" |
---|
383 | /> |
---|
384 | <tbl:columndef |
---|
385 | id="description" |
---|
386 | property="description" |
---|
387 | datatype="string" |
---|
388 | title="Description" |
---|
389 | sortable="true" |
---|
390 | filterable="true" |
---|
391 | exportable="true" |
---|
392 | /> |
---|
393 | <tbl:columndef |
---|
394 | id="actions" |
---|
395 | title="Actions" |
---|
396 | /> |
---|
397 | <tbl:columndef |
---|
398 | id="permission" |
---|
399 | title="Permission" |
---|
400 | /> |
---|
401 | <tbl:columndef |
---|
402 | id="sharedTo" |
---|
403 | title="Shared to" |
---|
404 | filterable="true" |
---|
405 | filterproperty="!sharedTo.name" |
---|
406 | datatype="string" |
---|
407 | /> |
---|
408 | <tbl:toolbar |
---|
409 | visible="<%=mode.hasToolbar()%>" |
---|
410 | > |
---|
411 | <tbl:button |
---|
412 | disabled="<%=!createPermission%>" |
---|
413 | image="new.png" |
---|
414 | onclick="newItem()" |
---|
415 | title="New…" |
---|
416 | tooltip="<%=createPermission ? "Create new experiment" : "You do not have permission to create experiments"%>" |
---|
417 | /> |
---|
418 | <tbl:button |
---|
419 | image="delete.png" |
---|
420 | onclick="deleteItems()" |
---|
421 | title="Delete" |
---|
422 | tooltip="Delete the selected items" |
---|
423 | /> |
---|
424 | <tbl:button |
---|
425 | image="restore.png" |
---|
426 | onclick="restoreItems()" |
---|
427 | title="Restore" |
---|
428 | tooltip="Restore the selected (deleted) items" |
---|
429 | /> |
---|
430 | <tbl:button |
---|
431 | image="share.png" |
---|
432 | onclick="shareItems()" |
---|
433 | title="Share…" |
---|
434 | tooltip="Share the selected items" |
---|
435 | /> |
---|
436 | <tbl:button |
---|
437 | image="take_ownership.png" |
---|
438 | onclick="setOwner()" |
---|
439 | title="Set owner…" |
---|
440 | tooltip="Change owner of the selected items" |
---|
441 | /> |
---|
442 | <tbl:button |
---|
443 | image="columns.png" |
---|
444 | onclick="configureColumns()" |
---|
445 | title="Columns…" |
---|
446 | tooltip="Show, hide and re-order columns" |
---|
447 | /> |
---|
448 | <tbl:button |
---|
449 | image="import.png" |
---|
450 | onclick="runPlugin('ImportItems')" |
---|
451 | title="Import…" |
---|
452 | tooltip="Import data" |
---|
453 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
454 | /> |
---|
455 | <tbl:button |
---|
456 | image="export.png" |
---|
457 | onclick="runPlugin('ExportItems')" |
---|
458 | title="Export…" |
---|
459 | tooltip="Export data" |
---|
460 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
461 | /> |
---|
462 | <tbl:button |
---|
463 | image="runplugin.png" |
---|
464 | onclick="runPlugin('RunListPlugin')" |
---|
465 | title="Run plugin…" |
---|
466 | tooltip="Run a plugin" |
---|
467 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
468 | /> |
---|
469 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
470 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
471 | </tbl:toolbar> |
---|
472 | <tbl:navigator |
---|
473 | page="<%=cc.getPage()%>" |
---|
474 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
475 | totalrows="<%=experiments == null ? 0 : experiments.getTotalCount()%>" |
---|
476 | visible="<%=mode.hasNavigator()%>" |
---|
477 | /> |
---|
478 | <tbl:data> |
---|
479 | <tbl:headers> |
---|
480 | <tbl:headerrow> |
---|
481 | <tbl:header colspan="3" /> |
---|
482 | <tbl:columnheaders /> |
---|
483 | </tbl:headerrow> |
---|
484 | <tbl:headerrow> |
---|
485 | <tbl:header subclass="index" /> |
---|
486 | <tbl:header |
---|
487 | subclass="check" |
---|
488 | visible="<%=mode.hasCheck()%>" |
---|
489 | ><base:icon |
---|
490 | image="check_uncheck.png" |
---|
491 | tooltip="Check/uncheck all" |
---|
492 | onclick="Forms.checkUncheck(document.forms[formId])" |
---|
493 | /></tbl:header> |
---|
494 | <tbl:header |
---|
495 | subclass="check" |
---|
496 | visible="<%=mode.hasRadio()%>" |
---|
497 | /> |
---|
498 | <tbl:header |
---|
499 | subclass="icons" |
---|
500 | visible="<%=mode.hasIcons()%>" |
---|
501 | /> |
---|
502 | <tbl:propertyfilter /> |
---|
503 | </tbl:headerrow> |
---|
504 | </tbl:headers> |
---|
505 | <tbl:rows> |
---|
506 | <% |
---|
507 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
508 | int selectedItemId = Values.getInt(request.getParameter("item_id")); |
---|
509 | if (experiments != null) |
---|
510 | { |
---|
511 | while (experiments.hasNext()) |
---|
512 | { |
---|
513 | Experiment item = experiments.next(); |
---|
514 | int itemId = item.getId(); |
---|
515 | String openSharePopup = "shareItem("+itemId+")"; |
---|
516 | String deletePermanently = "deleteItemPermanently("+itemId+")"; |
---|
517 | boolean deletePermission = item.hasPermission(Permission.DELETE); |
---|
518 | boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
---|
519 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
520 | String tooltip = mode.isSelectionMode() ? |
---|
521 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
522 | String name = HTML.encodeTags(item.getName()); |
---|
523 | index++; |
---|
524 | numListed++; |
---|
525 | %> |
---|
526 | <tbl:row> |
---|
527 | <tbl:header |
---|
528 | clazz="index" |
---|
529 | ><%=index%></tbl:header> |
---|
530 | <tbl:header |
---|
531 | clazz="check" |
---|
532 | visible="<%=mode.hasCheck()%>" |
---|
533 | ><input |
---|
534 | type="checkbox" |
---|
535 | name="<%=itemId%>" |
---|
536 | value="<%=itemId%>" |
---|
537 | title="<%=name%>" |
---|
538 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
539 | ></tbl:header> |
---|
540 | <tbl:header |
---|
541 | clazz="check" |
---|
542 | visible="<%=mode.hasRadio()%>" |
---|
543 | ><input |
---|
544 | type="radio" |
---|
545 | name="item_id" |
---|
546 | value="<%=itemId%>" |
---|
547 | title="<%=name%>" |
---|
548 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
549 | ></tbl:header> |
---|
550 | <tbl:header |
---|
551 | clazz="icons" |
---|
552 | visible="<%=mode.hasIcons()%>" |
---|
553 | ><base:icon |
---|
554 | image="deleted.png" |
---|
555 | onclick="<%=deletePermission ? deletePermanently : null%>" |
---|
556 | tooltip="This item has been scheduled for deletion" |
---|
557 | visible="<%=item.isRemoved()%>" |
---|
558 | /><base:icon |
---|
559 | image="shared.png" |
---|
560 | onclick="<%=sharePermission ? openSharePopup : null%>" |
---|
561 | tooltip="This item is shared to other users, groups and/or projects" |
---|
562 | visible="<%=item.isShared()%>" |
---|
563 | /> </tbl:header> |
---|
564 | <tbl:cell column="name"><div class="link" |
---|
565 | onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" |
---|
566 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
567 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
568 | <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" /> |
---|
569 | <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell> |
---|
570 | <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell> |
---|
571 | <tbl:cell column="directory" |
---|
572 | ><base:propertyvalue |
---|
573 | item="<%=item%>" |
---|
574 | property="directory" |
---|
575 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
576 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
577 | /></tbl:cell> |
---|
578 | <tbl:cell column="reporterCloneTemplate" |
---|
579 | ><base:propertyvalue |
---|
580 | item="<%=item%>" |
---|
581 | property="virtualDb.reporterCloneTemplate" |
---|
582 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
583 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
584 | /></tbl:cell> |
---|
585 | <tbl:cell column="title"><%=HTML.encodeTags(item.getTitle())%></tbl:cell> |
---|
586 | <tbl:cell column="abstract"><%=HTML.encodeTags(item.getAbstract())%></tbl:cell> |
---|
587 | <tbl:cell column="affiliations"><%=HTML.encodeTags(item.getAffiliations())%></tbl:cell> |
---|
588 | <tbl:cell column="authors"><%=HTML.encodeTags(item.getAuthors())%></tbl:cell> |
---|
589 | <tbl:cell column="experimentDesign"><%=HTML.encodeTags(item.getExperimentDesign())%></tbl:cell> |
---|
590 | <tbl:cell column="experimentType"><%=HTML.encodeTags(item.getExperimentType())%></tbl:cell> |
---|
591 | <tbl:cell column="publication"><%=HTML.encodeTags(item.getPublication())%></tbl:cell> |
---|
592 | <tbl:cell column="publicationDate" value="<%=item.getPublicationDate()%>" /> |
---|
593 | <tbl:cell column="pubMedId"><%=HTML.encodeTags(item.getPubMedId())%></tbl:cell> |
---|
594 | <tbl:cell column="owner" |
---|
595 | ><base:propertyvalue |
---|
596 | item="<%=item%>" |
---|
597 | property="owner" |
---|
598 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
599 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
600 | /></tbl:cell> |
---|
601 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
602 | <tbl:cell column="actions"><a href="bioassaysets/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>">Analyze</a></tbl:cell> |
---|
603 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
604 | <tbl:cell column="sharedTo"> |
---|
605 | <% |
---|
606 | Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); |
---|
607 | while(sharees.hasNext()) |
---|
608 | { |
---|
609 | Nameable n = sharees.next(); |
---|
610 | if (mode.hasPropertyLink()) |
---|
611 | { |
---|
612 | out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); |
---|
613 | } |
---|
614 | else |
---|
615 | { |
---|
616 | out.write(HTML.encodeTags(n.getName())); |
---|
617 | } |
---|
618 | out.write(sharees.hasNext() ? ", " : ""); |
---|
619 | } |
---|
620 | %> |
---|
621 | </tbl:cell> |
---|
622 | </tbl:row> |
---|
623 | <% |
---|
624 | } |
---|
625 | } |
---|
626 | %> |
---|
627 | </tbl:rows> |
---|
628 | </tbl:data> |
---|
629 | <% |
---|
630 | if (numListed == 0) |
---|
631 | { |
---|
632 | %> |
---|
633 | <tbl:panel><%=experiments == null || experiments.getTotalCount() == 0 ? "No experiments were found" : "No experiments on this page. Please select another page!" %></tbl:panel> |
---|
634 | <% |
---|
635 | } |
---|
636 | else |
---|
637 | { |
---|
638 | %> |
---|
639 | <tbl:navigator |
---|
640 | page="<%=cc.getPage()%>" |
---|
641 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
642 | totalrows="<%=experiments == null ? 0 : experiments.getTotalCount()%>" |
---|
643 | visible="<%=mode.hasNavigator()%>" |
---|
644 | locked="true" |
---|
645 | /> |
---|
646 | <% |
---|
647 | } |
---|
648 | %> |
---|
649 | </tbl:table> |
---|
650 | <base:buttongroup subclass="dialogbuttons"> |
---|
651 | <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
652 | <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
653 | <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
654 | </base:buttongroup> |
---|
655 | |
---|
656 | </base:body> |
---|
657 | </base:page> |
---|
658 | <% |
---|
659 | } |
---|
660 | finally |
---|
661 | { |
---|
662 | if (experiments != null) experiments.close(); |
---|
663 | if (dc != null) dc.close(); |
---|
664 | } |
---|
665 | %> |
---|