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

Last change on this file since 5425 was 5425, checked in by Nicklas Nordborg, 13 years ago

References #1514: Fix character encoding of jsp files

I hope this fixes most of the issues, including the reporter list filtering in many places. Let's keep an eye open for more issues until it is time to release 2.16

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