source: trunk/www/lims/arraydesigns/features/list_features.jsp @ 4889

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

References #1290: Change source files to UTF-8

Changed 'Hakkinen' to 'Häkkinen'.

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