1 | <%-- $Id: list_wells.jsp 6780 2015-03-18 06:53:09Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2006 Johan Enell, Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
4 | Copyright (C) 2007 Johan Enell, Nicklas Nordborg |
---|
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.AnnotationType" |
---|
32 | import="net.sf.basedb.core.AnnotationSet" |
---|
33 | import="net.sf.basedb.core.Annotation" |
---|
34 | import="net.sf.basedb.core.Plate" |
---|
35 | import="net.sf.basedb.core.Well" |
---|
36 | import="net.sf.basedb.core.ReporterType" |
---|
37 | import="net.sf.basedb.core.Reporter" |
---|
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.ExtendedProperty" |
---|
44 | import="net.sf.basedb.core.ExtendedProperties" |
---|
45 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
46 | import="net.sf.basedb.core.query.Restrictions" |
---|
47 | import="net.sf.basedb.core.query.Expressions" |
---|
48 | import="net.sf.basedb.core.query.Orders" |
---|
49 | import="net.sf.basedb.core.query.Hql" |
---|
50 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
51 | import="net.sf.basedb.core.plugin.Plugin" |
---|
52 | import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil" |
---|
53 | import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
---|
54 | import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
---|
55 | import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
---|
56 | import="net.sf.basedb.core.snapshot.SnapshotManager" |
---|
57 | import="net.sf.basedb.core.data.ReporterData" |
---|
58 | import="net.sf.basedb.util.Enumeration" |
---|
59 | import="net.sf.basedb.clients.web.Base" |
---|
60 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
61 | import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
---|
62 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
63 | import="net.sf.basedb.clients.web.util.HTML" |
---|
64 | import="net.sf.basedb.util.Values" |
---|
65 | import="net.sf.basedb.util.formatter.Formatter" |
---|
66 | import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
---|
67 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
68 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
69 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
70 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
71 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
72 | import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
---|
73 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
74 | import="java.util.ArrayList" |
---|
75 | import="java.util.List" |
---|
76 | import="java.util.Map" |
---|
77 | import="java.util.Date" |
---|
78 | %> |
---|
79 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
80 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
81 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
82 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
83 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
84 | <%! |
---|
85 | private static final Item itemType = Item.WELL; |
---|
86 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
87 | %> |
---|
88 | <% |
---|
89 | final int plateId = Values.getInt(request.getParameter("plate_id")); |
---|
90 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
91 | final String ID = sc.getId(); |
---|
92 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
93 | |
---|
94 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
95 | final String callback = request.getParameter("callback"); |
---|
96 | final String title = mode.generateTitle("well", "wells"); |
---|
97 | final DbControl dc = sc.newDbControl(); |
---|
98 | ItemResultIterator<Well> wells = null; |
---|
99 | List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>(); |
---|
100 | try |
---|
101 | { |
---|
102 | final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
---|
103 | SnapshotManager manager = new SnapshotManager(); |
---|
104 | for (AnnotationType at : annotationTypeQuery.list(dc)) |
---|
105 | { |
---|
106 | annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at)); |
---|
107 | } |
---|
108 | final Plate plate = Plate.getById(dc, plateId); |
---|
109 | final boolean createPermission = plate.hasPermission(Permission.WRITE); |
---|
110 | final boolean deletePermission = createPermission; |
---|
111 | |
---|
112 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
113 | final ItemQuery<ReporterType> typeQuery = ReporterType.getQuery(); |
---|
114 | typeQuery.order(Orders.asc(Hql.property("name"))); |
---|
115 | typeQuery.setCacheResult(true); |
---|
116 | List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData"); |
---|
117 | Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
---|
118 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
119 | |
---|
120 | Enumeration<String,String> rows = new Enumeration<String, String>(); |
---|
121 | WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); |
---|
122 | for (int i=0; i<plate.getPlateType().getPlateGeometry().getRows() && i < 256; i++) |
---|
123 | { |
---|
124 | rows.add(Integer.toString(i), rowFormatter.format(i)); |
---|
125 | } |
---|
126 | |
---|
127 | Enumeration<String,String> columns = new Enumeration<String, String>(); |
---|
128 | WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); |
---|
129 | for (int i=0; i<plate.getPlateType().getPlateGeometry().getColumns() && i < 256; i++) |
---|
130 | { |
---|
131 | columns.add(Integer.toString(i), columnFormatter.format(i)); |
---|
132 | } |
---|
133 | |
---|
134 | try |
---|
135 | { |
---|
136 | final ItemQuery<Well> query = Base.getConfiguredQuery(dc, cc, true, plate.getWells(), mode); |
---|
137 | query.join(Hql.leftJoin(null, "reporter", "rpt", null, true)); |
---|
138 | if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row"))); |
---|
139 | if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column"))); |
---|
140 | wells = query.iterate(dc); |
---|
141 | } |
---|
142 | catch (Throwable t) |
---|
143 | { |
---|
144 | cc.setMessage(t.getMessage()); |
---|
145 | t.printStackTrace(); |
---|
146 | } |
---|
147 | int numListed = 0; |
---|
148 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, plate); |
---|
149 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
150 | ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
---|
151 | %> |
---|
152 | <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> |
---|
153 | <base:head scripts="table.js,tabcontrol-2.js,~wells.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
---|
154 | <ext:scripts context="<%=jspContext%>" /> |
---|
155 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
156 | </base:head> |
---|
157 | |
---|
158 | <base:body> |
---|
159 | <p:path><p:pathelement |
---|
160 | title="Plates" href="<%="../index.jsp?ID="+ID%>" |
---|
161 | /><p:pathelement title="<%=HTML.encodeTags(plate.getName())%>" |
---|
162 | /></p:path> |
---|
163 | |
---|
164 | <t:tabcontrol |
---|
165 | id="main" |
---|
166 | subclass="content mastertabcontrol" |
---|
167 | active="wells"> |
---|
168 | <t:tab id="properties" title="Properties" /> |
---|
169 | <t:tab id="annotations" title="Annotations" /> |
---|
170 | <t:tab id="events" title="Events" /> |
---|
171 | |
---|
172 | <t:tab id="wells" title="Wells"> |
---|
173 | <tbl:table |
---|
174 | id="wells" |
---|
175 | columns="<%=cc.getSetting("columns")%>" |
---|
176 | sortby="<%=cc.getSortProperty()%>" |
---|
177 | direction="<%=cc.getSortDirection()%>" |
---|
178 | action="index.jsp" |
---|
179 | sc="<%=sc%>" |
---|
180 | item="<%=itemType%>" |
---|
181 | subclass="fulltable" |
---|
182 | > |
---|
183 | <tbl:hidden |
---|
184 | name="mode" |
---|
185 | value="<%=mode.getName()%>" |
---|
186 | /> |
---|
187 | <tbl:hidden |
---|
188 | name="plate_id" |
---|
189 | value="<%=String.valueOf(plateId)%>" |
---|
190 | /> |
---|
191 | <tbl:hidden |
---|
192 | name="callback" |
---|
193 | value="<%=callback%>" |
---|
194 | skip="<%=callback == null%>" |
---|
195 | /> |
---|
196 | <tbl:columndef |
---|
197 | id="row" |
---|
198 | property="row" |
---|
199 | datatype="int" |
---|
200 | title="Row" |
---|
201 | sortable="true" |
---|
202 | filterable="true" |
---|
203 | exportable="true" |
---|
204 | enumeration="<%=rows%>" |
---|
205 | show="always" |
---|
206 | formatter="<%=new WellCoordinateFormatter(true)%>" |
---|
207 | /> |
---|
208 | <tbl:columndef |
---|
209 | id="column" |
---|
210 | property="column" |
---|
211 | datatype="int" |
---|
212 | title="Column" |
---|
213 | sortable="true" |
---|
214 | filterable="true" |
---|
215 | exportable="true" |
---|
216 | enumeration="<%=columns%>" |
---|
217 | show="always" |
---|
218 | formatter="<%=new WellCoordinateFormatter(false)%>" |
---|
219 | /> |
---|
220 | <tbl:columndef |
---|
221 | id="id" |
---|
222 | clazz="uniquecol" |
---|
223 | property="id" |
---|
224 | datatype="int" |
---|
225 | title="ID" |
---|
226 | sortable="true" |
---|
227 | filterable="true" |
---|
228 | exportable="true" |
---|
229 | /> |
---|
230 | <tbl:columndef |
---|
231 | id="parent" |
---|
232 | title="Parent" |
---|
233 | /> |
---|
234 | <tbl:columndef |
---|
235 | id="reporterList" |
---|
236 | property="$rpt.£reporterListScores" |
---|
237 | datatype="int" |
---|
238 | title="[Rep] Reporter list" |
---|
239 | filterable="true" |
---|
240 | enumeration="<%=Base.getReporterListsEnum(dc)%>" |
---|
241 | multiple="false" |
---|
242 | /> |
---|
243 | <tbl:columndef |
---|
244 | id="reporter.name" |
---|
245 | property="reporter.name" |
---|
246 | datatype="string" |
---|
247 | title="[Rep] Name" |
---|
248 | sortable="true" |
---|
249 | filterable="true" |
---|
250 | exportable="true" |
---|
251 | /> |
---|
252 | <tbl:columndef |
---|
253 | id="reporter.externalId" |
---|
254 | clazz="uniquecol" |
---|
255 | property="reporter.externalId" |
---|
256 | datatype="string" |
---|
257 | title="[Rep] ID" |
---|
258 | sortable="true" |
---|
259 | filterable="true" |
---|
260 | exportable="true" |
---|
261 | /> |
---|
262 | <tbl:columndef |
---|
263 | id="reporter.symbol" |
---|
264 | property="reporter.symbol" |
---|
265 | datatype="string" |
---|
266 | title="[Rep] Gene symbol" |
---|
267 | sortable="true" |
---|
268 | filterable="true" |
---|
269 | exportable="true" |
---|
270 | /> |
---|
271 | <tbl:columndef |
---|
272 | id="reporter.description" |
---|
273 | property="reporter.description" |
---|
274 | datatype="string" |
---|
275 | title="[Rep] Description" |
---|
276 | sortable="true" |
---|
277 | filterable="true" |
---|
278 | exportable="true" |
---|
279 | /> |
---|
280 | <tbl:columndef |
---|
281 | id="reporter.entryDate" |
---|
282 | property="reporter.entryDate" |
---|
283 | datatype="date" |
---|
284 | title="[Rep] Registered" |
---|
285 | sortable="true" |
---|
286 | filterable="true" |
---|
287 | exportable="true" |
---|
288 | formatter="<%=dateFormatter%>" |
---|
289 | /> |
---|
290 | <tbl:columndef |
---|
291 | id="reporter.lastUpdate" |
---|
292 | property="reporter.lastUpdate" |
---|
293 | datatype="timestamp" |
---|
294 | title="[Rep] Last update" |
---|
295 | sortable="true" |
---|
296 | filterable="true" |
---|
297 | exportable="true" |
---|
298 | formatter="<%=dateTimeFormatter%>" |
---|
299 | /> |
---|
300 | <% |
---|
301 | Enumeration<String, String> types = new Enumeration<String, String>(); |
---|
302 | ItemResultList<ReporterType> reporterTypes = typeQuery.list(dc); |
---|
303 | types.add("", "- none -"); |
---|
304 | for (ReporterType rt : reporterTypes) |
---|
305 | { |
---|
306 | types.add(Integer.toString(rt.getId()), HTML.encodeTags(rt.getName())); |
---|
307 | } |
---|
308 | %> |
---|
309 | <tbl:columndef |
---|
310 | id="reporter.reporterType" |
---|
311 | property="reporter.reporterType" |
---|
312 | sortproperty="reporter.reporterType.name" |
---|
313 | exportproperty="reporter.reporterType.name:string" |
---|
314 | datatype="int" |
---|
315 | enumeration="<%=types%>" |
---|
316 | title="[Rep] Type" |
---|
317 | sortable="true" |
---|
318 | filterable="true" |
---|
319 | exportable="true" |
---|
320 | /> |
---|
321 | <% |
---|
322 | if (reporterProperties != null) |
---|
323 | { |
---|
324 | for (ExtendedProperty ep : reporterProperties) |
---|
325 | { |
---|
326 | String name = ep.getName(); |
---|
327 | %> |
---|
328 | <tbl:columndef |
---|
329 | id="<%="reporter."+name%>" |
---|
330 | property="<%="reporter."+name%>" |
---|
331 | datatype="<%=ep.getType().getStringValue()%>" |
---|
332 | title="<%="[Rep] "+HTML.encodeTags(ep.getTitle())%>" |
---|
333 | sortable="true" |
---|
334 | filterable="true" |
---|
335 | exportable="true" |
---|
336 | formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, ep)%>" |
---|
337 | /> |
---|
338 | <% |
---|
339 | } |
---|
340 | } |
---|
341 | %> |
---|
342 | <% |
---|
343 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
344 | { |
---|
345 | AnnotationType at = loader.getAnnotationType(); |
---|
346 | Enumeration<String, String> annotationEnum = null; |
---|
347 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
348 | if (at.isEnumeration()) |
---|
349 | { |
---|
350 | annotationEnum = new Enumeration<String, String>(); |
---|
351 | if (!at.getDisplayAsList()) annotationEnum.add("", "-none-"); |
---|
352 | List<?> values = at.getValues(); |
---|
353 | for (Object value : values) |
---|
354 | { |
---|
355 | String encoded = formatter.format(value); |
---|
356 | annotationEnum.add(encoded, encoded); |
---|
357 | } |
---|
358 | } |
---|
359 | %> |
---|
360 | <tbl:columndef |
---|
361 | id="<%="at"+at.getId()%>" |
---|
362 | title="<%=HTML.encodeTags(at.getName())+" [A]"%>" |
---|
363 | property="<%="#"+at.getId()%>" |
---|
364 | annotation="true" |
---|
365 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
366 | enumeration="<%=annotationEnum%>" |
---|
367 | smartenum="<%=at.getDisplayAsList() %>" |
---|
368 | sortable="<%=at.getMultiplicity() == 1%>" |
---|
369 | filterable="true" |
---|
370 | exportable="true" |
---|
371 | formatter="<%=formatter%>" |
---|
372 | unit="<%=at.getDefaultUnit()%>" |
---|
373 | /> |
---|
374 | <% |
---|
375 | } |
---|
376 | %> |
---|
377 | <tbl:columndef |
---|
378 | id="permission" |
---|
379 | title="Permission" |
---|
380 | /> |
---|
381 | <tbl:columndef |
---|
382 | id="xt-columns" |
---|
383 | extensions="<%=columnsInvoker%>" |
---|
384 | jspcontext="<%=jspContext%>" |
---|
385 | /> |
---|
386 | <div class="panelgroup bg-filled-50 bottomborder"> |
---|
387 | <tbl:toolbar |
---|
388 | subclass="bottomborder" |
---|
389 | visible="<%=mode.hasToolbar()%>" |
---|
390 | > |
---|
391 | <tbl:button |
---|
392 | id="btnColumns" |
---|
393 | image="columns.png" |
---|
394 | title="Columns…" |
---|
395 | tooltip="Show, hide and re-order columns" |
---|
396 | /> |
---|
397 | <tbl:button |
---|
398 | id="btnNewReporterList" |
---|
399 | image="add.png" |
---|
400 | title="New reporter list…" |
---|
401 | tooltip="Create a new reporter list from matching wells" |
---|
402 | visible="<%=sc.hasPermission(Permission.CREATE, Item.REPORTERLIST)%>" |
---|
403 | /> |
---|
404 | <tbl:button |
---|
405 | id="btnImport" |
---|
406 | data-plugin-type="IMPORT" |
---|
407 | image="import.png" |
---|
408 | title="Import…" |
---|
409 | tooltip="Import data" |
---|
410 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
411 | /> |
---|
412 | <tbl:button |
---|
413 | id="btnExport" |
---|
414 | data-plugin-type="EXPORT" |
---|
415 | image="export.png" |
---|
416 | title="Export…" |
---|
417 | tooltip="Export data" |
---|
418 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
419 | /> |
---|
420 | <tbl:button |
---|
421 | id="btnRunPlugin" |
---|
422 | data-plugin-type="OTHER" |
---|
423 | image="runplugin.png" |
---|
424 | title="Run plugin…" |
---|
425 | tooltip="Run a plugin" |
---|
426 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
427 | /> |
---|
428 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
429 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
430 | </tbl:toolbar> |
---|
431 | <tbl:panel> |
---|
432 | <tbl:presetselector /> |
---|
433 | <tbl:navigator |
---|
434 | page="<%=cc.getPage()%>" |
---|
435 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
436 | totalrows="<%=wells == null ? 0 : wells.getTotalCount()%>" |
---|
437 | visible="<%=mode.hasNavigator()%>" |
---|
438 | /> |
---|
439 | </tbl:panel> |
---|
440 | </div> |
---|
441 | <tbl:data> |
---|
442 | <tbl:headers> |
---|
443 | <tbl:headerrow> |
---|
444 | <tbl:header colspan="3" /> |
---|
445 | <tbl:columnheaders /> |
---|
446 | </tbl:headerrow> |
---|
447 | <tbl:headerrow> |
---|
448 | <tbl:header subclass="index" /> |
---|
449 | <tbl:header |
---|
450 | subclass="check" |
---|
451 | visible="<%=mode.hasCheck()%>" |
---|
452 | ><base:icon |
---|
453 | id="check.uncheck" |
---|
454 | image="check_uncheck.png" |
---|
455 | tooltip="Check/uncheck all" |
---|
456 | |
---|
457 | /></tbl:header> |
---|
458 | <tbl:header |
---|
459 | subclass="check" |
---|
460 | visible="<%=mode.hasRadio()%>" |
---|
461 | /> |
---|
462 | <tbl:header |
---|
463 | subclass="icons" |
---|
464 | visible="<%=mode.hasIcons()%>" |
---|
465 | /> |
---|
466 | <tbl:propertyfilter /> |
---|
467 | </tbl:headerrow> |
---|
468 | </tbl:headers> |
---|
469 | <tbl:rows> |
---|
470 | <% |
---|
471 | if (cc.getMessage() != null) |
---|
472 | { |
---|
473 | %> |
---|
474 | <tbl:panel subclass="bg-filled-50"> |
---|
475 | <div class="messagecontainer error"><%=cc.getMessage()%></div> |
---|
476 | </tbl:panel> |
---|
477 | <% |
---|
478 | cc.setMessage(null); |
---|
479 | } |
---|
480 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
481 | int selectedItemId = cc.getId(); |
---|
482 | if (wells != null) |
---|
483 | { |
---|
484 | while (wells.hasNext()) |
---|
485 | { |
---|
486 | Well item = wells.next(); |
---|
487 | int itemId = item.getId(); |
---|
488 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
489 | String tooltip = mode.isSelectionMode() ? |
---|
490 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
491 | index++; |
---|
492 | numListed++; |
---|
493 | %> |
---|
494 | <tbl:row> |
---|
495 | <tbl:header |
---|
496 | clazz="index" |
---|
497 | ><%=index%></tbl:header> |
---|
498 | <tbl:header |
---|
499 | clazz="check" |
---|
500 | visible="<%=mode.hasCheck()%>" |
---|
501 | ><input |
---|
502 | type="checkbox" |
---|
503 | name="<%=itemId%>" |
---|
504 | value="<%=itemId%>" |
---|
505 | title="TODO" |
---|
506 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
507 | ></tbl:header> |
---|
508 | <tbl:header |
---|
509 | clazz="check" |
---|
510 | visible="<%=mode.hasRadio()%>" |
---|
511 | ><input |
---|
512 | type="radio" |
---|
513 | name="item_id" |
---|
514 | value="<%=itemId%>" |
---|
515 | title="TODO" |
---|
516 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
517 | ></tbl:header> |
---|
518 | <tbl:header |
---|
519 | clazz="icons" |
---|
520 | visible="<%=mode.hasIcons()%>" |
---|
521 | > </tbl:header> |
---|
522 | <tbl:cell column="row"><div |
---|
523 | class="link table-item" |
---|
524 | data-item-id="<%=itemId%>" |
---|
525 | data-no-edit="<%=writePermission ? 0 : 1 %>" |
---|
526 | tabindex="0" |
---|
527 | title="<%=tooltip%>"><tbl:cellvalue value="<%=item.getRow()%>" /></div></tbl:cell> |
---|
528 | <tbl:cell column="column"><tbl:cellvalue value="<%=item.getColumn()%>"/></tbl:cell> |
---|
529 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
530 | <tbl:cell column="parent"> |
---|
531 | <% |
---|
532 | try |
---|
533 | { |
---|
534 | Well parent = item.getParent(); |
---|
535 | if (parent == null) |
---|
536 | { |
---|
537 | %> |
---|
538 | <i>- none -</i> |
---|
539 | <% |
---|
540 | } |
---|
541 | else |
---|
542 | { |
---|
543 | %> |
---|
544 | <%=Base.getLink(ID, |
---|
545 | parent.getPlate().getName() + " [" + parent.getRow() + ", " + parent.getColumn() + "]", |
---|
546 | Item.WELL, parent.getId(), true)%> |
---|
547 | <% |
---|
548 | } |
---|
549 | } |
---|
550 | catch (PermissionDeniedException ex) |
---|
551 | { |
---|
552 | %> |
---|
553 | <i>- denied -</i> |
---|
554 | <% |
---|
555 | } |
---|
556 | %> |
---|
557 | </tbl:cell> |
---|
558 | <% |
---|
559 | ReporterData reporter = item.getReporter(); |
---|
560 | if (reporter == null) |
---|
561 | { |
---|
562 | %> |
---|
563 | <tbl:cell column="reporter.name"><i>- none -</i></tbl:cell> |
---|
564 | <tbl:cell column="reporter.externalId"><i>- none -</i></tbl:cell> |
---|
565 | <% |
---|
566 | } |
---|
567 | else |
---|
568 | { |
---|
569 | %> |
---|
570 | <tbl:cell column="reporter.name"><%=Base.getLink(ID, reporter.getName(), Item.REPORTER, reporter.getId(), true)%></tbl:cell> |
---|
571 | <tbl:cell column="reporter.externalId"><%=HTML.encodeTags(reporter.getExternalId())%></tbl:cell> |
---|
572 | <tbl:cell column="reporter.symbol"><%=HTML.encodeTags(reporter.getSymbol())%></tbl:cell> |
---|
573 | <tbl:cell column="reporter.description"><%=HTML.encodeTags(reporter.getDescription())%></tbl:cell> |
---|
574 | <tbl:cell column="reporter.entryDate" value="<%=reporter.getEntryDate()%>" /> |
---|
575 | <tbl:cell column="reporter.lastUpdate" value="<%=reporter.getLastUpdate()%>" /> |
---|
576 | <tbl:cell column="reporter.reporterType" |
---|
577 | ><base:propertyvalue |
---|
578 | dbcontrol="<%=dc%>" |
---|
579 | item="<%=reporter%>" |
---|
580 | property="reporterType" |
---|
581 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
582 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
583 | /></tbl:cell> |
---|
584 | <% |
---|
585 | if (reporterProperties != null) |
---|
586 | { |
---|
587 | for (ExtendedProperty ep : reporterProperties) |
---|
588 | { |
---|
589 | String name = ep.getName(); |
---|
590 | %> |
---|
591 | <tbl:cell column="<%="reporter."+name%>"><tbl:cellvalue value="<%=reporter.getExtended(name)%>" /></tbl:cell> |
---|
592 | <% |
---|
593 | } |
---|
594 | } |
---|
595 | } |
---|
596 | if (item.isAnnotated()) |
---|
597 | { |
---|
598 | AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId()); |
---|
599 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
600 | { |
---|
601 | %> |
---|
602 | <tbl:cell |
---|
603 | column="<%="at"+loader.getId()%>" |
---|
604 | ><% |
---|
605 | if (loader.find(snapshot)) |
---|
606 | { |
---|
607 | %><tbl:cellvalue |
---|
608 | list="<%=loader.getValues()%>" |
---|
609 | suffix="<%=loader.getUnitSymbol()%>" |
---|
610 | /><% |
---|
611 | } |
---|
612 | %></tbl:cell> |
---|
613 | <% |
---|
614 | } |
---|
615 | } |
---|
616 | %> |
---|
617 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
618 | <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
---|
619 | <tbl:cell column="xt-columns" /> |
---|
620 | </tbl:xt-cells> |
---|
621 | </tbl:row> |
---|
622 | <% |
---|
623 | } |
---|
624 | } |
---|
625 | if (numListed == 0) |
---|
626 | { |
---|
627 | %> |
---|
628 | <tbl:panel subclass="bg-filled-50"> |
---|
629 | <div class="messagecontainer note"> |
---|
630 | <%=wells == null || wells.getTotalCount() == 0 ? "No wells were found" : "No wells on this page. Please select another page!" %> |
---|
631 | </div> |
---|
632 | </tbl:panel> |
---|
633 | <% |
---|
634 | } |
---|
635 | %> |
---|
636 | </tbl:rows> |
---|
637 | </tbl:data> |
---|
638 | </tbl:table> |
---|
639 | |
---|
640 | </t:tab> |
---|
641 | <t:tab id="history" title="Change history" |
---|
642 | tooltip="Displays a log of all modifications made to this item" |
---|
643 | visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" /> |
---|
644 | </t:tabcontrol> |
---|
645 | |
---|
646 | |
---|
647 | <base:buttongroup> |
---|
648 | <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
649 | <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
650 | <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
651 | </base:buttongroup> |
---|
652 | |
---|
653 | </base:body> |
---|
654 | </base:page> |
---|
655 | <% |
---|
656 | } |
---|
657 | finally |
---|
658 | { |
---|
659 | if (wells != null) wells.close(); |
---|
660 | if (dc != null) dc.close(); |
---|
661 | } |
---|
662 | %> |
---|