1 | <%-- $Id: list_features.jsp 5917 2011-12-19 11:28:45Z 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.data.FeatureData" |
---|
32 | import="net.sf.basedb.core.data.ReporterData" |
---|
33 | import="net.sf.basedb.core.ArrayDesign" |
---|
34 | import="net.sf.basedb.core.ArrayDesignBlock" |
---|
35 | import="net.sf.basedb.core.Feature" |
---|
36 | import="net.sf.basedb.core.FeatureIdentificationMethod" |
---|
37 | import="net.sf.basedb.core.ReporterType" |
---|
38 | import="net.sf.basedb.core.Reporter" |
---|
39 | import="net.sf.basedb.core.Well" |
---|
40 | import="net.sf.basedb.core.ItemQuery" |
---|
41 | import="net.sf.basedb.core.ItemResultIterator" |
---|
42 | import="net.sf.basedb.core.DataQuery" |
---|
43 | import="net.sf.basedb.core.DataResultIterator" |
---|
44 | import="net.sf.basedb.core.ItemResultList" |
---|
45 | import="net.sf.basedb.core.Permission" |
---|
46 | import="net.sf.basedb.core.PluginDefinition" |
---|
47 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
48 | import="net.sf.basedb.core.PlateGeometry" |
---|
49 | import="net.sf.basedb.core.ExtendedProperty" |
---|
50 | import="net.sf.basedb.core.ExtendedProperties" |
---|
51 | import="net.sf.basedb.core.query.Aggregations" |
---|
52 | import="net.sf.basedb.core.query.Restrictions" |
---|
53 | import="net.sf.basedb.core.query.Expressions" |
---|
54 | import="net.sf.basedb.core.query.Orders" |
---|
55 | import="net.sf.basedb.core.query.Hql" |
---|
56 | import="net.sf.basedb.core.query.Selects" |
---|
57 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
58 | import="net.sf.basedb.core.plugin.Plugin" |
---|
59 | import="net.sf.basedb.util.Enumeration" |
---|
60 | import="net.sf.basedb.clients.web.Base" |
---|
61 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
62 | import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
---|
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.util.extensions.ExtensionsInvoker" |
---|
73 | import="java.util.List" |
---|
74 | import="java.util.Map" |
---|
75 | import="java.util.Date" |
---|
76 | %> |
---|
77 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
78 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
79 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
80 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
81 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
82 | <%! |
---|
83 | private static final Item itemType = Item.FEATURE; |
---|
84 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
85 | %> |
---|
86 | <% |
---|
87 | final int arrayDesignId = Values.getInt(request.getParameter("arraydesign_id")); |
---|
88 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
89 | final String ID = sc.getId(); |
---|
90 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
91 | |
---|
92 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
93 | final String callback = request.getParameter("callback"); |
---|
94 | final String title = mode.generateTitle("feature", "features"); |
---|
95 | final DbControl dc = sc.newDbControl(); |
---|
96 | DataResultIterator<FeatureData> features = null; |
---|
97 | try |
---|
98 | { |
---|
99 | final ArrayDesign design = ArrayDesign.getById(dc, arrayDesignId); |
---|
100 | final FeatureIdentificationMethod fiMethod = design.getFeatureIdentificationMethod(); |
---|
101 | Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
---|
102 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
103 | |
---|
104 | WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); |
---|
105 | WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); |
---|
106 | |
---|
107 | final DataQuery<FeatureData> query = design.getFeatures(); |
---|
108 | |
---|
109 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
110 | final ItemQuery<ReporterType> typeQuery = ReporterType.getQuery(); |
---|
111 | typeQuery.order(Orders.asc(Hql.property("name"))); |
---|
112 | typeQuery.setCacheResult(true); |
---|
113 | |
---|
114 | List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData"); |
---|
115 | |
---|
116 | Enumeration<String, String> plateRows = new Enumeration<String, String>(); |
---|
117 | final ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery(); |
---|
118 | geometryQuery.order(Orders.desc(Hql.property("rows"))); |
---|
119 | ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc); |
---|
120 | int maxRows = result.next().getRows(); |
---|
121 | for (int row = 0; row < maxRows; row++) |
---|
122 | { |
---|
123 | plateRows.add(Integer.toString(row), rowFormatter.format(row)); |
---|
124 | } |
---|
125 | |
---|
126 | try |
---|
127 | { |
---|
128 | query.join(Hql.leftJoin(null, "reporter", "rpt", null, true)); |
---|
129 | cc.configureQuery(dc, query, true); |
---|
130 | if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row"))); |
---|
131 | if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column"))); |
---|
132 | features = query.iterate(dc); |
---|
133 | } |
---|
134 | catch (Throwable t) |
---|
135 | { |
---|
136 | cc.setMessage(t.getMessage()); |
---|
137 | t.printStackTrace(); |
---|
138 | } |
---|
139 | int numListed = 0; |
---|
140 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
---|
141 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
142 | %> |
---|
143 | <base:page title="<%=title%>"> |
---|
144 | <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css"> |
---|
145 | <ext:scripts context="<%=jspContext%>" /> |
---|
146 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
147 | <script language="JavaScript"> |
---|
148 | var submitPage = 'index.jsp'; |
---|
149 | var formId = 'features'; |
---|
150 | function viewItem(itemId) |
---|
151 | { |
---|
152 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false, '&arraydesign_id=<%=arrayDesignId%>'); |
---|
153 | } |
---|
154 | function itemOnClick(evt, itemId) |
---|
155 | { |
---|
156 | viewItem(itemId); |
---|
157 | } |
---|
158 | function configureColumns() |
---|
159 | { |
---|
160 | Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
161 | } |
---|
162 | function runPlugin(cmd) |
---|
163 | { |
---|
164 | Table.submitToPopup(formId, cmd, 750, 500); |
---|
165 | } |
---|
166 | function returnSelected() |
---|
167 | { |
---|
168 | Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); |
---|
169 | window.close(); |
---|
170 | } |
---|
171 | function presetOnChange() |
---|
172 | { |
---|
173 | Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); |
---|
174 | } |
---|
175 | function switchTab(tabControlId, tabId) |
---|
176 | { |
---|
177 | if (tabId == 'properties' || tabId == 'annotations' || tabId == 'overview' || tabId == 'history') |
---|
178 | { |
---|
179 | location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=arrayDesignId%>&tab='+tabId; |
---|
180 | } |
---|
181 | else |
---|
182 | { |
---|
183 | TabControl.setActiveTab(tabControlId, tabId); |
---|
184 | } |
---|
185 | } |
---|
186 | function newReporterList() |
---|
187 | { |
---|
188 | Table.submitToPopup(formId, 'CreateReporterList', 600, 400); |
---|
189 | } |
---|
190 | </script> |
---|
191 | </base:head> |
---|
192 | |
---|
193 | <base:body> |
---|
194 | <p> |
---|
195 | <p:path> |
---|
196 | <p:pathelement title="Array designs" href="<%="../index.jsp?ID="+ID%>" /> |
---|
197 | <p:pathelement title="<%=HTML.encodeTags(design.getName())%>" /> |
---|
198 | </p:path> |
---|
199 | |
---|
200 | <t:tabcontrol id="main" active="images" switch="switchTab"> |
---|
201 | <t:tab id="properties" title="Properties" /> |
---|
202 | <t:tab id="annotations" title="Annotations" /> |
---|
203 | |
---|
204 | <t:tab id="images" title="Features"> |
---|
205 | |
---|
206 | <% |
---|
207 | if (cc.getMessage() != null) |
---|
208 | { |
---|
209 | %> |
---|
210 | <div class="error"><%=cc.getMessage()%></div> |
---|
211 | <% |
---|
212 | cc.setMessage(null); |
---|
213 | } |
---|
214 | %> |
---|
215 | <tbl:table |
---|
216 | id="features" |
---|
217 | clazz="itemlist" |
---|
218 | columns="<%=cc.getSetting("columns")%>" |
---|
219 | sortby="<%=cc.getSortProperty()%>" |
---|
220 | direction="<%=cc.getSortDirection()%>" |
---|
221 | title="<%=title%>" |
---|
222 | action="index.jsp" |
---|
223 | sc="<%=sc%>" |
---|
224 | item="<%=itemType%>" |
---|
225 | > |
---|
226 | <tbl:hidden |
---|
227 | name="mode" |
---|
228 | value="<%=mode.getName()%>" |
---|
229 | /> |
---|
230 | <tbl:hidden |
---|
231 | name="arraydesign_id" |
---|
232 | value="<%=String.valueOf(arrayDesignId)%>" |
---|
233 | /> |
---|
234 | <tbl:hidden |
---|
235 | name="callback" |
---|
236 | value="<%=callback%>" |
---|
237 | skip="<%=callback == null%>" |
---|
238 | /> |
---|
239 | <tbl:columndef |
---|
240 | id="position" |
---|
241 | clazz="uniquecol" |
---|
242 | property="position" |
---|
243 | datatype="int" |
---|
244 | title="Position" |
---|
245 | sortable="true" |
---|
246 | filterable="true" |
---|
247 | exportable="true" |
---|
248 | show="<%=fiMethod == FeatureIdentificationMethod.FEATURE_ID ? "auto" : "always"%>" |
---|
249 | /> |
---|
250 | <tbl:columndef |
---|
251 | id="id" |
---|
252 | clazz="uniquecol" |
---|
253 | property="id" |
---|
254 | datatype="int" |
---|
255 | title="ID" |
---|
256 | sortable="true" |
---|
257 | filterable="true" |
---|
258 | exportable="true" |
---|
259 | /> |
---|
260 | <tbl:columndef |
---|
261 | id="externalId" |
---|
262 | clazz="uniquecol" |
---|
263 | property="externalId" |
---|
264 | datatype="string" |
---|
265 | title="Feature ID" |
---|
266 | sortable="true" |
---|
267 | filterable="true" |
---|
268 | exportable="true" |
---|
269 | show="<%=fiMethod == FeatureIdentificationMethod.FEATURE_ID ? "always" : "auto"%>" |
---|
270 | /> |
---|
271 | <tbl:columndef |
---|
272 | id="block" |
---|
273 | property="arrayDesignBlock.blockNumber" |
---|
274 | datatype="int" |
---|
275 | title="Block" |
---|
276 | sortable="true" |
---|
277 | filterable="true" |
---|
278 | exportable="true" |
---|
279 | /> |
---|
280 | <tbl:columndef |
---|
281 | id="metaGridX" |
---|
282 | property="arrayDesignBlock.metaGridX" |
---|
283 | datatype="int" |
---|
284 | title="Meta grid X" |
---|
285 | sortable="true" |
---|
286 | filterable="true" |
---|
287 | exportable="true" |
---|
288 | /> |
---|
289 | <tbl:columndef |
---|
290 | id="metaGridY" |
---|
291 | property="arrayDesignBlock.metaGridY" |
---|
292 | datatype="int" |
---|
293 | title="Meta grid Y" |
---|
294 | sortable="true" |
---|
295 | filterable="true" |
---|
296 | exportable="true" |
---|
297 | /> |
---|
298 | <tbl:columndef |
---|
299 | id="row" |
---|
300 | property="row" |
---|
301 | datatype="int" |
---|
302 | title="Row" |
---|
303 | sortable="true" |
---|
304 | filterable="true" |
---|
305 | exportable="true" |
---|
306 | /> |
---|
307 | <tbl:columndef |
---|
308 | id="column" |
---|
309 | property="column" |
---|
310 | datatype="int" |
---|
311 | title="Column" |
---|
312 | sortable="true" |
---|
313 | filterable="true" |
---|
314 | exportable="true" |
---|
315 | /> |
---|
316 | <tbl:columndef |
---|
317 | id="blockSizeX" |
---|
318 | property="arrayDesignBlock.blockSizeX" |
---|
319 | datatype="int" |
---|
320 | title="Block size X" |
---|
321 | sortable="true" |
---|
322 | filterable="true" |
---|
323 | exportable="true" |
---|
324 | /> |
---|
325 | <tbl:columndef |
---|
326 | id="blockSizeY" |
---|
327 | property="arrayDesignBlock.blockSizeY" |
---|
328 | datatype="int" |
---|
329 | title="Block size Y" |
---|
330 | sortable="true" |
---|
331 | filterable="true" |
---|
332 | exportable="true" |
---|
333 | /> |
---|
334 | <tbl:columndef |
---|
335 | id="originX" |
---|
336 | property="arrayDesignBlock.originX" |
---|
337 | datatype="int" |
---|
338 | title="Origin X" |
---|
339 | sortable="true" |
---|
340 | filterable="true" |
---|
341 | exportable="true" |
---|
342 | /> |
---|
343 | <tbl:columndef |
---|
344 | id="originY" |
---|
345 | property="arrayDesignBlock.originY" |
---|
346 | datatype="int" |
---|
347 | title="Origin Y" |
---|
348 | sortable="true" |
---|
349 | filterable="true" |
---|
350 | exportable="true" |
---|
351 | /> |
---|
352 | <tbl:columndef |
---|
353 | id="spacingX" |
---|
354 | property="arrayDesignBlock.spacingX" |
---|
355 | datatype="int" |
---|
356 | title="Spacing X" |
---|
357 | sortable="true" |
---|
358 | filterable="true" |
---|
359 | exportable="true" |
---|
360 | /> |
---|
361 | <tbl:columndef |
---|
362 | id="spacingY" |
---|
363 | property="arrayDesignBlock.spacingY" |
---|
364 | datatype="int" |
---|
365 | title="Spacing Y" |
---|
366 | sortable="true" |
---|
367 | filterable="true" |
---|
368 | exportable="true" |
---|
369 | /> |
---|
370 | <tbl:columndef |
---|
371 | id="diameter" |
---|
372 | property="arrayDesignBlock.featureDiameter" |
---|
373 | datatype="int" |
---|
374 | title="Diameter" |
---|
375 | sortable="true" |
---|
376 | filterable="true" |
---|
377 | exportable="true" |
---|
378 | /> |
---|
379 | <tbl:columndef |
---|
380 | id="reporterList" |
---|
381 | property="$rpt.£reporterListScores" |
---|
382 | datatype="int" |
---|
383 | title="[Rep] Reporter list" |
---|
384 | filterable="true" |
---|
385 | enumeration="<%=Base.getReporterListsEnum(dc)%>" |
---|
386 | multiple="false" |
---|
387 | /> |
---|
388 | <tbl:columndef |
---|
389 | id="reporter.name" |
---|
390 | property="reporter.name" |
---|
391 | datatype="string" |
---|
392 | title="[Rep] Name" |
---|
393 | sortable="true" |
---|
394 | filterable="true" |
---|
395 | exportable="true" |
---|
396 | /> |
---|
397 | <tbl:columndef |
---|
398 | id="reporter.externalId" |
---|
399 | clazz="uniquecol" |
---|
400 | property="reporter.externalId" |
---|
401 | datatype="string" |
---|
402 | title="[Rep] ID" |
---|
403 | sortable="true" |
---|
404 | filterable="true" |
---|
405 | exportable="true" |
---|
406 | /> |
---|
407 | <tbl:columndef |
---|
408 | id="reporter.symbol" |
---|
409 | property="reporter.symbol" |
---|
410 | datatype="string" |
---|
411 | title="[Rep] Gene symbol" |
---|
412 | sortable="true" |
---|
413 | filterable="true" |
---|
414 | exportable="true" |
---|
415 | /> |
---|
416 | <tbl:columndef |
---|
417 | id="reporter.description" |
---|
418 | property="reporter.description" |
---|
419 | datatype="string" |
---|
420 | title="[Rep] Description" |
---|
421 | sortable="true" |
---|
422 | filterable="true" |
---|
423 | exportable="true" |
---|
424 | /> |
---|
425 | <tbl:columndef |
---|
426 | id="reporter.entryDate" |
---|
427 | property="reporter.entryDate" |
---|
428 | datatype="date" |
---|
429 | title="[Rep] Registered" |
---|
430 | sortable="true" |
---|
431 | filterable="true" |
---|
432 | exportable="true" |
---|
433 | formatter="<%=dateFormatter%>" |
---|
434 | /> |
---|
435 | <tbl:columndef |
---|
436 | id="reporter.lastUpdate" |
---|
437 | property="reporter.lastUpdate" |
---|
438 | datatype="timestamp" |
---|
439 | title="[Rep] Last update" |
---|
440 | sortable="true" |
---|
441 | filterable="true" |
---|
442 | exportable="true" |
---|
443 | formatter="<%=dateTimeFormatter%>" |
---|
444 | /> |
---|
445 | <% |
---|
446 | Enumeration<String, String> types = new Enumeration<String, String>(); |
---|
447 | ItemResultList<ReporterType> reporterTypes = typeQuery.list(dc); |
---|
448 | types.add("", "- none -"); |
---|
449 | for (ReporterType rt : reporterTypes) |
---|
450 | { |
---|
451 | types.add(Integer.toString(rt.getId()), HTML.encodeTags(rt.getName())); |
---|
452 | } |
---|
453 | %> |
---|
454 | <tbl:columndef |
---|
455 | id="reporter.reporterType" |
---|
456 | property="reporter.reporterType" |
---|
457 | sortproperty="reporter.reporterType.name" |
---|
458 | exportproperty="reporter.reporterType.name" |
---|
459 | datatype="int" |
---|
460 | enumeration="<%=types%>" |
---|
461 | title="[Rep] Type" |
---|
462 | sortable="true" |
---|
463 | filterable="true" |
---|
464 | exportable="true" |
---|
465 | /> |
---|
466 | <% |
---|
467 | if (reporterProperties != null) |
---|
468 | { |
---|
469 | for (ExtendedProperty ep : reporterProperties) |
---|
470 | { |
---|
471 | String name = ep.getName(); |
---|
472 | %> |
---|
473 | <tbl:columndef |
---|
474 | id="<%="reporter."+name%>" |
---|
475 | property="<%="reporter."+name%>" |
---|
476 | datatype="<%=ep.getType().getStringValue()%>" |
---|
477 | title="<%="[Rep] "+HTML.encodeTags(ep.getTitle())%>" |
---|
478 | sortable="true" |
---|
479 | filterable="true" |
---|
480 | exportable="true" |
---|
481 | formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, ep)%>" |
---|
482 | /> |
---|
483 | <% |
---|
484 | } |
---|
485 | } |
---|
486 | %> |
---|
487 | <tbl:columndef |
---|
488 | id="well.row" |
---|
489 | property="well.row" |
---|
490 | datatype="int" |
---|
491 | title="[Well] Row" |
---|
492 | sortable="true" |
---|
493 | filterable="true" |
---|
494 | enumeration="<%=plateRows%>" |
---|
495 | exportable="true" |
---|
496 | formatter="<%=rowFormatter%>" |
---|
497 | /> |
---|
498 | <tbl:columndef |
---|
499 | id="well.column" |
---|
500 | property="well.column" |
---|
501 | datatype="int" |
---|
502 | title="[Well] Column" |
---|
503 | sortable="true" |
---|
504 | filterable="true" |
---|
505 | exportable="true" |
---|
506 | formatter="<%=columnFormatter%>" |
---|
507 | /> |
---|
508 | <tbl:columndef |
---|
509 | id="well.plate" |
---|
510 | property="well.plate.name" |
---|
511 | datatype="string" |
---|
512 | title="[Well] Plate" |
---|
513 | sortable="true" |
---|
514 | filterable="true" |
---|
515 | exportable="true" |
---|
516 | /> |
---|
517 | <tbl:toolbar |
---|
518 | visible="<%=mode.hasToolbar()%>" |
---|
519 | > |
---|
520 | <tbl:button |
---|
521 | image="columns.gif" |
---|
522 | onclick="configureColumns()" |
---|
523 | title="Columns…" |
---|
524 | tooltip="Show, hide and re-order columns" |
---|
525 | /> |
---|
526 | <tbl:button |
---|
527 | image="add.png" |
---|
528 | onclick="newReporterList()" |
---|
529 | title="New reporter list…" |
---|
530 | tooltip="Create a new reporter list from matching features" |
---|
531 | visible="<%=sc.hasPermission(Permission.CREATE, Item.REPORTERLIST)%>" |
---|
532 | /> |
---|
533 | <tbl:button |
---|
534 | image="import.gif" |
---|
535 | onclick="runPlugin('ImportItems')" |
---|
536 | title="Import…" |
---|
537 | tooltip="Import data" |
---|
538 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
539 | /> |
---|
540 | <tbl:button |
---|
541 | image="export.gif" |
---|
542 | onclick="runPlugin('ExportItems')" |
---|
543 | title="Export…" |
---|
544 | tooltip="Export data" |
---|
545 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
546 | /> |
---|
547 | <tbl:button |
---|
548 | image="runplugin.gif" |
---|
549 | onclick="runPlugin('RunListPlugin')" |
---|
550 | title="Run plugin…" |
---|
551 | tooltip="Run a plugin" |
---|
552 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
553 | /> |
---|
554 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
555 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
556 | </tbl:toolbar> |
---|
557 | <tbl:navigator |
---|
558 | page="<%=cc.getPage()%>" |
---|
559 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
560 | totalrows="<%=features == null ? 0 : features.getTotalCount()%>" |
---|
561 | visible="<%=mode.hasNavigator()%>" |
---|
562 | /> |
---|
563 | <tbl:data> |
---|
564 | <tbl:columns> |
---|
565 | <tbl:presetselector |
---|
566 | clazz="columnheader" |
---|
567 | colspan="3" |
---|
568 | onchange="presetOnChange()" |
---|
569 | /> |
---|
570 | </tbl:columns> |
---|
571 | |
---|
572 | <tr> |
---|
573 | <tbl:header |
---|
574 | clazz="index" |
---|
575 | > </tbl:header> |
---|
576 | <tbl:header |
---|
577 | clazz="check" |
---|
578 | visible="<%=mode.hasCheck()%>" |
---|
579 | ><base:icon |
---|
580 | image="check_uncheck.gif" |
---|
581 | tooltip="Check/uncheck all" |
---|
582 | onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;" |
---|
583 | /></tbl:header> |
---|
584 | <tbl:header |
---|
585 | clazz="check" |
---|
586 | visible="<%=mode.hasRadio()%>" |
---|
587 | /> |
---|
588 | <tbl:header |
---|
589 | clazz="icons" |
---|
590 | visible="<%=mode.hasIcons()%>" |
---|
591 | > </tbl:header> |
---|
592 | <tbl:propertyfilter /> |
---|
593 | </tr> |
---|
594 | |
---|
595 | <tbl:rows> |
---|
596 | <% |
---|
597 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
598 | int selectedItemId = Values.getInt(request.getParameter("item_id")); |
---|
599 | if (features != null) |
---|
600 | { |
---|
601 | String tooltip = mode.isSelectionMode() ? |
---|
602 | "Select this item" : "View this item"; |
---|
603 | while (features.hasNext()) |
---|
604 | { |
---|
605 | FeatureData item = features.next(); |
---|
606 | ArrayDesignBlock block = Feature.getArrayDesignBlock(dc, item); |
---|
607 | int itemId = item.getId(); |
---|
608 | index++; |
---|
609 | numListed++; |
---|
610 | %> |
---|
611 | <tbl:row> |
---|
612 | <tbl:header |
---|
613 | clazz="index" |
---|
614 | ><%=index%></tbl:header> |
---|
615 | <tbl:header |
---|
616 | clazz="check" |
---|
617 | visible="<%=mode.hasCheck()%>" |
---|
618 | ><input |
---|
619 | type="checkbox" |
---|
620 | name="<%=itemId%>" |
---|
621 | value="<%=itemId%>" |
---|
622 | title="TODO" |
---|
623 | <%=request.getParameter(Integer.toString(itemId)) == null ? "" : "checked"%> |
---|
624 | ></tbl:header> |
---|
625 | <tbl:header |
---|
626 | clazz="check" |
---|
627 | visible="<%=mode.hasRadio()%>" |
---|
628 | ><input |
---|
629 | type="radio" |
---|
630 | name="item_id" |
---|
631 | value="<%=itemId%>" |
---|
632 | title="TODO" |
---|
633 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
634 | ></tbl:header> |
---|
635 | <tbl:header |
---|
636 | clazz="icons" |
---|
637 | visible="<%=mode.hasIcons()%>" |
---|
638 | ></tbl:header> |
---|
639 | <tbl:cell column="position"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" |
---|
640 | title="<%=tooltip%>"><%=item.getPosition()%></div></tbl:cell> |
---|
641 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
642 | <tbl:cell column="externalId"><div class="link" onclick="itemOnClick(event, <%=itemId%>)" |
---|
643 | title="<%=tooltip%>"><%=HTML.encodeTags(item.getExternalId())%></div></tbl:cell> |
---|
644 | <tbl:cell column="block"><%=block.getBlockNumber()%></tbl:cell> |
---|
645 | <tbl:cell column="row"><%=item.getRow()%></tbl:cell> |
---|
646 | <tbl:cell column="column"><%=item.getColumn()%></tbl:cell> |
---|
647 | <tbl:cell column="metaGridX"><%=block.getMetaGridX()%></tbl:cell> |
---|
648 | <tbl:cell column="metaGridY"><%=block.getMetaGridY()%></tbl:cell> |
---|
649 | <tbl:cell column="blockSizeX"><%=block.getBlockSizeX()%></tbl:cell> |
---|
650 | <tbl:cell column="blockSizeY"><%=block.getBlockSizeY()%></tbl:cell> |
---|
651 | <tbl:cell column="originX"><%=block.getOriginX()%></tbl:cell> |
---|
652 | <tbl:cell column="originY"><%=block.getOriginY()%></tbl:cell> |
---|
653 | <tbl:cell column="spacingX"><%=block.getSpacingX()%></tbl:cell> |
---|
654 | <tbl:cell column="spacingY"><%=block.getSpacingY()%></tbl:cell> |
---|
655 | <tbl:cell column="diameter"><%=block.getFeatureDiameter()%></tbl:cell> |
---|
656 | <% |
---|
657 | ReporterData reporter = item.getReporter(); |
---|
658 | if (reporter == null) |
---|
659 | { |
---|
660 | %> |
---|
661 | <tbl:cell column="reporter.name"><i>- none -</i></tbl:cell> |
---|
662 | <tbl:cell column="reporter.externalId"><i>- none -</i></tbl:cell> |
---|
663 | <tbl:cell column="reporter.symbol"><i>- none -</i></tbl:cell> |
---|
664 | <tbl:cell column="reporter.description"><i>- none -</i></tbl:cell> |
---|
665 | <tbl:cell column="entryDate"><i>- none -</i></tbl:cell> |
---|
666 | <tbl:cell column="reporter.lastUpdate"><i>- none -</i></tbl:cell> |
---|
667 | <tbl:cell column="reporter.reporterType"><i>- none -</i></tbl:cell> |
---|
668 | <% |
---|
669 | if (reporterProperties != null) |
---|
670 | { |
---|
671 | for (ExtendedProperty ep : reporterProperties) |
---|
672 | { |
---|
673 | String name = ep.getName(); |
---|
674 | %> |
---|
675 | <tbl:cell column="<%="reporter."+name%>"><i>- none -</i></tbl:cell> |
---|
676 | <% |
---|
677 | } |
---|
678 | } |
---|
679 | } |
---|
680 | else |
---|
681 | { |
---|
682 | %> |
---|
683 | <tbl:cell column="reporter.name"><%=Base.getLink(ID, reporter.getName(), Item.REPORTER, reporter.getId(), true)%></tbl:cell> |
---|
684 | <tbl:cell column="reporter.externalId"><%=HTML.encodeTags(reporter.getExternalId())%></tbl:cell> |
---|
685 | <tbl:cell column="reporter.symbol"><%=HTML.encodeTags(reporter.getSymbol())%></tbl:cell> |
---|
686 | <tbl:cell column="reporter.description"><%=HTML.encodeTags(reporter.getDescription())%></tbl:cell> |
---|
687 | <tbl:cell column="reporter.entryDate" value="<%=reporter.getEntryDate()%>" /> |
---|
688 | <tbl:cell column="reporter.lastUpdate" value="<%=reporter.getLastUpdate()%>" /> |
---|
689 | <tbl:cell column="reporter.reporterType" |
---|
690 | ><base:propertyvalue |
---|
691 | dbcontrol="<%=dc%>" |
---|
692 | item="<%=reporter%>" |
---|
693 | property="reporterType" |
---|
694 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
695 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
696 | /></tbl:cell> |
---|
697 | <% |
---|
698 | if (reporterProperties != null) |
---|
699 | { |
---|
700 | for (ExtendedProperty ep : reporterProperties) |
---|
701 | { |
---|
702 | String name = ep.getName(); |
---|
703 | %> |
---|
704 | <tbl:cell column="<%="reporter."+name%>"><tbl:cellvalue value="<%=reporter.getExtended(name)%>" /></tbl:cell> |
---|
705 | <% |
---|
706 | } |
---|
707 | } |
---|
708 | } |
---|
709 | %> |
---|
710 | <% |
---|
711 | Well well = null; |
---|
712 | boolean readWell = true; |
---|
713 | try |
---|
714 | { |
---|
715 | well = Feature.getWell(dc, item); |
---|
716 | } |
---|
717 | catch (PermissionDeniedException ex) |
---|
718 | { |
---|
719 | readWell = false; |
---|
720 | } |
---|
721 | if (!readWell) |
---|
722 | { |
---|
723 | %> |
---|
724 | <tbl:cell column="well.row"><i>- denied -</i></tbl:cell> |
---|
725 | <tbl:cell column="well.column"><i>- denied -</i></tbl:cell> |
---|
726 | <tbl:cell column="well.plate"><i>- denied -</i></tbl:cell> |
---|
727 | <% |
---|
728 | } |
---|
729 | else if (well == null) |
---|
730 | { |
---|
731 | %> |
---|
732 | <tbl:cell column="well.row"><i>- none -</i></tbl:cell> |
---|
733 | <tbl:cell column="well.column"><i>- none -</i></tbl:cell> |
---|
734 | <tbl:cell column="well.plate"><i>- none -</i></tbl:cell> |
---|
735 | <% |
---|
736 | } |
---|
737 | else |
---|
738 | { |
---|
739 | %> |
---|
740 | <tbl:cell column="well.row"><tbl:cellvalue value="<%=well.getRow()%>"/></tbl:cell> |
---|
741 | <tbl:cell column="well.column"><tbl:cellvalue value="<%=well.getColumn()%>"/></tbl:cell> |
---|
742 | <tbl:cell column="well.plate"><%=Base.getLinkedName(ID, well.getPlate(), false, true)%></tbl:cell> |
---|
743 | <% |
---|
744 | } |
---|
745 | %> |
---|
746 | </tbl:row> |
---|
747 | <% |
---|
748 | } |
---|
749 | } |
---|
750 | %> |
---|
751 | </tbl:rows> |
---|
752 | </tbl:data> |
---|
753 | <% |
---|
754 | if (numListed == 0) |
---|
755 | { |
---|
756 | %> |
---|
757 | <tbl:panel><%=features == null || features.getTotalCount() == 0 ? "No features were found" : "No features on this page. Please select another page!" %></tbl:panel> |
---|
758 | <% |
---|
759 | } |
---|
760 | else |
---|
761 | { |
---|
762 | %> |
---|
763 | <tbl:navigator |
---|
764 | page="<%=cc.getPage()%>" |
---|
765 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
766 | totalrows="<%=features == null ? 0 : features.getTotalCount()%>" |
---|
767 | visible="<%=mode.hasNavigator()%>" |
---|
768 | locked="true" |
---|
769 | /> |
---|
770 | <% |
---|
771 | } |
---|
772 | %> |
---|
773 | </tbl:table> |
---|
774 | <base:buttongroup> |
---|
775 | <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
776 | <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
777 | <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
778 | </base:buttongroup> |
---|
779 | </t:tab> |
---|
780 | <t:tab id="overview" title="Overview" |
---|
781 | tooltip="Display a tree overview of related items" /> |
---|
782 | <t:tab id="history" title="Change history" |
---|
783 | tooltip="Displays a log of all modifications made to this item" |
---|
784 | visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" /> |
---|
785 | </t:tabcontrol> |
---|
786 | |
---|
787 | </base:body> |
---|
788 | </base:page> |
---|
789 | <% |
---|
790 | } |
---|
791 | finally |
---|
792 | { |
---|
793 | if (features != null) features.close(); |
---|
794 | if (dc != null) dc.close(); |
---|
795 | } |
---|
796 | %> |
---|