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

Last change on this file since 5026 was 5026, checked in by Nicklas Nordborg, 14 years ago

References #1350: Update to Hibernate 3.3.2

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