1 | <%-- $Id: list_hybridizations.jsp 3190 2007-03-13 10:05:42Z enell $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) Authors contributing to this file. |
---|
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 2 |
---|
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 this program; if not, write to the Free Software |
---|
20 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | ------------------------------------------------------------------ |
---|
23 | |
---|
24 | @author Nicklas |
---|
25 | @version 2.0 |
---|
26 | --%> |
---|
27 | <%@ page 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.Hybridization" |
---|
32 | import="net.sf.basedb.core.LabeledExtract" |
---|
33 | import="net.sf.basedb.core.Label" |
---|
34 | import="net.sf.basedb.core.Scan" |
---|
35 | import="net.sf.basedb.core.BioMaterialEvent" |
---|
36 | import="net.sf.basedb.core.AnnotationType" |
---|
37 | import="net.sf.basedb.core.AnnotationSet" |
---|
38 | import="net.sf.basedb.core.ItemQuery" |
---|
39 | import="net.sf.basedb.core.Include" |
---|
40 | import="net.sf.basedb.core.Type" |
---|
41 | import="net.sf.basedb.core.ItemResultIterator" |
---|
42 | import="net.sf.basedb.core.ItemResultList" |
---|
43 | import="net.sf.basedb.core.ItemContext" |
---|
44 | import="net.sf.basedb.core.Permission" |
---|
45 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
46 | import="net.sf.basedb.core.PluginDefinition" |
---|
47 | import="net.sf.basedb.core.query.Hql" |
---|
48 | import="net.sf.basedb.core.query.Restrictions" |
---|
49 | import="net.sf.basedb.core.query.Expressions" |
---|
50 | import="net.sf.basedb.core.query.Orders" |
---|
51 | import="net.sf.basedb.core.query.Hql" |
---|
52 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
53 | import="net.sf.basedb.core.plugin.Plugin" |
---|
54 | import="net.sf.basedb.util.Enumeration" |
---|
55 | import="net.sf.basedb.clients.web.Base" |
---|
56 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
57 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
58 | import="net.sf.basedb.clients.web.util.HTML" |
---|
59 | import="net.sf.basedb.util.formatter.Formatter" |
---|
60 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
61 | import="net.sf.basedb.util.Values" |
---|
62 | import="java.util.List" |
---|
63 | import="java.util.Map" |
---|
64 | import="java.util.Date" |
---|
65 | %> |
---|
66 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
67 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
68 | <%! |
---|
69 | private static final Item itemType = Item.HYBRIDIZATION; |
---|
70 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
71 | %> |
---|
72 | <% |
---|
73 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
74 | final String ID = sc.getId(); |
---|
75 | final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
---|
76 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
77 | |
---|
78 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
79 | final String callback = request.getParameter("callback"); |
---|
80 | final String title = mode.generateTitle("hybridization", "hybridizations"); |
---|
81 | final DbControl dc = sc.newDbControl(); |
---|
82 | ItemResultIterator<Hybridization> hybridizations = null; |
---|
83 | ItemResultList<AnnotationType> annotationTypes = null; |
---|
84 | try |
---|
85 | { |
---|
86 | final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
---|
87 | |
---|
88 | // Query for labeled extracts relatated to the current hybridization |
---|
89 | final ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery(); |
---|
90 | labeledExtractQuery.include(cc.getInclude()); |
---|
91 | labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "evt")); |
---|
92 | labeledExtractQuery.restrict(Restrictions.eq(Hql.property("evt", "hybridization"), Expressions.parameter("hybridization"))); |
---|
93 | labeledExtractQuery.order(Orders.asc(Hql.property("name"))); |
---|
94 | |
---|
95 | // Query for scans relatated to the current hybridization |
---|
96 | final ItemQuery<Scan> scanQuery = Scan.getQuery(); |
---|
97 | scanQuery.include(cc.getInclude()); |
---|
98 | scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter("hybridization"))); |
---|
99 | scanQuery.order(Orders.asc(Hql.property("name"))); |
---|
100 | final boolean createScanPermission = sc.hasPermission(Permission.CREATE, Item.SCAN); |
---|
101 | |
---|
102 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
103 | annotationTypes = annotationTypeQuery.list(dc); |
---|
104 | try |
---|
105 | { |
---|
106 | final ItemQuery<Hybridization> query = Base.getConfiguredQuery(cc, true, Hybridization.getQuery(), mode); |
---|
107 | hybridizations = query.iterate(dc); |
---|
108 | } |
---|
109 | catch (Throwable t) |
---|
110 | { |
---|
111 | cc.setMessage(t.getMessage()); |
---|
112 | } |
---|
113 | int numListed = 0; |
---|
114 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
115 | %> |
---|
116 | <base:page title="<%=title==null ? "Hybridizations" : title%>" type="<%=mode.getPageType()%>"> |
---|
117 | <base:head scripts="menu.js,table.js" styles="menu.css,table.css"> |
---|
118 | <script language="JavaScript"> |
---|
119 | var submitPage = 'index.jsp'; |
---|
120 | var formId = 'hybridizations'; |
---|
121 | function newItem() |
---|
122 | { |
---|
123 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true); |
---|
124 | } |
---|
125 | function editItem(itemId) |
---|
126 | { |
---|
127 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); |
---|
128 | } |
---|
129 | function viewItem(itemId) |
---|
130 | { |
---|
131 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); |
---|
132 | } |
---|
133 | function itemOnClick(evt, itemId) |
---|
134 | { |
---|
135 | Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected); |
---|
136 | } |
---|
137 | function deleteItems() |
---|
138 | { |
---|
139 | var frm = document.forms[formId]; |
---|
140 | if (Forms.numChecked(frm) == 0) |
---|
141 | { |
---|
142 | alert('Please select at least one item in the list'); |
---|
143 | return; |
---|
144 | } |
---|
145 | frm.action = submitPage; |
---|
146 | frm.cmd.value = 'DeleteItems'; |
---|
147 | frm.submit(); |
---|
148 | } |
---|
149 | function restoreItems() |
---|
150 | { |
---|
151 | var frm = document.forms[formId]; |
---|
152 | if (Forms.numChecked(frm) == 0) |
---|
153 | { |
---|
154 | alert('Please select at least one item in the list'); |
---|
155 | return; |
---|
156 | } |
---|
157 | frm.action = submitPage; |
---|
158 | frm.cmd.value = 'RestoreItems'; |
---|
159 | frm.submit(); |
---|
160 | } |
---|
161 | function takeOwnership() |
---|
162 | { |
---|
163 | var frm = document.forms[formId]; |
---|
164 | if (Forms.numChecked(frm) == 0) |
---|
165 | { |
---|
166 | alert('Please select at least one item in the list'); |
---|
167 | return; |
---|
168 | } |
---|
169 | if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) |
---|
170 | { |
---|
171 | frm.action = submitPage; |
---|
172 | frm.cmd.value = 'TakeOwnershipOfItems'; |
---|
173 | frm.submit(); |
---|
174 | } |
---|
175 | } |
---|
176 | function shareItem(itemId) |
---|
177 | { |
---|
178 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'ShareHybridizations', 500, 400); |
---|
179 | } |
---|
180 | function shareItems() |
---|
181 | { |
---|
182 | Table.shareItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'ShareItems'); |
---|
183 | } |
---|
184 | function configureColumns() |
---|
185 | { |
---|
186 | Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
187 | } |
---|
188 | function runPlugin(cmd) |
---|
189 | { |
---|
190 | Table.submitToPopup(formId, cmd, 740, 540); |
---|
191 | } |
---|
192 | function returnSelected() |
---|
193 | { |
---|
194 | Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); |
---|
195 | window.close(); |
---|
196 | } |
---|
197 | function presetOnChange() |
---|
198 | { |
---|
199 | Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
200 | } |
---|
201 | function newScan(hybridizationId) |
---|
202 | { |
---|
203 | Main.viewOrEditItem('<%=ID%>', 'SCAN', 0, true, '&hybridization_id='+hybridizationId); |
---|
204 | } |
---|
205 | </script> |
---|
206 | </base:head> |
---|
207 | |
---|
208 | <base:body> |
---|
209 | <% |
---|
210 | if (cc.getMessage() != null) |
---|
211 | { |
---|
212 | %> |
---|
213 | <div class="error"><%=cc.getMessage()%></div> |
---|
214 | <% |
---|
215 | cc.setMessage(null); |
---|
216 | } |
---|
217 | %> |
---|
218 | <tbl:table |
---|
219 | id="hybridizations" |
---|
220 | clazz="itemlist" |
---|
221 | columns="<%=cc.getSetting("columns")%>" |
---|
222 | sortby="<%=cc.getSortProperty()%>" |
---|
223 | direction="<%=cc.getSortDirection()%>" |
---|
224 | title="<%=title%>" |
---|
225 | action="index.jsp" |
---|
226 | sc="<%=sc%>" |
---|
227 | item="<%=itemType%>" |
---|
228 | > |
---|
229 | <tbl:hidden |
---|
230 | name="mode" |
---|
231 | value="<%=mode.getName()%>" |
---|
232 | /> |
---|
233 | <tbl:hidden |
---|
234 | name="callback" |
---|
235 | value="<%=callback%>" |
---|
236 | skip="<%=callback == null%>" |
---|
237 | /> |
---|
238 | <tbl:columndef |
---|
239 | id="name" |
---|
240 | property="name" |
---|
241 | datatype="string" |
---|
242 | title="Name" |
---|
243 | sortable="true" |
---|
244 | filterable="true" |
---|
245 | exportable="true" |
---|
246 | show="always" |
---|
247 | /> |
---|
248 | <tbl:columndef |
---|
249 | id="labeledExtracts" |
---|
250 | title="Labeled extracts" |
---|
251 | /> |
---|
252 | <tbl:columndef |
---|
253 | id="arraySlide" |
---|
254 | property="arraySlide.name" |
---|
255 | datatype="string" |
---|
256 | title="Array slide" |
---|
257 | sortable="true" |
---|
258 | filterable="true" |
---|
259 | exportable="true" |
---|
260 | /> |
---|
261 | <tbl:columndef |
---|
262 | id="scans" |
---|
263 | title="Scans" |
---|
264 | /> |
---|
265 | <tbl:columndef |
---|
266 | id="protocol" |
---|
267 | property="creationEvent.protocol" |
---|
268 | sortproperty="creationEvent.protocol.name" |
---|
269 | filterproperty="creationEvent.protocol.name" |
---|
270 | exportproperty="creationEvent.protocol.name" |
---|
271 | datatype="string" |
---|
272 | title="Protocol" |
---|
273 | sortable="true" |
---|
274 | filterable="true" |
---|
275 | exportable="true" |
---|
276 | /> |
---|
277 | <tbl:columndef |
---|
278 | id="hybStation" |
---|
279 | property="creationEvent.hardware" |
---|
280 | datatype="string" |
---|
281 | title="Hardware" |
---|
282 | sortable="true" |
---|
283 | filterable="true" |
---|
284 | exportable="true" |
---|
285 | /> |
---|
286 | <tbl:columndef |
---|
287 | id="eventDate" |
---|
288 | property="creationEvent.eventDate" |
---|
289 | datatype="date" |
---|
290 | title="Created" |
---|
291 | sortable="true" |
---|
292 | filterable="true" |
---|
293 | exportable="true" |
---|
294 | formatter="<%=dateFormatter%>" |
---|
295 | /> |
---|
296 | <tbl:columndef |
---|
297 | id="entryDate" |
---|
298 | property="creationEvent.entryDate" |
---|
299 | datatype="date" |
---|
300 | title="Registered" |
---|
301 | sortable="true" |
---|
302 | filterable="true" |
---|
303 | exportable="true" |
---|
304 | formatter="<%=dateFormatter%>" |
---|
305 | /> |
---|
306 | <tbl:columndef |
---|
307 | id="owner" |
---|
308 | property="owner.name" |
---|
309 | datatype="string" |
---|
310 | title="Owner" |
---|
311 | sortable="true" |
---|
312 | filterable="true" |
---|
313 | exportable="true" |
---|
314 | /> |
---|
315 | <tbl:columndef |
---|
316 | id="description" |
---|
317 | property="description" |
---|
318 | datatype="string" |
---|
319 | title="Description" |
---|
320 | sortable="true" |
---|
321 | filterable="true" |
---|
322 | exportable="true" |
---|
323 | /> |
---|
324 | <% |
---|
325 | for (AnnotationType at : annotationTypes) |
---|
326 | { |
---|
327 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
328 | Enumeration<String, String> annotationEnum = null; |
---|
329 | if (at.isEnumeration()) |
---|
330 | { |
---|
331 | annotationEnum = new Enumeration<String, String>(); |
---|
332 | List<?> values = at.getValues(); |
---|
333 | for (Object value : values) |
---|
334 | { |
---|
335 | String encoded = formatter.format(value); |
---|
336 | annotationEnum.add(encoded, encoded); |
---|
337 | } |
---|
338 | } |
---|
339 | %> |
---|
340 | <tbl:columndef |
---|
341 | id="<%="at"+at.getId()%>" |
---|
342 | title="<%=HTML.encodeTags(at.getName())+" [A]"%>" |
---|
343 | property="<%="#"+at.getId()%>" |
---|
344 | annotation="true" |
---|
345 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
346 | enumeration="<%=annotationEnum%>" |
---|
347 | sortable="false" |
---|
348 | filterable="true" |
---|
349 | exportable="true" |
---|
350 | formatter="<%=formatter%>" |
---|
351 | /> |
---|
352 | <% |
---|
353 | } |
---|
354 | %> |
---|
355 | <tbl:columndef |
---|
356 | id="permission" |
---|
357 | title="Permission" |
---|
358 | /> |
---|
359 | <tbl:toolbar |
---|
360 | visible="<%=mode.hasToolbar()%>" |
---|
361 | > |
---|
362 | <tbl:button |
---|
363 | disabled="<%=createPermission ? false : true%>" |
---|
364 | image="<%=createPermission ? "new.gif" : "new_disabled.gif"%>" |
---|
365 | onclick="newItem()" |
---|
366 | title="New…" |
---|
367 | tooltip="<%=createPermission ? "Create new hybridization" : "You do not have permission to create hybridizations"%>" |
---|
368 | /> |
---|
369 | <tbl:button |
---|
370 | image="delete.gif" |
---|
371 | onclick="deleteItems()" |
---|
372 | title="Delete" |
---|
373 | tooltip="Delete the selected items" |
---|
374 | /> |
---|
375 | <tbl:button |
---|
376 | image="restore.gif" |
---|
377 | onclick="restoreItems()" |
---|
378 | title="Restore" |
---|
379 | tooltip="Restore the selected (deleted) items" |
---|
380 | /> |
---|
381 | <tbl:button |
---|
382 | image="share.gif" |
---|
383 | onclick="shareItems()" |
---|
384 | title="Share…" |
---|
385 | tooltip="Share the selected items" |
---|
386 | /> |
---|
387 | <tbl:button |
---|
388 | image="take_ownership.png" |
---|
389 | onclick="takeOwnership()" |
---|
390 | title="Take ownership…" |
---|
391 | tooltip="Take ownership of the selected items" |
---|
392 | /> |
---|
393 | <tbl:button |
---|
394 | image="columns.gif" |
---|
395 | onclick="configureColumns()" |
---|
396 | title="Columns…" |
---|
397 | tooltip="Show, hide and re-order columns" |
---|
398 | /> |
---|
399 | <tbl:button |
---|
400 | image="import.gif" |
---|
401 | onclick="runPlugin('ImportItems')" |
---|
402 | title="Import…" |
---|
403 | tooltip="Import data" |
---|
404 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
405 | /> |
---|
406 | <tbl:button |
---|
407 | image="export.gif" |
---|
408 | onclick="runPlugin('ExportItems')" |
---|
409 | title="Export…" |
---|
410 | tooltip="Export data" |
---|
411 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
412 | /> |
---|
413 | <tbl:button |
---|
414 | image="runplugin.gif" |
---|
415 | onclick="runPlugin('RunListPlugin')" |
---|
416 | title="Run plugin…" |
---|
417 | tooltip="Run a plugin" |
---|
418 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
419 | /> |
---|
420 | </tbl:toolbar> |
---|
421 | <tbl:navigator |
---|
422 | page="<%=cc.getPage()%>" |
---|
423 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
424 | totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>" |
---|
425 | visible="<%=mode.hasNavigator()%>" |
---|
426 | /> |
---|
427 | <tbl:data> |
---|
428 | <tbl:columns> |
---|
429 | <tbl:presetselector |
---|
430 | clazz="columnheader" |
---|
431 | colspan="3" |
---|
432 | onchange="presetOnChange()" |
---|
433 | /> |
---|
434 | </tbl:columns> |
---|
435 | |
---|
436 | <tr> |
---|
437 | <tbl:header |
---|
438 | clazz="index" |
---|
439 | > </tbl:header> |
---|
440 | <tbl:header |
---|
441 | clazz="check" |
---|
442 | visible="<%=mode.hasCheck()%>" |
---|
443 | ><base:icon |
---|
444 | image="check_uncheck.gif" |
---|
445 | tooltip="Check/uncheck all" |
---|
446 | onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;" |
---|
447 | /></tbl:header> |
---|
448 | <tbl:header |
---|
449 | clazz="check" |
---|
450 | visible="<%=mode.hasRadio()%>" |
---|
451 | > </tbl:header> |
---|
452 | <tbl:header |
---|
453 | clazz="icons" |
---|
454 | visible="<%=mode.hasIcons()%>" |
---|
455 | > </tbl:header> |
---|
456 | <tbl:propertyfilter /> |
---|
457 | </tr> |
---|
458 | |
---|
459 | <tbl:rows> |
---|
460 | <% |
---|
461 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
462 | int selectedItemId = cc.getId(); |
---|
463 | if (hybridizations != null) |
---|
464 | { |
---|
465 | while (hybridizations.hasNext()) |
---|
466 | { |
---|
467 | Hybridization item = hybridizations.next(); |
---|
468 | BioMaterialEvent creationEvent = item.getCreationEvent(); |
---|
469 | int itemId = item.getId(); |
---|
470 | boolean usePermission = item.hasPermission(Permission.USE); |
---|
471 | String openSharePopup = "shareItem("+itemId+")"; |
---|
472 | boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
---|
473 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
474 | String tooltip = mode.isSelectionMode() ? |
---|
475 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
476 | String name = HTML.encodeTags(item.getName()); |
---|
477 | index++; |
---|
478 | numListed++; |
---|
479 | %> |
---|
480 | <tbl:row> |
---|
481 | <tbl:header |
---|
482 | clazz="index" |
---|
483 | ><%=index%></tbl:header> |
---|
484 | <tbl:header |
---|
485 | clazz="check" |
---|
486 | visible="<%=mode.hasCheck()%>" |
---|
487 | ><input |
---|
488 | type="checkbox" |
---|
489 | name="<%=itemId%>" |
---|
490 | value="<%=itemId%>" |
---|
491 | title="<%=name%>" |
---|
492 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
493 | ></tbl:header> |
---|
494 | <tbl:header |
---|
495 | clazz="check" |
---|
496 | visible="<%=mode.hasRadio()%>" |
---|
497 | ><input |
---|
498 | type="radio" |
---|
499 | name="item_id" |
---|
500 | value="<%=itemId%>" |
---|
501 | title="<%=name%>" |
---|
502 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
503 | ></tbl:header> |
---|
504 | <tbl:header |
---|
505 | clazz="icons" |
---|
506 | visible="<%=mode.hasIcons()%>" |
---|
507 | ><base:icon |
---|
508 | image="deleted.gif" |
---|
509 | tooltip="This item has been scheduled for deletion" |
---|
510 | visible="<%=item.isRemoved()%>" |
---|
511 | /><base:icon |
---|
512 | image="<%=sharePermission ? "shared.gif" : "shared_disabled.gif"%>" |
---|
513 | onclick="<%=sharePermission ? openSharePopup : null%>" |
---|
514 | tooltip="This item is shared to other users, groups and/or projects" |
---|
515 | visible="<%=item.isShared()%>" |
---|
516 | /> </tbl:header> |
---|
517 | <tbl:cell column="name"><div class="link" |
---|
518 | onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" |
---|
519 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
520 | <tbl:cell column="labeledExtracts"> |
---|
521 | <% |
---|
522 | labeledExtractQuery.setParameter("hybridization", itemId, Type.INT); |
---|
523 | try |
---|
524 | { |
---|
525 | String separator = ""; |
---|
526 | for (LabeledExtract le : labeledExtractQuery.list(dc)) |
---|
527 | { |
---|
528 | Label label = null; |
---|
529 | boolean readLabel = true; |
---|
530 | try |
---|
531 | { |
---|
532 | label = le.getLabel(); |
---|
533 | } |
---|
534 | catch (PermissionDeniedException ex) |
---|
535 | { |
---|
536 | readLabel = false; |
---|
537 | } |
---|
538 | out.write(separator); |
---|
539 | if (mode.hasPropertyLink()) |
---|
540 | { |
---|
541 | out.write(Base.getLinkedName(ID, le, false, mode.hasEditLink())); |
---|
542 | out.write(" (" + Base.getLinkedName(ID, label, !readLabel, mode.hasEditLink()) + ")"); |
---|
543 | } |
---|
544 | else |
---|
545 | { |
---|
546 | out.write(HTML.encodeTags(le.getName())); |
---|
547 | out.write(" (" + Base.getEncodedName(label, !readLabel) + ")"); |
---|
548 | } |
---|
549 | separator = ", "; |
---|
550 | } |
---|
551 | } |
---|
552 | catch (Throwable t) |
---|
553 | { |
---|
554 | %> |
---|
555 | <div class="error"><%=t.getMessage()%></div> |
---|
556 | <% |
---|
557 | } |
---|
558 | %> |
---|
559 | </tbl:cell> |
---|
560 | <tbl:cell column="arraySlide" |
---|
561 | ><base:propertyvalue |
---|
562 | item="<%=item%>" |
---|
563 | property="arraySlide" |
---|
564 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
565 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
566 | /></tbl:cell> |
---|
567 | <tbl:cell column="scans"> |
---|
568 | <% |
---|
569 | scanQuery.setParameter("hybridization", itemId, Type.INT); |
---|
570 | try |
---|
571 | { |
---|
572 | String separator = ""; |
---|
573 | for (Scan s : scanQuery.list(dc)) |
---|
574 | { |
---|
575 | out.write(separator); |
---|
576 | if (mode.hasPropertyLink()) |
---|
577 | { |
---|
578 | out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink())); |
---|
579 | } |
---|
580 | else |
---|
581 | { |
---|
582 | out.write(HTML.encodeTags(s.getName())); |
---|
583 | } |
---|
584 | separator = ", "; |
---|
585 | } |
---|
586 | } |
---|
587 | catch (Throwable t) |
---|
588 | { |
---|
589 | %> |
---|
590 | <div class="error"><%=t.getMessage()%></div> |
---|
591 | <% |
---|
592 | } |
---|
593 | %> |
---|
594 | <base:icon |
---|
595 | image="add.png" |
---|
596 | onclick="<%="newScan("+itemId+")"%>" |
---|
597 | tooltip="Create new scan" |
---|
598 | visible="<%=mode.hasEditLink() && createScanPermission && usePermission %>" |
---|
599 | /> |
---|
600 | </tbl:cell> |
---|
601 | <tbl:cell column="protocol" |
---|
602 | ><base:propertyvalue |
---|
603 | item="<%=creationEvent%>" |
---|
604 | property="protocol" |
---|
605 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
606 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
607 | /></tbl:cell> |
---|
608 | <tbl:cell column="hybStation" |
---|
609 | ><base:propertyvalue |
---|
610 | item="<%=creationEvent%>" |
---|
611 | property="hardware" |
---|
612 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
613 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
614 | /></tbl:cell> |
---|
615 | <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" /> |
---|
616 | <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" /> |
---|
617 | <tbl:cell column="owner" |
---|
618 | ><base:propertyvalue |
---|
619 | item="<%=item%>" |
---|
620 | property="owner" |
---|
621 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
622 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
623 | /></tbl:cell> |
---|
624 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
625 | <% |
---|
626 | AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; |
---|
627 | if (as != null) |
---|
628 | { |
---|
629 | for (AnnotationType at : annotationTypes) |
---|
630 | { |
---|
631 | if (as.hasAnnotation(at)) |
---|
632 | { |
---|
633 | %> |
---|
634 | <tbl:cell column="<%="at"+at.getId()%>" |
---|
635 | ><tbl:cellvalue |
---|
636 | list="<%=as.getAnnotation(at).getValues()%>" |
---|
637 | /></tbl:cell> |
---|
638 | <% |
---|
639 | } |
---|
640 | } |
---|
641 | } |
---|
642 | %> |
---|
643 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
644 | </tbl:row> |
---|
645 | <% |
---|
646 | } |
---|
647 | } |
---|
648 | %> |
---|
649 | </tbl:rows> |
---|
650 | </tbl:data> |
---|
651 | <% |
---|
652 | if (numListed == 0) |
---|
653 | { |
---|
654 | %> |
---|
655 | <tbl:panel><%=hybridizations == null || hybridizations.getTotalCount() == 0 ? "No hybridizations were found" : "No hybridizations on this page. Please select another page!" %></tbl:panel> |
---|
656 | <% |
---|
657 | } |
---|
658 | else |
---|
659 | { |
---|
660 | %> |
---|
661 | <tbl:navigator |
---|
662 | page="<%=cc.getPage()%>" |
---|
663 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
664 | totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>" |
---|
665 | visible="<%=mode.hasNavigator()%>" |
---|
666 | locked="true" |
---|
667 | /> |
---|
668 | <% |
---|
669 | } |
---|
670 | %> |
---|
671 | </tbl:table> |
---|
672 | <base:buttongroup align="center" clazz="fixedatbottom"> |
---|
673 | <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
674 | <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
675 | <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
676 | </base:buttongroup> |
---|
677 | <br><br><br> |
---|
678 | </base:body> |
---|
679 | </base:page> |
---|
680 | <% |
---|
681 | } |
---|
682 | finally |
---|
683 | { |
---|
684 | if (hybridizations != null) hybridizations.close(); |
---|
685 | if (dc != null) dc.close(); |
---|
686 | } |
---|
687 | %> |
---|