source: trunk/www/lims/plates/wells/list_wells.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: 20.8 KB
Line 
1<%-- $Id: list_wells.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.AnnotationType"
32  import="net.sf.basedb.core.AnnotationSet"
33  import="net.sf.basedb.core.Annotation"
34  import="net.sf.basedb.core.Plate"
35  import="net.sf.basedb.core.Well"
36  import="net.sf.basedb.core.ReporterType"
37  import="net.sf.basedb.core.Reporter"
38  import="net.sf.basedb.core.ItemQuery"
39  import="net.sf.basedb.core.ItemResultIterator"
40  import="net.sf.basedb.core.ItemResultList"
41  import="net.sf.basedb.core.Permission"
42  import="net.sf.basedb.core.PluginDefinition"
43  import="net.sf.basedb.core.ExtendedProperty"
44  import="net.sf.basedb.core.ExtendedProperties"
45  import="net.sf.basedb.core.PermissionDeniedException"
46  import="net.sf.basedb.core.query.Restrictions"
47  import="net.sf.basedb.core.query.Expressions"
48  import="net.sf.basedb.core.query.Orders"
49  import="net.sf.basedb.core.query.Hql"
50  import="net.sf.basedb.core.plugin.GuiContext"
51  import="net.sf.basedb.core.plugin.Plugin"
52  import="net.sf.basedb.core.data.ReporterData"
53  import="net.sf.basedb.util.Enumeration"
54  import="net.sf.basedb.clients.web.Base"
55  import="net.sf.basedb.clients.web.ModeInfo"
56  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
57  import="net.sf.basedb.clients.web.PermissionUtil"
58  import="net.sf.basedb.clients.web.util.HTML"
59  import="net.sf.basedb.util.Values"
60  import="net.sf.basedb.util.formatter.Formatter"
61  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
62  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
63  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
64  import="net.sf.basedb.clients.web.extensions.JspContext"
65  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
66  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
67  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
68  import="java.util.ArrayList"
69  import="java.util.List"
70  import="java.util.Map"
71  import="java.util.Date"
72%>
73<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
74<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
75<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
76<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
77<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
78<%!
79  private static final Item itemType = Item.WELL;
80  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
81%>
82<%
83final int plateId = Values.getInt(request.getParameter("plate_id"));
84final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
85final String ID = sc.getId();
86final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
87
88final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
89final String callback = request.getParameter("callback");
90final String title = mode.generateTitle("well", "wells");
91final DbControl dc = sc.newDbControl();
92ItemResultIterator<Well> wells = null;
93ItemResultList<AnnotationType> annotationTypes = null;
94try
95{
96  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
97  annotationTypes = annotationTypeQuery.list(dc);
98  final Plate plate = Plate.getById(dc, plateId);
99  final boolean createPermission = plate.hasPermission(Permission.WRITE);
100  final boolean deletePermission = createPermission;
101
102  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
103  final ItemQuery<ReporterType> typeQuery = ReporterType.getQuery();
104  typeQuery.order(Orders.asc(Hql.property("name")));
105  typeQuery.setCacheResult(true);
106  List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData");
107  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
108  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
109 
110  Enumeration<String,String> rows = new Enumeration<String, String>();
111  WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true);
112  for (int i=0; i<plate.getPlateType().getPlateGeometry().getRows(); i++)
113  {
114    rows.add(Integer.toString(i), rowFormatter.format(i));
115  }
116 
117  try
118  {
119    final ItemQuery<Well> query = Base.getConfiguredQuery(dc, cc, true, plate.getWells(), mode);
120    query.join(Hql.leftJoin(null, "reporter", "rpt", null, true));
121    if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row")));
122    if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column")));
123    wells = query.iterate(dc);
124  }
125  catch (Throwable t)
126  {
127    cc.setMessage(t.getMessage());
128    t.printStackTrace();
129  }
130  int numListed = 0;
131  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, plate);
132  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
133  %>
134  <base:page title="<%=title%>" type="<%=mode.getPageType()%>">
135  <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css">
136    <ext:scripts context="<%=jspContext%>" />
137    <ext:stylesheets context="<%=jspContext%>" />
138    <script language="JavaScript">
139    var submitPage = 'index.jsp';
140    var formId = 'wells';
141    function editItem(itemId)
142    {
143      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);
144    }
145    function viewItem(itemId)
146    {
147      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);
148    }
149    function itemOnClick(evt, itemId)
150    {
151      Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);
152    }
153    function configureColumns()
154    {
155      Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
156    }
157    function runPlugin(cmd)
158    {
159      Table.submitToPopup(formId, cmd, 540, 460);
160    }
161    function returnSelected()
162    {
163      Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);
164      window.close();
165    }
166    function presetOnChange()
167    {
168      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
169    }
170    function switchTab(tabControlId, tabId)
171    {
172      if (tabId == 'properties' || tabId == 'annotations' || tabId == 'history')
173      {
174        location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=plateId%>&tab='+tabId;
175      }
176      else if (tabId == 'events')
177      {
178        location.href = '../events/index.jsp?ID=<%=ID%>&plate_id=<%=plateId%>';
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="Plates" href="<%="../index.jsp?ID="+ID%>" />
196      <p:pathelement title="<%=HTML.encodeTags(plate.getName())%>" />
197    </p:path>
198
199    <t:tabcontrol id="main" active="wells" switch="switchTab">
200    <t:tab id="properties" title="Properties" />
201    <t:tab id="annotations" title="Annotations" />
202    <t:tab id="events" title="Events" />
203   
204    <t:tab id="wells" title="Wells">
205   
206    <%
207    if (cc.getMessage() != null)
208    {
209      %>
210      <div class="error"><%=cc.getMessage()%></div>
211      <%
212      cc.setMessage(null);
213    }
214    %>
215    <tbl:table 
216      id="wells" 
217      clazz="itemlist" 
218      columns="<%=cc.getSetting("columns")%>"
219      sortby="<%=cc.getSortProperty()%>" 
220      direction="<%=cc.getSortDirection()%>"
221      title="<%=title%>"
222      action="index.jsp"
223      sc="<%=sc%>"
224      item="<%=itemType%>"
225      >
226      <tbl:hidden 
227        name="mode" 
228        value="<%=mode.getName()%>" 
229      />
230      <tbl:hidden 
231        name="plate_id" 
232        value="<%=String.valueOf(plateId)%>" 
233      />
234      <tbl:hidden 
235        name="callback" 
236        value="<%=callback%>" 
237        skip="<%=callback == null%>" 
238      />
239      <tbl:columndef 
240        id="row"
241        property="row"
242        datatype="int"
243        title="Row"
244        sortable="true" 
245        filterable="true"
246        exportable="true"
247        enumeration="<%=rows%>"
248        show="always"
249        formatter="<%=new WellCoordinateFormatter(true)%>" 
250      />
251      <tbl:columndef 
252        id="column"
253        property="column"
254        datatype="int"
255        title="Column"
256        sortable="true" 
257        filterable="true"
258        exportable="true"
259        show="always" 
260        formatter="<%=new WellCoordinateFormatter(false)%>" 
261      />
262      <tbl:columndef 
263        id="id"
264        clazz="uniquecol"
265        property="id"
266        datatype="int"
267        title="ID"
268        sortable="true"
269        filterable="true"
270        exportable="true"
271      />
272      <tbl:columndef 
273        id="parent"
274        title="Parent"
275      />
276      <tbl:columndef
277        id="reporterList"
278        property="$rpt.�reporterListScores"
279        datatype="int"
280        title="[Rep] Reporter list"
281        filterable="true"
282        enumeration="<%=Base.getReporterListsEnum(dc)%>"
283        multiple="false"
284      />
285      <tbl:columndef 
286        id="reporter.name"
287        property="reporter.name"
288        datatype="string"
289        title="[Rep] Name"
290        sortable="true" 
291        filterable="true"
292        exportable="true"
293      />
294      <tbl:columndef 
295        id="reporter.externalId"
296        clazz="uniquecol"
297        property="reporter.externalId"
298        datatype="string"
299        title="[Rep] ID"
300        sortable="true" 
301        filterable="true"
302        exportable="true"
303      />
304      <tbl:columndef 
305        id="reporter.symbol"
306        property="reporter.symbol"
307        datatype="string"
308        title="[Rep] Gene symbol"
309        sortable="true" 
310        filterable="true"
311        exportable="true"
312      />
313      <tbl:columndef 
314        id="reporter.description"
315        property="reporter.description"
316        datatype="string"
317        title="[Rep] Description" 
318        sortable="true" 
319        filterable="true" 
320        exportable="true"
321      />
322      <tbl:columndef 
323        id="reporter.entryDate"
324        property="reporter.entryDate"
325        datatype="date"
326        title="[Rep] Registered"
327        sortable="true" 
328        filterable="true"
329        exportable="true"
330        formatter="<%=dateFormatter%>"
331      />
332      <tbl:columndef 
333        id="reporter.lastUpdate"
334        property="reporter.lastUpdate"
335        datatype="timestamp"
336        title="[Rep] Last update" 
337        sortable="true" 
338        filterable="true" 
339        exportable="true"
340        formatter="<%=dateTimeFormatter%>"
341      />
342      <%
343      Enumeration<String, String> types = new Enumeration<String, String>();
344      ItemResultList<ReporterType> reporterTypes = typeQuery.list(dc);
345      types.add("", "- none -");
346      for (ReporterType rt : reporterTypes)
347      {
348        types.add(Integer.toString(rt.getId()), HTML.encodeTags(rt.getName()));
349      }
350      %>
351      <tbl:columndef 
352        id="reporter.reporterType"
353        property="reporter.reporterType"
354        sortproperty="reporter.reporterType.name"
355        exportproperty="reporter.reporterType.name"
356        datatype="int"
357        enumeration="<%=types%>"
358        title="[Rep] Type"
359        sortable="true" 
360        filterable="true"
361        exportable="true"
362      />
363      <%
364      if (reporterProperties != null)
365      {
366        for (ExtendedProperty ep : reporterProperties)
367        {
368          String name = ep.getName();
369          %>
370          <tbl:columndef
371            id="<%="reporter."+name%>"
372            property="<%="reporter."+name%>"
373            datatype="<%=ep.getType().getStringValue()%>"
374            title="<%="[Rep] "+HTML.encodeTags(ep.getTitle())%>"
375            sortable="true"
376            filterable="true"
377            exportable="true"
378            formatter="<%=FormatterFactory.getExtendedPropertyFormatter(sc, ep)%>"
379          />
380          <%
381        }
382      }
383      %>
384      <%
385      for (AnnotationType at : annotationTypes)
386      {
387        Enumeration<String, String> annotationEnum = null;
388        Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
389        if (at.isEnumeration())
390        {
391          annotationEnum = new Enumeration<String, String>();
392          List<?> values = at.getValues();
393          for (Object value : values)
394          {
395            String encoded = formatter.format(value);
396            annotationEnum.add(encoded, encoded);
397          }
398        }
399        %>
400        <tbl:columndef 
401          id="<%="at"+at.getId()%>"
402          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
403          property="<%="#"+at.getId()%>"
404          annotation="true"
405          datatype="<%=at.getValueType().getStringValue()%>"
406          enumeration="<%=annotationEnum%>"
407          sortable="false" 
408          filterable="true" 
409          exportable="true"
410          formatter="<%=formatter%>"
411          unit="<%=at.getDefaultUnit()%>"
412        />
413        <%
414      }
415      %>
416      <tbl:columndef
417        id="permission"
418        title="Permission"
419      />
420      <tbl:toolbar
421        visible="<%=mode.hasToolbar()%>"
422        >
423        <tbl:button 
424          image="columns.gif" 
425          onclick="configureColumns()" 
426          title="Columns&hellip;" 
427          tooltip="Show, hide and re-order columns" 
428        />
429        <tbl:button
430          image="add.png"
431          onclick="newReporterList()"
432          title="New reporter list&hellip;"
433          tooltip="Create a new reporter list from matching wells"
434          visible="<%=sc.hasPermission(Permission.CREATE, Item.REPORTERLIST)%>"
435        />
436        <tbl:button 
437          image="import.gif" 
438          onclick="runPlugin('ImportItems')" 
439          title="Import&hellip;" 
440          tooltip="Import data" 
441          visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
442        />
443        <tbl:button 
444          image="export.gif" 
445          onclick="runPlugin('ExportItems')" 
446          title="Export&hellip;" 
447          tooltip="Export data" 
448          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
449        />
450        <tbl:button 
451          image="runplugin.gif" 
452          onclick="runPlugin('RunListPlugin')" 
453          title="Run plugin&hellip;" 
454          tooltip="Run a plugin" 
455          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
456        />
457        <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
458          wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
459      </tbl:toolbar>
460      <tbl:navigator
461        page="<%=cc.getPage()%>" 
462        rowsperpage="<%=cc.getRowsPerPage()%>" 
463        totalrows="<%=wells == null ? 0 : wells.getTotalCount()%>" 
464        visible="<%=mode.hasNavigator()%>"
465      />
466      <tbl:data>
467        <tbl:columns>
468        <tbl:presetselector 
469          clazz="columnheader"
470          colspan="3"
471          onchange="presetOnChange()"
472        />
473        </tbl:columns>
474         
475        <tr>
476          <tbl:header 
477            clazz="index"
478            >&nbsp;</tbl:header>
479          <tbl:header 
480            clazz="check" 
481            visible="<%=mode.hasCheck()%>"
482            ><base:icon 
483              image="check_uncheck.gif" 
484              tooltip="Check/uncheck all" 
485              onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;"
486            /></tbl:header>
487          <tbl:header 
488            clazz="check" 
489            visible="<%=mode.hasRadio()%>"
490            />
491          <tbl:header 
492            clazz="icons" 
493            visible="<%=mode.hasIcons()%>"
494            >&nbsp;</tbl:header>
495          <tbl:propertyfilter />
496        </tr>
497   
498          <tbl:rows>
499          <%
500          int index = cc.getPage()*cc.getRowsPerPage();
501          int selectedItemId = cc.getId();
502          if (wells != null)
503          {           
504            while (wells.hasNext())
505            {
506              Well item = wells.next();
507              int itemId = item.getId();
508              boolean writePermission = item.hasPermission(Permission.WRITE);
509              String tooltip = mode.isSelectionMode() ? 
510                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 
511              index++;
512              numListed++;
513              %>
514              <tbl:row>
515                <tbl:header 
516                  clazz="index"
517                  ><%=index%></tbl:header>
518                <tbl:header 
519                  clazz="check" 
520                  visible="<%=mode.hasCheck()%>"
521                  ><input 
522                      type="checkbox" 
523                      name="<%=itemId%>" 
524                      value="<%=itemId%>" 
525                      title="TODO" 
526                      <%=cc.getSelected().contains(itemId) ? "checked" : ""%>
527                    ></tbl:header>
528                <tbl:header 
529                  clazz="check" 
530                  visible="<%=mode.hasRadio()%>"
531                  ><input 
532                      type="radio" 
533                      name="item_id" 
534                      value="<%=itemId%>" 
535                      title="TODO" 
536                      <%=selectedItemId == itemId ? "checked" : ""%>
537                    ></tbl:header>
538                <tbl:header 
539                  clazz="icons" 
540                  visible="<%=mode.hasIcons()%>"
541                  >&nbsp;</tbl:header>
542                <tbl:cell column="row"><div class="link" 
543                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 
544                  title="<%=tooltip%>"><tbl:cellvalue value="<%=item.getRow()%>" /></div></tbl:cell>
545                <tbl:cell column="column"><tbl:cellvalue value="<%=item.getColumn()%>"/></tbl:cell>
546                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
547                <tbl:cell column="parent">
548                  <%
549                  try
550                  {
551                    Well parent = item.getParent();
552                    if (parent == null)
553                    {
554                      %>
555                      <i>- none -</i>
556                      <%
557                    }
558                    else
559                    {
560                      %>
561                      <%=Base.getLink(ID, 
562                        parent.getPlate().getName() + " [" + parent.getRow() + ", " + parent.getColumn() + "]", 
563                        Item.WELL, parent.getId(), true)%>
564                      <%
565                    }
566                  }
567                  catch (PermissionDeniedException ex)
568                  {
569                    %>
570                    <i>- denied -</i>
571                    <%
572                  }
573                  %>
574                </tbl:cell>
575                <%
576                ReporterData reporter = item.getReporter();
577                if (reporter == null)
578                {
579                  %>
580                  <tbl:cell column="reporter.name"><i>- none -</i></tbl:cell>
581                  <tbl:cell column="reporter.externalId"><i>- none -</i></tbl:cell>
582                  <%
583                }
584                else
585                {
586                  %>
587                  <tbl:cell column="reporter.name"><%=Base.getLink(ID, reporter.getName(), Item.REPORTER, reporter.getId(), true)%></tbl:cell>
588                  <tbl:cell column="reporter.externalId"><%=HTML.encodeTags(reporter.getExternalId())%></tbl:cell>
589                  <tbl:cell column="reporter.symbol"><%=HTML.encodeTags(reporter.getSymbol())%></tbl:cell>
590                  <tbl:cell column="reporter.description"><%=HTML.encodeTags(reporter.getDescription())%></tbl:cell>
591                  <tbl:cell column="reporter.entryDate" value="<%=reporter.getEntryDate()%>" />
592                  <tbl:cell column="reporter.lastUpdate" value="<%=reporter.getLastUpdate()%>" />
593                  <tbl:cell column="reporter.reporterType"
594                    ><base:propertyvalue 
595                      dbcontrol="<%=dc%>" 
596                      item="<%=reporter%>" 
597                      property="reporterType"
598                      enableEditLink="<%=mode.hasEditLink()%>" 
599                      enablePropertyLink="<%=mode.hasPropertyLink()%>"
600                    /></tbl:cell>
601                  <%
602                  if (reporterProperties != null)
603                  {
604                    for (ExtendedProperty ep : reporterProperties)
605                    {
606                      String name = ep.getName();
607                      %>
608                      <tbl:cell column="<%="reporter."+name%>"><tbl:cellvalue value="<%=reporter.getExtended(name)%>" /></tbl:cell>
609                      <%
610                    }
611                  }
612                }
613                AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;
614                if (as != null)
615                {
616                  for (AnnotationType at : annotationTypes)
617                  {
618                    if (as.hasAnnotation(at))
619                    {
620                      Annotation a = as.getAnnotation(at);
621                      String suffix = a.getUnitSymbol(null);
622                      if (suffix != null) suffix = "&nbsp;" + suffix;
623                      %>
624                      <tbl:cell 
625                        column="<%="at"+at.getId()%>"
626                        ><tbl:cellvalue 
627                          list="<%=a.getValues(null)%>"
628                          suffix="<%=suffix%>"
629                      /></tbl:cell>
630                      <%
631                    }
632                  }
633                }
634                %>
635                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
636              </tbl:row>
637              <%
638            }
639          }
640          %>
641          </tbl:rows>
642        </tbl:data>
643      <%
644      if (numListed == 0)
645      {
646        %>
647        <tbl:panel><%=wells == null || wells.getTotalCount() == 0 ? "No wells were found" : "No wells on this page. Please select another page!" %></tbl:panel>
648        <%
649      }
650      else
651      {
652        %>
653        <tbl:navigator
654          page="<%=cc.getPage()%>" 
655          rowsperpage="<%=cc.getRowsPerPage()%>" 
656          totalrows="<%=wells == null ? 0 : wells.getTotalCount()%>" 
657          visible="<%=mode.hasNavigator()%>"
658          locked="true"
659        />
660        <%
661      }
662      %>
663    </tbl:table>
664    <base:buttongroup align="center">
665      <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />
666      <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
667      <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />
668    </base:buttongroup>
669 
670    </t:tab>
671    <t:tab id="history" title="Change history" 
672        tooltip="Displays a log of all modifications made to this item"
673        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" />
674    </t:tabcontrol>
675
676 
677  </base:body>
678  </base:page>
679  <%
680}
681finally
682{
683  if (wells != null) wells.close();
684  if (dc != null) dc.close();
685}
686%>
Note: See TracBrowser for help on using the repository browser.