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

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

References #1512: Add support for datetime annotation types

Makes it possible to use TIMESTAMP for regular list columns. Added support for searching on the date part to the query api.

Changes all existing tables with date+time data to use TIMESTAMP instead.

This is half of 4) in the ticket description. It is still not possible to search on TIMESTAMP annotations.

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