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

Last change on this file since 4305 was 4305, checked in by Nicklas Nordborg, 15 years ago

References #1015: Add reporter list from tables that list reporters/reporter info

It is now possible to create reporter lists from features, wells and raw data, eg. all DataQuery?-based item types. Creating the lists using queries from the dynamic database needs a different solution.

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