source: trunk/www/biomaterials/biosources/list_biosources.jsp @ 7605

Last change on this file since 7605 was 7605, checked in by Nicklas Nordborg, 4 years ago

References #2151: Pre-compile all JSP pages before releases

Getting rid of a lot of unchecked warnings. Most of them are solved by changed the API in several BASE core clases to use implict casting of return types instead of explicit (this moved the 'unchecked' warning to the API method from the caller). Example:

// Before
ItemContext cc = ...
Hardware hardware = (Hardware)cc.getObject("item");
// After
Hardware hardware = cc.getObject("item");

In most cases both the old and new version of the code will work, but if the returned object is using a "type" parameter it will not compile:

// This will not compile!
Set<AnnotatedItem> items = (Set<AnnotatedItem>)cc.getObject("AnnotatedItems");
// But this will!
Set<AnnotatedItem> items = cc.getObject("AnnotatedItems");

Note that existing compiled code will still work, but that some changes may be needed when compiling agains BASE 3.15. The issues should be easy to solve (eg. remove an explict cast).

Extensions that uses JSP files that works in BASE 3.14 may stop working in BASE 3.15 since the compilation of the JSP files happens on the BASE server as they are accessed.

Another issues is that there are still a lot of unchecked warnings related to the JSON library. This build on regular Map and List API:s but has not specified generic type parameters so there is no way to get rid of those warnings without fixing the JSON library source code. The latest released version is from 2012 so it is not likely that this should happen unless we do it ourselves (the warnings are really annoying so maybe we should!).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 20.6 KB
Line 
1<%-- $Id: list_biosources.jsp 7605 2019-02-26 10:10:15Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
4  Copyright (C) 2007 Johan Enell, Martin Svensson
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 pageEncoding="UTF-8" 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.BioSource"
31  import="net.sf.basedb.core.Sample"
32  import="net.sf.basedb.core.AnnotationType"
33  import="net.sf.basedb.core.ItemSubtype"
34  import="net.sf.basedb.core.AnnotationSet"
35  import="net.sf.basedb.core.Annotation"
36  import="net.sf.basedb.core.ItemQuery"
37  import="net.sf.basedb.core.Include"
38  import="net.sf.basedb.core.ItemResultIterator"
39  import="net.sf.basedb.core.ItemResultList"
40  import="net.sf.basedb.core.ItemContext"
41  import="net.sf.basedb.core.Nameable"
42  import="net.sf.basedb.core.Permission"
43  import="net.sf.basedb.core.PluginDefinition"
44  import="net.sf.basedb.core.Type"
45  import="net.sf.basedb.core.query.Hql"
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.plugin.GuiContext"
50  import="net.sf.basedb.core.plugin.Plugin"
51  import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil"
52  import="net.sf.basedb.core.snapshot.AnnotationTypeFilter"
53  import="net.sf.basedb.core.snapshot.AnnotationSnapshot"
54  import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot"
55  import="net.sf.basedb.core.snapshot.SnapshotManager"
56  import="net.sf.basedb.util.Enumeration"
57  import="net.sf.basedb.util.ShareableUtil"
58  import="net.sf.basedb.clients.web.Base"
59  import="net.sf.basedb.clients.web.ModeInfo"
60  import="net.sf.basedb.clients.web.PermissionUtil"
61  import="net.sf.basedb.clients.web.util.HTML"
62  import="net.sf.basedb.util.formatter.Formatter"
63  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
64  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
65  import="net.sf.basedb.clients.web.extensions.JspContext"
66  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
67  import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" 
68  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
69  import="net.sf.basedb.clients.web.extensions.list.ListColumnAction"
70  import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
71  import="net.sf.basedb.clients.web.util.ProjectSpecificInfoFilter"
72  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
73  import="net.sf.basedb.util.Values"
74  import="java.util.Iterator"
75  import="java.util.Date"
76  import="java.util.List"
77  import="java.util.Map"
78  import="java.util.ArrayList"
79%>
80<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
81<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
82<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
83<%!
84  private static final Item itemType = Item.BIOSOURCE;
85  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
86%>
87<%
88final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
89final String ID = sc.getId();
90final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
91final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
92
93final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
94final String callback = request.getParameter("callback");
95final String title = mode.generateTitle("biosource", "biosources");
96final DbControl dc = sc.newDbControl();
97ItemResultIterator<BioSource> bioSources = null;
98List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>();
99try
100{
101  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
102  SnapshotManager manager = new SnapshotManager();
103  ProjectSpecificInfoFilter psInfo = new ProjectSpecificInfoFilter();
104  for (AnnotationType at : annotationTypeQuery.list(dc))
105  {
106    annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at));
107  }
108  final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType);
109
110  final ItemQuery<Sample> sampleQuery = Sample.getQuery();
111  sampleQuery.include(cc.getInclude());
112  sampleQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("bioSource")));
113  sampleQuery.order(Orders.asc(Hql.property("name")));
114  final boolean createSamplePermission = sc.hasPermission(Permission.CREATE, Item.SAMPLE);
115
116  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
117  try
118  {
119    final ItemQuery<BioSource> query = Base.getConfiguredQuery(dc, cc, true, BioSource.getQuery(), mode);
120    bioSources = query.iterate(dc);
121  }
122  catch (Throwable t)
123  {
124    cc.setMessage(t.getMessage());
125    t.printStackTrace();
126  }
127  int numListed = 0;
128  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
129  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null);
130  ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext);
131  ExtensionsInvoker<ListColumnAction<BioSource,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext);
132  %>
133  <base:page title="<%=title==null ? "Biosources" : title%>" type="<%=mode.getPageType()%>" id="list-page">
134  <base:head scripts="table.js,~biosources.js" styles="table.css,toolbar.css">
135    <ext:scripts context="<%=jspContext%>" />
136    <ext:stylesheets context="<%=jspContext%>" />
137  </base:head>
138 
139  <base:body >
140    <h1><%=title==null ? "Biosources" : title%></h1>
141    <div class="content">
142      <tbl:table 
143        id="biosources" 
144        columns="<%=cc.getSetting("columns")%>"
145        sortby="<%=cc.getSortProperty()%>" 
146        direction="<%=cc.getSortDirection()%>"
147        action="index.jsp"
148        sc="<%=sc%>"
149        item="<%=itemType%>"
150        filterrows="<%=cc.getFilterRows()%>"
151        subclass="fulltable"
152      >
153      <tbl:hidden 
154        name="mode" 
155        value="<%=mode.getName()%>" 
156      />
157      <tbl:hidden 
158        name="callback" 
159        value="<%=callback%>" 
160        skip="<%=callback == null%>" 
161      />
162      <tbl:columndef 
163        id="name"
164        property="name"
165        datatype="string"
166        title="Name"
167        sortable="true" 
168        filterable="true"
169        exportable="true"
170        show="always" 
171      />
172      <tbl:columndef 
173        id="itemSubtype"
174        property="itemSubtype"
175        sortproperty="itemSubtype.name"
176        exportproperty="itemSubtype.name:string"
177        datatype="int"
178        enumeration="<%=Enumeration.fromItems(subtypesQuery.list(dc), "-none-")%>"
179        title="Type"
180        sortable="true" 
181        filterable="true"
182        exportable="true"
183      />
184      <tbl:columndef 
185         id="id"
186        clazz="uniquecol"
187         property="id"
188         datatype="int"
189         title="ID"
190         sortable="true" 
191         filterable="true"
192         exportable="true"
193      />
194      <tbl:columndef 
195        id="externalId"
196        property="externalId"
197        datatype="string"
198        title="External id"
199        sortable="true" 
200        filterable="true"
201        exportable="true"
202      />
203      <tbl:columndef 
204        id="entryDate"
205        property="entryDate"
206        datatype="date"
207        title="Registered"
208        sortable="true" 
209        filterable="true"
210        exportable="true"
211        formatter="<%=dateFormatter%>"
212      />
213      <tbl:columndef
214        id="samples"
215        title="Samples"
216        property="&children(name)"
217        datatype="string"
218        filterable="true"
219        exportable="true"
220      />
221      <tbl:columndef 
222        id="owner"
223        property="owner.name"
224        datatype="string"
225        title="Owner"
226        sortable="true" 
227        filterable="true"
228        exportable="true"
229      />
230      <tbl:columndef 
231        id="description"
232        property="description"
233        datatype="string"
234        title="Description" 
235        sortable="true" 
236        filterable="true" subclass="foobar"
237        exportable="true"
238      />     
239      <tbl:columndef
240        id="itemList"
241        property="§itemLists"
242        datatype="int"
243        title="Item list"
244        filterable="true"
245        enumeration="<%=Base.getItemListsEnum(dc, itemType, cc.getInclude())%>"
246        multiple="false"
247      />
248      <%
249      for (AnnotationLoaderUtil loader : annotationLoaders)
250      {
251        AnnotationType at = loader.getAnnotationType();
252        Enumeration<String, String> annotationEnum = null;
253        Formatter<Object> formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
254        if (at.isEnumeration())
255        {
256          annotationEnum = new Enumeration<String, String>();
257          if (!at.getDisplayAsList()) annotationEnum.add("", "-none-");
258          List<?> values = at.getValues();
259          for (Object value : values)
260          {
261            String encoded = formatter.format(value);
262            annotationEnum.add(encoded, encoded);
263          }
264        }
265        %>
266        <tbl:columndef 
267          id="<%="at"+at.getId()%>"
268          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
269          property="<%="#"+at.getId()%>"
270          annotation="true"
271          datatype="<%=at.getValueType().getStringValue()%>"
272          enumeration="<%=annotationEnum%>"
273          smartenum="<%=at.getDisplayAsList() %>"
274          sortable="<%=at.getMultiplicity() == 1%>" 
275          filterable="true" 
276          exportable="true"
277          formatter="<%=formatter%>"
278          unit="<%=at.getDefaultUnit()%>"
279        />
280        <%
281      }
282      %>
283      <tbl:columndef
284        id="permission"
285        title="Permission"
286      />
287      <tbl:columndef
288        id="sharedTo"
289        title="Shared to"
290        filterable="true"
291        filterproperty="!sharedTo.name"
292        datatype="string"
293      />
294      <tbl:columndef 
295        id="xt-columns" 
296        extensions="<%=columnsInvoker%>" 
297        jspcontext="<%=jspContext%>" 
298      />
299      <div class="panelgroup bg-filled-50 bottomborder">
300        <tbl:toolbar
301          visible="<%=mode.hasToolbar()%>"
302          subclass="bottomborder"
303          >
304          <tbl:button 
305            id="btnNewItem"
306            disabled="<%=!createPermission%>" 
307            image="new.png" 
308            title="New&hellip;" 
309            tooltip="<%=createPermission ? "Create new biosource" : "You do not have permission to create biosources"%>" 
310          />
311          <tbl:button 
312            id="btnDeleteItems"
313            image="delete.png"
314            title="Delete" 
315            tooltip="Delete the selected items" 
316          />
317          <tbl:button 
318            id="btnRestoreItems"
319            image="restore.png"
320            title="Restore" 
321            tooltip="Restore the selected (deleted) items"
322          />
323          <tbl:button 
324            id="btnShareItems"
325            image="share.png"
326            title="Share&hellip;" 
327            tooltip="Share the selected items"
328          />
329          <tbl:button 
330            id="btnSetOwner"
331            image="take_ownership.png"
332            title="Set owner&hellip;"
333            tooltip="Change owner of the selected items"
334          />
335          <tbl:button 
336            id="btnColumns"
337            image="columns.png" 
338            title="Columns&hellip;" 
339            tooltip="Show, hide and re-order columns" 
340          />
341          <tbl:button
342            id="btnNewItemList"
343            image="add.png"
344            title="New item list&hellip;"
345            tooltip="Create a new item list from matching biosources"
346            visible="<%=sc.hasPermission(Permission.CREATE, Item.ITEMLIST)%>"
347          />
348          <tbl:button 
349            id="btnImport"
350            data-plugin-type="IMPORT"
351            image="import.png" 
352            title="Import&hellip;" 
353            tooltip="Import data" 
354            visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
355          />
356          <tbl:button 
357            id="btnExport"
358            data-plugin-type="EXPORT"
359            image="export.png" 
360            title="Export&hellip;" 
361            tooltip="Export data" 
362            visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
363          />
364          <tbl:button 
365            id="btnRunPlugin"
366            data-plugin-type="OTHER"
367            image="runplugin.png" 
368            title="Run plugin&hellip;" 
369            tooltip="Run a plugin" 
370            visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
371          />
372          <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
373            wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/>
374        </tbl:toolbar>
375        <tbl:panel>
376          <tbl:presetselector />
377          <tbl:navigator
378            page="<%=cc.getPage()%>" 
379            rowsperpage="<%=cc.getRowsPerPage()%>" 
380            totalrows="<%=bioSources == null ? 0 : bioSources.getTotalCount()%>" 
381            visible="<%=mode.hasNavigator()%>"
382          />
383        </tbl:panel>
384      </div>
385      <tbl:data>
386        <tbl:headers>
387          <tbl:headerrow>
388            <tbl:header colspan="3" />
389            <tbl:columnheaders />
390          </tbl:headerrow>
391          <%
392          int numFilters = cc.getNumPropertyFilters();
393          int numRows = cc.getFilterRows();
394          for (int filterNo = 0; filterNo < numRows; filterNo++)
395          {
396            boolean lastRow = filterNo == numRows-1;
397            %>
398            <tbl:headerrow>
399              <tbl:header subclass="index" />
400              <tbl:header 
401                subclass="check" 
402                visible="<%=mode.hasCheck()%>"
403                ><base:icon 
404                  subclass="link table-check"
405                  image="check_uncheck.png" 
406                  tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" 
407                  visible="<%=lastRow%>"
408                /></tbl:header>
409              <tbl:header 
410                subclass="check" 
411                visible="<%=mode.hasRadio()%>"
412                />
413              <tbl:header 
414                subclass="icons" 
415                visible="<%=mode.hasIcons()%>"
416                >
417                <base:icon
418                  subclass="link table-filter-row-action"
419                  image="add.png"
420                  tooltip="Add extra filter row"
421                  visible="<%=lastRow%>"
422                /><base:icon
423                  subclass="link table-filter-row-action"
424                  image="remove.png"
425                  tooltip="Remove this filter row"
426                  visible="<%=numRows > 1 || numFilters > 0 %>"
427                  data-remove-row="<%=filterNo%>"
428                />
429              </tbl:header>
430              <tbl:propertyfilter row="<%=filterNo%>" />
431            </tbl:headerrow>
432            <%
433          }
434          %>
435        </tbl:headers>
436        <tbl:rows>
437          <%
438          if (cc.getMessage() != null)
439          {
440            %>
441            <tbl:panel subclass="bg-filled-50">
442              <div class="messagecontainer error"><%=cc.getMessage()%></div>
443            </tbl:panel>
444            <%
445            cc.setMessage(null);
446          }
447          int index = cc.getPage()*cc.getRowsPerPage();
448          int selectedItemId = cc.getId();
449          if (bioSources != null)
450          {           
451            while (bioSources.hasNext())
452            {
453              BioSource item = bioSources.next();
454              int itemId = item.getId();
455              boolean usePermission = item.hasPermission(Permission.USE);
456             
457             
458              boolean deletePermission = item.hasPermission(Permission.DELETE);
459              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
460              boolean writePermission = item.hasPermission(Permission.WRITE);
461              String tooltip = mode.isSelectionMode() ? 
462                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
463              String name = HTML.encodeTags(item.getName());
464              index++;
465              numListed++;
466              %>
467              <tbl:row>
468                <tbl:header 
469                  clazz="index"
470                  ><%=index%></tbl:header>
471                <tbl:header 
472                  clazz="check" 
473                  visible="<%=mode.hasCheck()%>"
474                  ><input 
475                    type="checkbox" 
476                    name="<%=itemId%>" 
477                    value="<%=itemId%>" 
478                    title="<%=name%>" 
479                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
480                  ></tbl:header>
481                <tbl:header 
482                  clazz="check" 
483                  visible="<%=mode.hasRadio()%>"
484                  ><input 
485                    type="radio" 
486                    name="item_id" 
487                    value="<%=itemId%>" 
488                    title="<%=name%>" 
489                    <%=selectedItemId == itemId ? "checked" : ""%>
490                  ></tbl:header>
491                <tbl:header 
492                  clazz="icons" 
493                  visible="<%=mode.hasIcons()%>"
494                  ><base:icon 
495                    image="deleted.png"
496                    id="<%="delete."+itemId %>"
497                    subclass="<%=deletePermission ? "table-delete-item" : "disabled" %>"
498                    data-item-id="<%=itemId%>"
499                    tooltip="This item has been scheduled for deletion" 
500                    visible="<%=item.isRemoved()%>"
501                  /><base:icon 
502                    image="shared.png" 
503                    id="<%="share."+itemId %>"
504                    subclass="<%=sharePermission ? "table-share-item" : "disabled" %>"
505                    data-item-id="<%=itemId%>"
506                    tooltip="This item is shared to other users, groups and/or projects" 
507                    visible="<%=item.isShared()%>"
508                  />&nbsp;</tbl:header>
509                <tbl:cell column="name"><div 
510                  class="link table-item"
511                  data-item-id="<%=itemId%>"
512                  data-no-edit="<%=writePermission ? 0 : 1 %>" 
513                  tabindex="0"
514                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
515                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
516                <tbl:cell column="itemSubtype"><base:propertyvalue 
517                    item="<%=item%>" 
518                    property="itemSubtype"
519                    enableEditLink="<%=mode.hasEditLink()%>" 
520                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
521                  /></tbl:cell>
522                <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell>
523                <tbl:cell column="samples">
524                  <%
525                  sampleQuery.setParameter("bioSource", itemId, Type.INT);
526                  try
527                  {
528                    String separator = "";
529                    for (Sample s : sampleQuery.list(dc))
530                    {
531                      out.write(separator);
532                      if (mode.hasPropertyLink())
533                      {
534                        out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink()));
535                      }
536                      else
537                      {
538                        out.write(HTML.encodeTags(s.getName()));
539                      }
540                      separator = ", ";
541                    }
542                  }
543                  catch (Throwable t)
544                  {
545                    %>
546                    <div class="error"><%=t.getMessage()%></div>
547                    <%
548                  }
549                  %>
550                  <base:icon
551                    id="<%="newsample."+itemId%>"
552                    image="add.png" 
553                    subclass="auto-init"
554                    data-auto-init="new-sample"
555                    data-item-id="<%=itemId %>"
556                    tooltip="Create new sample" 
557                    visible="<%=mode.hasEditLink() && createSamplePermission && usePermission %>"
558                  />
559                </tbl:cell>
560                <tbl:cell column="owner"
561                  ><base:propertyvalue 
562                    item="<%=item%>" 
563                    property="owner"
564                    enableEditLink="<%=mode.hasEditLink()%>" 
565                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
566                  /></tbl:cell>
567                <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" />
568                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>               
569                <%
570                if (item.isAnnotated())
571                {
572                  AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId());
573                  for (AnnotationLoaderUtil loader : annotationLoaders)
574                  {
575                    %>
576                    <tbl:cell 
577                      column="<%="at"+loader.getId()%>"
578                      ><%
579                      if (loader.find(snapshot, psInfo.reset())) 
580                      {
581                        %><tbl:cellvalue 
582                          list="<%=loader.getValues()%>"
583                          suffix="<%=loader.getUnitSymbol()%>"
584                          clazz="<%=psInfo.overridesDefaultAnnotation() ? "ps-annotation" : null%>"
585                        /><%
586                      }
587                      %></tbl:cell>
588                    <%
589                  }
590                }
591                %>
592                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
593                <tbl:cell column="sharedTo">
594                  <%
595                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
596                  while(sharees.hasNext())
597                  {
598                    Nameable n = sharees.next();
599                    if (mode.hasPropertyLink())
600                    {
601                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
602                    }
603                    else
604                    {
605                      out.write(HTML.encodeTags(n.getName()));
606                    }
607                    out.write(sharees.hasNext() ? ", " : "");
608                  }
609                  %>
610                </tbl:cell>
611                <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
612                  <tbl:cell column="xt-columns" />
613                </tbl:xt-cells>
614              </tbl:row>
615              <%
616              }
617            }
618            if (numListed == 0)
619            {
620              %>
621              <tbl:panel subclass="bg-filled-50">
622                <div class="messagecontainer note">
623                <%=bioSources == null || bioSources.getTotalCount() == 0 ? "No biosources were found" : "No biosources on this page. Please select another page!" %>
624                </div>
625              </tbl:panel>
626              <%
627            }
628          %>
629        </tbl:rows>
630      </tbl:data>
631    </tbl:table>
632    </div>
633
634    <base:buttongroup subclass="dialogbuttons">
635      <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
636      <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
637      <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
638    </base:buttongroup>
639  </base:body>
640  </base:page>
641  <%
642}
643finally
644{
645  if (bioSources != null) bioSources.close();
646  if (dc != null) dc.close();
647}
648%>
Note: See TracBrowser for help on using the repository browser.