source: trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp @ 6699

Last change on this file since 6699 was 6699, checked in by Nicklas Nordborg, 9 years ago

References #1912: Add more filter rows in list pages

Fixes a problem with using non-unique id for the 'Add filter row' icon when used on pages that has multiple lists. This caused the icon to not work or add rows to the incorrect list.

The add/remove icons are now based on class names instead which means we can target each icon within the table context it is defined in.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 29.7 KB
Line 
1<%-- $Id: list_rawdata.jsp 6699 2015-01-30 10:32:48Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Johan Enell, Jari Häkkinen, Nicklas Nordborg
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.RawBioAssay"
32  import="net.sf.basedb.core.RawDataType"
33  import="net.sf.basedb.core.RawDataProperty"
34  import="net.sf.basedb.core.ReporterType"
35  import="net.sf.basedb.core.Feature"
36  import="net.sf.basedb.core.Reporter"
37  import="net.sf.basedb.core.ArrayDesignBlock"
38  import="net.sf.basedb.core.Well"
39  import="net.sf.basedb.core.ItemQuery"
40  import="net.sf.basedb.core.DataQuery"
41  import="net.sf.basedb.core.DataResultIterator"
42  import="net.sf.basedb.core.ItemResultIterator"
43  import="net.sf.basedb.core.ItemResultList"
44  import="net.sf.basedb.core.Permission"
45  import="net.sf.basedb.core.PlateGeometry"
46  import="net.sf.basedb.core.PluginDefinition"
47  import="net.sf.basedb.core.ExtendedProperty"
48  import="net.sf.basedb.core.ExtendedProperties"
49  import="net.sf.basedb.core.PermissionDeniedException"
50  import="net.sf.basedb.core.data.RawData"
51  import="net.sf.basedb.core.data.ReporterData"
52  import="net.sf.basedb.core.data.FeatureData"
53  import="net.sf.basedb.core.query.Restrictions"
54  import="net.sf.basedb.core.query.Expressions"
55  import="net.sf.basedb.core.query.Orders"
56  import="net.sf.basedb.core.query.Hql"
57  import="net.sf.basedb.core.plugin.GuiContext"
58  import="net.sf.basedb.core.plugin.Plugin"
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.util.HTML"
63  import="net.sf.basedb.util.Values"
64  import="net.sf.basedb.util.Enumeration"
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.List"
75  import="java.util.Map"
76  import="java.util.Date"
77%>
78<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
79<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
80<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
81<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
82<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
83<%!
84  private static final Item itemType = Item.RAWDATA;
85%>
86<%
87final int rawBioAssayId = Values.getInt(request.getParameter("rawbioassay_id"));
88final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
89final String ID = sc.getId();
90
91final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
92final String callback = request.getParameter("callback");
93final String title = mode.generateTitle("raw data", "raw data");
94final DbControl dc = sc.newDbControl();
95DataResultIterator<RawData> rawData = null;
96try
97{
98  RawBioAssay rawBioAssay = RawBioAssay.getById(dc, rawBioAssayId);
99  RawDataType rawDataType = rawBioAssay.getRawDataType();
100  final String subContext = rawDataType.getId();
101  final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST, subContext);
102
103  final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, subContext, null, null);
104
105  final DataQuery<RawData> query = rawBioAssay.getRawData();
106  query.join(Hql.leftJoin(null, "reporter", "r", null, true));
107  query.join(Hql.leftJoin(null, "feature", "f", null, true));
108  cc.configureQuery(dc, query, true);
109  if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row")));
110  if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column")));
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 
118  WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true);
119  WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false);
120 
121  Enumeration<String, String> plateRows = new Enumeration<String, String>();
122  final ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery();
123  geometryQuery.order(Orders.desc(Hql.property("rows")));
124  ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc);
125  int maxRows = result.next().getRows();
126  for (int row = 0; row < maxRows && row < 256; row++)
127  {
128    plateRows.add(Integer.toString(row), rowFormatter.format(row));
129  }
130 
131  Enumeration<String, String> plateColumns = new Enumeration<String, String>();
132  final ItemQuery<PlateGeometry> columnsGeometryQuery = PlateGeometry.getQuery();
133  columnsGeometryQuery.order(Orders.desc(Hql.property("columns")));
134  ItemResultIterator<PlateGeometry> columnsResult = columnsGeometryQuery.iterate(dc);
135  int maxColumns = columnsResult.next().getColumns();
136  for (int column = 0; column < maxColumns && column < 256; column++)
137  {
138    plateColumns.add(Integer.toString(column), columnFormatter.format(column));
139  }
140 
141  try
142  {
143    rawData = query.iterate(dc);
144  }
145  catch (Throwable t)
146  {
147    cc.setMessage(t.getMessage());
148    t.printStackTrace();
149  }
150  int numListed = 0;
151  final boolean writeReporterPermission = sc.hasPermission(Permission.WRITE, Item.REPORTER);
152  Formatter<Date> dateFormatter = FormatterFactory.getDateTimeFormatter(sc);
153  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, rawBioAssay);
154  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
155  ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext);
156  %>
157  <base:page title="<%=title%>" id="list-page">
158  <base:head scripts="table.js,tabcontrol-2.js,~rawdata.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">
159    <ext:scripts context="<%=jspContext%>" />
160    <ext:stylesheets context="<%=jspContext%>" />
161  </base:head>
162 
163  <base:body>
164    <p:path><p:pathelement 
165      title="Raw bioassays" href="<%="../index.jsp?ID="+ID%>"
166      /><p:pathelement title="<%=HTML.encodeTags(rawBioAssay.getName())%>" 
167      /></p:path>
168     
169    <t:tabcontrol 
170      id="main" 
171      subclass="mastertabcontrol content"
172      active="rawdata">
173    <t:tab id="properties" title="Properties" />
174    <t:tab id="annotations" title="Annotations &amp; parameters" 
175      tooltip="View annotation values and protocol parameters" />
176   
177    <t:tab id="rawdata" title="Raw data">
178
179    <tbl:table 
180      id="rawdata"
181      columns="<%=cc.getSetting("columns")%>"
182      sortby="<%=cc.getSortProperty()%>" 
183      direction="<%=cc.getSortDirection()%>"
184      action="index.jsp"
185      sc="<%=sc%>"
186      item="<%=itemType%>"
187      subcontext="<%=subContext%>"
188      filterrows="<%=cc.getFilterRows()%>"
189      subclass="fulltable"
190      >
191      <tbl:hidden 
192        name="mode" 
193        value="<%=mode.getName()%>" 
194      />
195      <tbl:hidden 
196        name="rawbioassay_id" 
197        value="<%=String.valueOf(rawBioAssayId)%>" 
198      />
199      <tbl:hidden 
200        name="callback" 
201        value="<%=callback%>" 
202        skip="<%=callback == null%>" 
203      />
204      <tbl:columndef 
205        id="position"
206        clazz="uniquecol"
207        property="position"
208        datatype="int"
209        title="[Raw] Position"
210        sortable="true" 
211        filterable="true"
212        exportable="true"
213        show="always" 
214      />
215      <tbl:columndef 
216        id="id"
217        clazz="uniquecol"
218        property="id"
219        datatype="int"
220        title="ID"
221        sortable="true"
222        filterable="true"
223        exportable="true"
224      />
225      <tbl:columndef 
226        id="block"
227        property="block"
228        datatype="int"
229        title="[Raw] Block"
230        sortable="true" 
231        filterable="true"
232        exportable="true"
233      />
234      <tbl:columndef 
235        id="metaGridX"
236        property="metaGridX"
237        datatype="int"
238        title="[Raw] Meta grid X"
239        sortable="true" 
240        filterable="true"
241        exportable="true"
242      />
243      <tbl:columndef 
244        id="metaGridY"
245        property="metaGridY"
246        datatype="int"
247        title="[Raw] Meta grid Y"
248        sortable="true" 
249        filterable="true"
250        exportable="true"
251      />
252      <tbl:columndef 
253        id="row"
254        property="row"
255        datatype="int"
256        title="[Raw] Row"
257        sortable="true" 
258        filterable="true"
259        exportable="true"       
260      />
261      <tbl:columndef 
262        id="column"
263        property="column"
264        datatype="int"
265        title="[Raw] Column"
266        sortable="true" 
267        filterable="true"
268        exportable="true"
269      />
270      <tbl:columndef 
271        id="x"
272        property="x"
273        datatype="int"
274        title="[Raw] X"
275        sortable="true" 
276        filterable="true"
277        exportable="true"
278      />
279      <tbl:columndef 
280        id="y"
281        property="y"
282        datatype="int"
283        title="[Raw] Y"
284        sortable="true" 
285        filterable="true"
286        exportable="true"
287      />
288      <tbl:columndef 
289        id="spotImage"
290        title="Spot image"
291      />
292      <%
293      for (RawDataProperty rdp : rawBioAssay.getRawDataType().getProperties())
294      {
295        %>
296        <tbl:columndef
297          id="<%="raw."+rdp.getName()%>"
298          property="<%=rdp.getName()%>"
299          datatype="<%=rdp.getType().getStringValue()%>"
300          title="<%="[Raw] "+HTML.encodeTags(rdp.getTitle())%>"
301          sortable="true" 
302          filterable="true"
303          exportable="true"
304          formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, rdp)%>"
305        />
306        <%
307      }
308      %>
309      <tbl:columndef
310        id="reporterList"
311        property="$r.£reporterListScores"
312        datatype="int"
313        title="[Rep] Reporter list"
314        filterable="true"
315        enumeration="<%=Base.getReporterListsEnum(dc)%>"
316        multiple="false"
317      />     
318      <tbl:columndef 
319        id="reporter.name"
320        property="$r.name"
321        exportproperty="reporter.name"
322        datatype="string"
323        title="[Rep] Name"
324        sortable="true" 
325        filterable="true"
326        exportable="true"
327      />
328      <tbl:columndef 
329        id="reporter.externalId"
330        clazz="uniquecol"
331        property="$r.externalId"
332        exportproperty="reporter.externalId"
333        datatype="string"
334        title="[Rep] ID"
335        sortable="true" 
336        filterable="true"
337        exportable="true"
338      />
339      <tbl:columndef 
340        id="reporter.symbol"
341        property="$r.symbol"
342        exportproperty="reporter.symbol"
343        datatype="string"
344        title="[Rep] Gene symbol"
345        sortable="true" 
346        filterable="true"
347        exportable="true"
348      />
349      <tbl:columndef 
350        id="reporter.description"
351        property="$r.description"
352        exportproperty="reporter.description"
353        datatype="string"
354        title="[Rep] Description" 
355        sortable="true" 
356        filterable="true" 
357        exportable="true"
358      />
359      <tbl:columndef 
360        id="reporter.lastUpdate"
361        property="$r.lastUpdate"
362        exportproperty="reporter.lastUpdate"
363        datatype="timestamp"
364        title="[Rep] Last update" 
365        sortable="true" 
366        filterable="true" 
367        exportable="true"
368        formatter="<%=dateFormatter%>"
369      />
370      <%
371      Enumeration<String, String> types = new Enumeration<String, String>();
372      ItemResultList<ReporterType> reporterTypes = typeQuery.list(dc);
373      types.add("", "- none -");
374      for (ReporterType rt : reporterTypes)
375      {
376        types.add(Integer.toString(rt.getId()), HTML.encodeTags(rt.getName()));
377      }
378      %>
379      <tbl:columndef 
380        id="reporter.reporterType"
381        property="$r.reporterType"
382        sortproperty="$r.reporterType.name"
383        exportproperty="reporter.reporterType.name:string"
384        datatype="int"
385        enumeration="<%=types%>"
386        title="[Rep] Type"
387        sortable="true" 
388        filterable="true"
389        exportable="true"
390      />
391      <%
392      if (reporterProperties != null)
393      {
394        for (ExtendedProperty ep : reporterProperties)
395        {
396          String name = ep.getName();
397          %>
398          <tbl:columndef
399            id="<%="reporter."+name%>"
400            property="<%="$r."+name%>"
401            exportproperty="<%="reporter."+name%>"
402            datatype="<%=ep.getType().getStringValue()%>"
403            title="<%="[Rep] "+HTML.encodeTags(ep.getTitle())%>"
404            sortable="true"
405            filterable="true"
406            exportable="true"
407            formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, ep)%>"
408          />
409          <%
410        }
411      }
412      %>
413      <tbl:columndef 
414        id="feature.position"
415        clazz="uniquecol"
416        property="$f.position"
417        exportproperty="feature.position"
418        datatype="int"
419        title="[Feat] Position" 
420        sortable="true" 
421        filterable="true" 
422        exportable="true"
423      />
424      <tbl:columndef 
425        id="feature.externalId"
426        clazz="uniquecol"
427        property="$f.externalId"
428        exportproperty="feature.externalId"
429        datatype="string"
430        title="[Feat] Feature ID" 
431        sortable="true" 
432        filterable="true" 
433        exportable="true"
434      />
435      <tbl:columndef 
436        id="feature.block"
437        property="$f.arrayDesignBlock.blockNumber"
438        exportproperty="feature.arrayDesignBlock.blockNumber"
439        datatype="int"
440        title="[Feat] Block"
441        sortable="true" 
442        filterable="true"
443        exportable="true"
444      />
445      <tbl:columndef 
446        id="feature.metaGridX"
447        property="$f.arrayDesignBlock.metaGridX"
448        exportproperty="feature.arrayDesignBlock.metaGridx"
449        datatype="int"
450        title="[Feat] Meta grid X"
451        sortable="true" 
452        filterable="true"
453        exportable="true"
454      />
455      <tbl:columndef 
456        id="feature.metaGridY"
457        property="$f.arrayDesignBlock.metaGridY"
458        exportproperty="feature.arrayDesignBlock.metaGridY"
459        datatype="int"
460        title="[Feat] Meta grid Y"
461        sortable="true" 
462        filterable="true"
463        exportable="true"
464      />
465      <tbl:columndef 
466        id="feature.row"
467        property="$f.row"
468        exportproperty="feature.row"
469        datatype="int"
470        title="[Feat] Row"
471        sortable="true" 
472        filterable="true"
473        exportable="true"
474      />
475      <tbl:columndef 
476        id="feature.column"
477        property="$f.column"
478        exportproperty="feature.column"
479        datatype="int"
480        title="[Feat] Column"
481        sortable="true" 
482        filterable="true"
483        exportable="true"
484      />
485      <tbl:columndef 
486        id="feature.blockSizeX"
487        property="$f.arrayDesignBlock.blockSizeX"
488        exportproperty="feature.arrayDesignBlock.blockSizeX"
489        datatype="int"
490        title="[Feat] Block size X"
491        sortable="true" 
492        filterable="true"
493        exportable="true"
494      />
495      <tbl:columndef 
496        id="feature.blockSizeY"
497        property="$f.arrayDesignBlock.blockSizeY"
498        exportproperty="feature.arrayDesignBlock.blockSizeY"
499        datatype="int"
500        title="[Feat] Block size Y"
501        sortable="true" 
502        filterable="true"
503        exportable="true"
504      />
505      <tbl:columndef 
506        id="feature.originX"
507        property="$f.arrayDesignBlock.originX"
508        exportproperty="feature.arrayDesignBlock.originX"
509        datatype="int"
510        title="[Feat] Origin X"
511        sortable="true" 
512        filterable="true"
513        exportable="true"
514      />
515      <tbl:columndef 
516        id="feature.originY"
517        property="$f.arrayDesignBlock.originY"
518        exportproperty="feature.arrayDesignBlock.originY"
519        datatype="int"
520        title="[Feat] Origin Y"
521        sortable="true" 
522        filterable="true"
523        exportable="true"
524      />
525      <tbl:columndef 
526        id="feature.spacingX"
527        property="$f.arrayDesignBlock.spacingX"
528        exportproperty="feature.arrayDesignBlock.spacingX"
529        datatype="int"
530        title="[Feat] Spacing X"
531        sortable="true" 
532        filterable="true"
533        exportable="true"
534      />
535      <tbl:columndef 
536        id="feature.spacingY"
537        property="$f.arrayDesignBlock.spacingY"
538        exportproperty="feature.arrayDesignBlock.spacingY"
539        datatype="int"
540        title="[Feat] Spacing Y"
541        sortable="true" 
542        filterable="true"
543        exportable="true"
544      />
545      <tbl:columndef 
546        id="well.row"
547        property="$f.well.row"
548        exportproperty="feature.well.row"
549        datatype="int"
550        title="[Well] Row" 
551        sortable="true" 
552        filterable="true"
553        enumeration="<%=plateRows%>" 
554        exportable="true"
555        formatter="<%=rowFormatter%>"
556      />
557      <tbl:columndef 
558        id="well.column"
559        property="$f.well.column"
560        exportproperty="feature.well.column"
561        datatype="int"
562        title="[Well] Column" 
563        sortable="true" 
564        filterable="true" 
565        enumeration="<%=plateColumns%>" 
566        exportable="true"
567        formatter="<%=columnFormatter%>"
568      />
569      <tbl:columndef 
570        id="well.plate"
571        property="$f.well.plate.name"
572        exportproperty="feature.well.plate.name"
573        datatype="string"
574        title="[Well] Plate" 
575        sortable="true" 
576        filterable="true" 
577        exportable="true"
578      />
579      <tbl:columndef 
580        id="xt-columns" 
581        extensions="<%=columnsInvoker%>" 
582        jspcontext="<%=jspContext%>" 
583      />
584      <div class="panelgroup bg-filled-50 bottomborder">
585        <tbl:toolbar
586          subclass="bottomborder"
587          visible="<%=mode.hasToolbar()%>"
588          >
589          <tbl:button 
590            id="btnColumns"
591            image="columns.png" 
592            title="Columns&hellip;" 
593            tooltip="Show, hide and re-order columns" 
594          />
595          <tbl:button
596            id="btnNewReporterList"
597            image="add.png"
598            title="New reporter list&hellip;"
599            tooltip="Create a new reporter list from matching spots"
600            visible="<%=sc.hasPermission(Permission.CREATE, Item.REPORTERLIST)%>"
601          />
602          <tbl:button 
603            id="btnImport"
604            data-plugin-type="IMPORT"
605            image="import.png" 
606            title="Import&hellip;" 
607            tooltip="Import data" 
608            visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
609          />
610          <tbl:button 
611            id="btnExport"
612            data-plugin-type="EXPORT"
613            image="export.png" 
614            title="Export&hellip;" 
615            tooltip="Export data" 
616            visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
617          />
618          <tbl:button 
619            id="btnRunPlugin"
620            data-plugin-type="OTHER"
621            image="runplugin.png" 
622            title="Run plugin&hellip;" 
623            tooltip="Run a plugin" 
624            visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
625          />
626          <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
627            wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
628        </tbl:toolbar>
629        <tbl:panel>
630          <tbl:presetselector />
631          <tbl:navigator
632            page="<%=cc.getPage()%>" 
633            rowsperpage="<%=cc.getRowsPerPage()%>" 
634            totalrows="<%=rawData == null ? 0 : rawData.getTotalCount()%>" 
635            visible="<%=mode.hasNavigator()%>"
636          />
637        </tbl:panel>
638      </div>
639      <tbl:data>
640        <tbl:headers>
641          <tbl:headerrow>
642            <tbl:header colspan="3" />
643            <tbl:columnheaders />
644          </tbl:headerrow>
645          <%
646          int numFilters = cc.getNumPropertyFilters();
647          int numRows = cc.getFilterRows();
648          for (int filterNo = 0; filterNo < numRows; filterNo++)
649          {
650            boolean lastRow = filterNo == numRows-1;
651            %>
652            <tbl:headerrow>
653              <tbl:header subclass="index" />
654              <tbl:header 
655                subclass="check" 
656                visible="<%=mode.hasCheck()%>"
657                ><base:icon 
658                  id="check.uncheck"
659                  image="check_uncheck.png" 
660                  tooltip="Check/uncheck all" 
661                  visible="<%=lastRow%>"
662                /></tbl:header>
663              <tbl:header 
664                subclass="check" 
665                visible="<%=mode.hasRadio()%>"
666                />
667              <tbl:header 
668                subclass="icons" 
669                visible="<%=mode.hasIcons()%>"
670                >
671                <base:icon
672                  subclass="link table-filter-row-action"
673                  image="add.png"
674                  tooltip="Add extra filter row"
675                  visible="<%=lastRow%>"
676                /><base:icon
677                  subclass="link table-filter-row-action"
678                  image="remove.png"
679                  tooltip="Remove this filter row"
680                  visible="<%=numRows > 1 || numFilters > 0 %>"
681                  data-remove-row="<%=filterNo%>"
682                />
683              </tbl:header>
684              <tbl:propertyfilter row="<%=filterNo%>" />
685            </tbl:headerrow>
686            <%
687          }
688          %>
689        </tbl:headers>
690        <tbl:rows>
691          <%
692          if (cc.getMessage() != null)
693          {
694            %>
695            <tbl:panel subclass="bg-filled-50">
696              <div class="messagecontainer error"><%=cc.getMessage()%></div>
697            </tbl:panel>
698            <%
699            cc.setMessage(null);
700          }
701          int index = cc.getPage()*cc.getRowsPerPage();
702          int selectedItemId = cc.getId();
703          boolean hasSpotImages = rawBioAssay.hasSpotImages();
704          if (rawData != null)
705          {
706            String tooltip = mode.isSelectionMode() ?
707              "Select this item" : "View this item";
708            while (rawData.hasNext())
709            {
710              RawData item = rawData.next();
711              int itemId = item.getId();
712              index++;
713              numListed++;
714              %>
715              <tbl:row>
716                <tbl:header 
717                  clazz="index"
718                  ><%=index%></tbl:header>
719                <tbl:header 
720                  clazz="check" 
721                  visible="<%=mode.hasCheck()%>"
722                  ><input 
723                      type="checkbox" 
724                      name="<%=itemId%>" 
725                      value="<%=itemId%>" 
726                      title="TODO" 
727                      <%=request.getParameter(Integer.toString(itemId)) == null ? "" : "checked"%> 
728                    ></tbl:header>
729                <tbl:header 
730                  clazz="check" 
731                  visible="<%=mode.hasRadio()%>"
732                  ><input 
733                      type="radio" 
734                      name="item_id" 
735                      value="<%=itemId%>" 
736                      title="TODO" 
737                      <%=selectedItemId == itemId ? "checked" : ""%>
738                    ></tbl:header>
739                <tbl:header 
740                  clazz="icons" 
741                  visible="<%=mode.hasIcons()%>"
742                  ></tbl:header>
743                <tbl:cell column="position"><div
744                  class="link table-item"
745                  data-item-id="<%=itemId%>"
746                  data-extra-url="<%="&rawbioassay_id="+rawBioAssayId%>"
747                  tabindex="0"
748                  title="<%=tooltip%>"><%=item.getPosition()%></div></tbl:cell>
749                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
750                <tbl:cell column="block"><%=item.getBlock()%></tbl:cell>
751                <tbl:cell column="row"><tbl:cellvalue value="<%=item.getRow()%>"/></tbl:cell>
752                <tbl:cell column="column"><tbl:cellvalue value="<%=item.getColumn()%>"/></tbl:cell>
753                <tbl:cell column="metaGridX"><%=item.getMetaGridX()%></tbl:cell>
754                <tbl:cell column="metaGridY"><%=item.getMetaGridY()%></tbl:cell>
755                <tbl:cell column="x"><%=item.getX()%></tbl:cell>
756                <tbl:cell column="y"><%=item.getY()%></tbl:cell>
757                <tbl:cell column="spotImage">
758                  <%
759                  if (hasSpotImages)
760                  {
761                    %>
762                    <img class="spotimage" src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=item.getPosition()%>.png">
763                    <%
764                  }
765                  %>
766                </tbl:cell>
767                <%
768                for (RawDataProperty rdp : rawBioAssay.getRawDataType().getProperties())
769                {
770                  %>
771                  <tbl:cell column="<%="raw."+rdp.getName()%>"><tbl:cellvalue value="<%=item.getExtended(rdp.getName())%>" /></tbl:cell>
772                  <%
773                }
774                %>
775                <%
776                ReporterData reporter = item.getReporter();
777                if (reporter == null)
778                {
779                  %>
780                  <tbl:cell column="reporter.name"><i>- none -</i></tbl:cell>
781                  <tbl:cell column="reporter.externalId"><i>- none -</i></tbl:cell>
782                  <%
783                }
784                else
785                {
786                  %>
787                  <tbl:cell column="reporter.name"><%=Base.getLink(ID, reporter.getName(), Item.REPORTER, reporter.getId(), writeReporterPermission)%></tbl:cell>
788                  <tbl:cell column="reporter.externalId"><%=HTML.encodeTags(reporter.getExternalId())%></tbl:cell>
789                  <tbl:cell column="reporter.symbol"><%=HTML.encodeTags(reporter.getSymbol())%></tbl:cell>
790                  <tbl:cell column="reporter.description"><%=HTML.encodeTags(reporter.getDescription())%></tbl:cell>
791                  <tbl:cell column="reporter.lastUpdate" value="<%=reporter.getLastUpdate()%>" />
792                  <tbl:cell column="reporter.reporterType"><base:propertyvalue dbcontrol="<%=dc%>" item="<%=reporter%>" property="reporterType.name" /></tbl:cell>
793                  <%
794                  if (reporterProperties != null)
795                  {
796                    for (ExtendedProperty ep : reporterProperties)
797                    {
798                      String name = ep.getName();
799                      %>
800                      <tbl:cell column="<%="reporter."+name%>"><tbl:cellvalue value="<%=reporter.getExtended(name)%>" /></tbl:cell>
801                      <%
802                    }
803                  }
804                }
805                %>
806                <%
807                FeatureData feature = item.getFeature();
808                if (feature == null)
809                {
810                  %>
811                  <tbl:cell column="feature.position"><i>- none -</i></tbl:cell>
812                  <tbl:cell column="feature.externalId"><i>- none -</i></tbl:cell>
813                  <tbl:cell column="feature.row"><i>- none -</i></tbl:cell>
814                  <tbl:cell column="feature.column"><i>- none -</i></tbl:cell>
815                  <tbl:cell column="feature.block"><i>- none -</i></tbl:cell>
816                  <tbl:cell column="feature.metaGridX"><i>- none -</i></tbl:cell>
817                  <tbl:cell column="feature.metaGridY"><i>- none -</i></tbl:cell>
818                  <tbl:cell column="feature.blockSizeX"><i>- none -</i></tbl:cell>
819                  <tbl:cell column="feature.blockSizeY"><i>- none -</i></tbl:cell>
820                  <tbl:cell column="feature.originX"><i>- none -</i></tbl:cell>
821                  <tbl:cell column="feature.originY"><i>- none -</i></tbl:cell>
822                  <tbl:cell column="feature.spacingX"><i>- none -</i></tbl:cell>
823                  <tbl:cell column="feature.spacingY"><i>- none -</i></tbl:cell>
824                  <%
825                }
826                else
827                {
828                  %>
829                  <tbl:cell column="feature.position"><%=feature.getPosition()%></tbl:cell>
830                  <tbl:cell column="feature.externalId"><%=HTML.encodeTags(feature.getExternalId())%></tbl:cell>
831                  <tbl:cell column="feature.row"><%=feature.getRow()%></tbl:cell>
832                  <tbl:cell column="feature.column"><%=feature.getColumn()%></tbl:cell>
833                  <%
834                  ArrayDesignBlock block = null;
835                  try
836                  {
837                    block = Feature.getArrayDesignBlock(dc, feature);
838                  }
839                  catch (PermissionDeniedException ex)
840                  {}
841                  if (block == null)
842                  {
843                    %>
844                    <tbl:cell column="feature.block"><i>- denied -</i></tbl:cell>
845                    <tbl:cell column="feature.metaGridX"><i>- denied -</i></tbl:cell>
846                    <tbl:cell column="feature.metaGridY"><i>- denied -</i></tbl:cell>
847                    <tbl:cell column="feature.blockSizeX"><i>- denied -</i></tbl:cell>
848                    <tbl:cell column="feature.blockSizeY"><i>- denied -</i></tbl:cell>
849                    <tbl:cell column="feature.originX"><i>- denied -</i></tbl:cell>
850                    <tbl:cell column="feature.originY"><i>- denied -</i></tbl:cell>
851                    <tbl:cell column="feature.spacingX"><i>- denied -</i></tbl:cell>
852                    <tbl:cell column="feature.spacingY"><i>- denied -</i></tbl:cell>
853                    <%
854                  }
855                  else
856                  {
857                    %>
858                    <tbl:cell column="feature.block"><%=block.getBlockNumber()%></tbl:cell>
859                    <tbl:cell column="feature.metaGridX"><%=block.getMetaGridX()%></tbl:cell>
860                    <tbl:cell column="feature.metaGridY"><%=block.getMetaGridY()%></tbl:cell>
861                    <tbl:cell column="feature.blockSizeX"><%=block.getBlockSizeX()%></tbl:cell>
862                    <tbl:cell column="feature.blockSizeY"><%=block.getBlockSizeY()%></tbl:cell>
863                    <tbl:cell column="feature.originX"><%=block.getOriginX()%></tbl:cell>
864                    <tbl:cell column="feature.originY"><%=block.getOriginY()%></tbl:cell>
865                    <tbl:cell column="feature.spacingX"><%=block.getSpacingX()%></tbl:cell>
866                    <tbl:cell column="feature.spacingY"><%=block.getSpacingY()%></tbl:cell>
867                    <%
868                  }
869                  Well well = null;
870                  boolean readWell = true;
871                  try
872                  {
873                    well = Feature.getWell(dc, feature);
874                  }
875                  catch (PermissionDeniedException ex)
876                  {
877                    readWell = false;
878                  }
879                  if (!readWell)
880                  {
881                    %>
882                    <tbl:cell column="well.row"><i>- denied -</i></tbl:cell>
883                    <tbl:cell column="well.column"><i>- denied -</i></tbl:cell>
884                    <tbl:cell column="well.plate"><i>- denied -</i></tbl:cell>
885                    <%
886                  }
887                  else if (well == null)
888                  {
889                    %>
890                    <tbl:cell column="well.row"><i>- none -</i></tbl:cell>
891                    <tbl:cell column="well.column"><i>- none -</i></tbl:cell>
892                    <tbl:cell column="well.plate"><i>- none -</i></tbl:cell>
893                    <%
894                  }
895                  else
896                  {
897                    %>
898                    <tbl:cell column="well.row"><tbl:cellvalue value="<%=well.getRow()%>"/></tbl:cell>
899                    <tbl:cell column="well.column"><tbl:cellvalue value="<%=well.getColumn()%>"/></tbl:cell>
900                    <tbl:cell column="well.plate"><%=well.getPlate().getName()%></tbl:cell>
901                    <%
902                  }
903                }
904                %>
905                <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
906                  <tbl:cell column="xt-columns" />
907                </tbl:xt-cells>
908              </tbl:row>
909              <%
910            }
911          }
912          if (numListed == 0)
913          {
914            %>
915            <tbl:panel subclass="bg-filled-50">
916              <div class="messagecontainer note">
917              <%=rawData == null || rawData.getTotalCount() == 0 ? "No raw data were found" : "No raw data on this page. Please select another page!" %>
918              </div>
919            </tbl:panel>
920            <%
921          }
922          %>
923          </tbl:rows>
924        </tbl:data>
925    </tbl:table>
926    </t:tab>
927    <t:tab id="overview" title="Overview" 
928      tooltip="Display a tree overview of related items" />
929    <t:tab id="history" title="Change history" 
930        tooltip="Displays a log of all modifications made to this item"
931        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" />
932    </t:tabcontrol>
933
934    <base:buttongroup>
935      <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
936      <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
937      <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
938    </base:buttongroup>
939
940  </base:body>
941  </base:page>
942  <%
943}
944finally
945{
946  if (rawData != null) rawData.close();
947  if (dc != null) dc.close();
948}
949%>
Note: See TracBrowser for help on using the repository browser.