source: branches/filedb/www/views/rawbioassays/list_rawbioassays.jsp @ 3814

Last change on this file since 3814 was 3814, checked in by Nicklas Nordborg, 16 years ago

References #721: Store data in files instead of in the database

  • Experiments are now aware of file-only raw data types
  • Fixed test programs
  • A few remaining Affymetrix issues


  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 22.5 KB
Line 
1<%-- $Id: list_rawbioassays.jsp 3814 2007-10-10 12:57:07Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson
5  Copyright (C) 2007 Johan Enell, Martin Svensson
6
7  This file is part of BASE - BioArray Software Environment.
8  Available at http://base.thep.lu.se/
9
10  BASE is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 2
13  of the License, or (at your option) any later version.
14
15  BASE is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place - Suite 330,
23  Boston, MA  02111-1307, USA.
24  ------------------------------------------------------------------
25
26  @author Nicklas
27  @version 2.0
28--%>
29<%@ page session="false"
30  import="net.sf.basedb.core.SessionControl"
31  import="net.sf.basedb.core.DbControl"
32  import="net.sf.basedb.core.Item"
33  import="net.sf.basedb.core.RawBioAssay"
34  import="net.sf.basedb.core.Platform"
35  import="net.sf.basedb.core.RawDataType"
36  import="net.sf.basedb.core.RawDataTypes"
37  import="net.sf.basedb.core.Experiment"
38  import="net.sf.basedb.core.Affymetrix"
39  import="net.sf.basedb.core.AnnotationType"
40  import="net.sf.basedb.core.AnnotationSet"
41  import="net.sf.basedb.core.File"
42  import="net.sf.basedb.core.ItemQuery"
43  import="net.sf.basedb.core.Include"
44  import="net.sf.basedb.core.Type"
45  import="net.sf.basedb.core.ItemResultIterator"
46  import="net.sf.basedb.core.ItemResultList"
47  import="net.sf.basedb.core.ItemContext"
48  import="net.sf.basedb.core.Nameable"
49  import="net.sf.basedb.core.Permission"
50  import="net.sf.basedb.core.PluginDefinition"
51  import="net.sf.basedb.core.PermissionDeniedException"
52  import="net.sf.basedb.core.query.Hql"
53  import="net.sf.basedb.core.query.Restrictions"
54  import="net.sf.basedb.core.query.Expressions"
55  import="net.sf.basedb.core.query.Orders"
56  import="net.sf.basedb.core.plugin.GuiContext"
57  import="net.sf.basedb.core.plugin.Plugin"
58  import="net.sf.basedb.util.Enumeration"
59  import="net.sf.basedb.util.ShareableUtil"
60  import="net.sf.basedb.clients.web.Base"
61  import="net.sf.basedb.clients.web.ModeInfo"
62  import="net.sf.basedb.clients.web.PermissionUtil"
63  import="net.sf.basedb.clients.web.util.HTML"
64  import="net.sf.basedb.util.Values"
65  import="java.util.Iterator"
66  import="java.util.List"
67  import="java.util.Map"
68%>
69<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
70<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
71<%!
72  private static final Item itemType = Item.RAWBIOASSAY;
73  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
74%>
75<%
76final String root = request.getContextPath()+"/";
77final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
78final String ID = sc.getId();
79final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
80final boolean readPermission = sc.hasPermission(Permission.READ, itemType);
81final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
82
83final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
84final String callback = request.getParameter("callback");
85final String title = mode.generateTitle("raw bioassay", "raw bioassays");
86final DbControl dc = sc.newDbControl();
87ItemResultIterator<RawBioAssay> rawBioAssays = null;
88ItemResultList<AnnotationType> annotationTypes = null;
89try
90{
91  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
92
93  // Query for experiments relatated to the current raw bioassay
94  final ItemQuery<Experiment> experimentQuery = Experiment.getQuery();
95  experimentQuery.include(cc.getInclude());
96  experimentQuery.join(Hql.innerJoin("rawBioAssays", "rba"));
97  experimentQuery.restrict(Restrictions.eq(Hql.alias("rba"), Expressions.parameter("rawBioAssay")));
98  experimentQuery.order(Orders.asc(Hql.property("name"))); 
99 
100  // Get all platforms
101  final ItemQuery<Platform> platformQuery = Platform.getQuery();
102  platformQuery.order(Orders.asc(Hql.property("name")));
103  platformQuery.setCacheResult(true);
104  Enumeration<String, String> platforms = new Enumeration<String, String>();
105  for (Platform p : platformQuery.list(dc))
106  {
107    platforms.add(Integer.toString(p.getId()), p.getName());
108  }
109 
110  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
111  annotationTypes = annotationTypeQuery.list(dc);
112  try
113  {
114    final ItemQuery<RawBioAssay> query = Base.getConfiguredQuery(cc, true, RawBioAssay.getQuery(), mode);
115    rawBioAssays = query.iterate(dc);
116  }
117  catch (Throwable t)
118  {
119    t.printStackTrace();
120    cc.setMessage(t.getMessage());
121  }
122  int numListed = 0;
123  %>
124  <base:page title="<%=title==null ? "Raw bioassays" : title%>" type="<%=mode.getPageType()%>">
125  <base:head scripts="menu.js,table.js" styles="menu.css,table.css">
126    <script language="JavaScript">
127    var submitPage = 'index.jsp';
128    var formId = 'rawbioassays';
129    function newItem()
130    {
131      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);
132    }
133    function editItem(itemId)
134    {
135      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);
136    }
137    function viewItem(itemId)
138    {
139      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);
140    }
141    function itemOnClick(evt, itemId)
142    {
143      Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);
144    }
145    function deleteItems()
146    {
147      var frm = document.forms[formId];
148      if (Forms.numChecked(frm) == 0)
149      {
150        alert('Please select at least one item in the list');
151        return;
152      }
153      frm.action = submitPage;
154      frm.cmd.value = 'DeleteItems';
155      frm.submit();
156    }
157    function restoreItems()
158    {
159      var frm = document.forms[formId];
160      if (Forms.numChecked(frm) == 0)
161      {
162        alert('Please select at least one item in the list');
163        return;
164      }
165      frm.action = submitPage;
166      frm.cmd.value = 'RestoreItems';
167      frm.submit();
168    }
169    function takeOwnership()
170    {
171      var frm = document.forms[formId];
172      if (Forms.numChecked(frm) == 0)
173      {
174        alert('Please select at least one item in the list');
175        return;
176      }
177      if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.'))
178      {
179        frm.action = submitPage;
180        frm.cmd.value = 'TakeOwnershipOfItems';
181        frm.submit();
182      }
183    }
184    function shareItem(itemId)
185    {
186      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'ShareRawBioAssay', 500, 400);
187    }
188    function shareItems()
189    {
190      Table.shareItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'ShareItems');
191    }
192    function configureColumns()
193    {
194      Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
195    }
196    function runPlugin(cmd)
197    {
198      Table.submitToPopup(formId, cmd, 740, 540);
199    }
200    function returnSelected()
201    {
202      Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);
203      window.close();
204    }
205    function presetOnChange()
206    {
207      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
208    }
209    function newExperiment()
210    {
211      var frm = document.forms[formId];
212      var selected = Table.getSelected(formId);
213      if (selected.length == 0)
214      {
215        alert('Please select at least one item in the list');
216        return;
217      }
218      var extraUrl = '&rawbioassay_id='+selected.join('&rawbioassay_id=');
219      Main.viewOrEditItem('<%=ID%>', 'EXPERIMENT', 0, true, extraUrl);
220    }
221    </script>
222  </base:head>
223 
224  <base:body>
225    <%
226    if (cc.getMessage() != null)
227    {
228      %>
229      <div class="error"><%=cc.getMessage()%></div>
230      <%
231      cc.setMessage(null);
232    }
233    %>
234    <tbl:table 
235      id="rawbioassays" 
236      clazz="itemlist" 
237      columns="<%=cc.getSetting("columns")%>"
238      sortby="<%=cc.getSortProperty()%>" 
239      direction="<%=cc.getSortDirection()%>"
240      title="<%=title%>"
241      action="index.jsp"
242      sc="<%=sc%>"
243      item="<%=itemType%>"
244      >
245      <tbl:hidden 
246        name="mode" 
247        value="<%=mode.getName()%>" 
248      />
249      <tbl:hidden 
250        name="callback" 
251        value="<%=callback%>" 
252        skip="<%=callback == null%>" 
253      />
254      <tbl:columndef 
255        id="name"
256        property="name"
257        datatype="string"
258        title="Name"
259        sortable="true" 
260        filterable="true"
261        exportable="true"
262        show="always" 
263      />
264      <tbl:columndef 
265        id="platform"
266        property="platform"
267        sortproperty="platform.name"
268        exportproperty="platform.name"
269        datatype="int"
270        enumeration="<%=platforms%>"
271        title="Platform"
272        sortable="true" 
273        filterable="true"
274        exportable="true"
275      /> 
276      <tbl:columndef 
277        id="variant"
278        property="variant.name"
279        datatype="string"
280        title="Variant"
281        sortable="true" 
282        filterable="true"
283        exportable="true"
284      />       
285      <%
286      Enumeration<String, String> rawEnumeration = new Enumeration<String, String>();
287      for (RawDataType rdt : RawDataTypes.getRawDataTypes())
288      {
289        rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName()));
290      }
291      for (RawDataType rdt : RawDataTypes.getFileOnlyRawDataTypes())
292      {
293        rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName()));
294      }
295      rawEnumeration.sortValues();
296      %>
297      <tbl:columndef 
298        id="rawDataType"
299        property="rawDataType"
300        datatype="string"
301        enumeration="<%=rawEnumeration%>"
302        title="Raw data type"
303        sortable="true" 
304        filterable="true"
305        exportable="true"
306      />
307      <tbl:columndef 
308        id="hasData"
309        property="hasData"
310        datatype="boolean"
311        title="Has data"
312        sortable="true" 
313        filterable="true"
314        exportable="true"
315      />
316      <tbl:columndef 
317        id="numDbSpots"
318        property="numDbSpots"
319        datatype="int"
320        title="Db spots"
321        sortable="true" 
322        filterable="true"
323        exportable="true"
324      />
325      <tbl:columndef 
326        id="numFileSpots"
327        property="numFileSpots"
328        datatype="int"
329        title="File spots"
330        sortable="true" 
331        filterable="true"
332        exportable="true"
333      />     
334      <tbl:columndef 
335        id="bytes"
336        property="bytes"
337        datatype="long"
338        title="Bytes"
339        sortable="true" 
340        filterable="true"
341        exportable="true"
342      />
343      <tbl:columndef 
344        id="scan"
345        property="scan.name"
346        datatype="string"
347        title="Scan"
348        sortable="true" 
349        filterable="true"
350        exportable="true"
351      />
352      <tbl:columndef 
353        id="software"
354        property="software.name"
355        datatype="string"
356        title="Software"
357        sortable="true" 
358        filterable="true"
359        exportable="true"
360      />
361      <tbl:columndef 
362        id="protocol"
363        property="protocol.name"
364        datatype="string"
365        title="Protocol"
366        sortable="true" 
367        filterable="true"
368        exportable="true"
369      />
370      <tbl:columndef 
371        id="arrayDesign"
372        property="arrayDesign.name"
373        datatype="string"
374        title="Array design"
375        sortable="true" 
376        filterable="true"
377        exportable="true"
378      />
379      <tbl:columndef
380        id="experiments"
381        title="Experiments"
382      />
383      <tbl:columndef 
384        id="owner"
385        property="owner.name"
386        datatype="string"
387        title="Owner"
388        sortable="true" 
389        filterable="true"
390        exportable="true"
391      />
392      <tbl:columndef 
393        id="description"
394        property="description"
395        datatype="string"
396        title="Description" 
397        sortable="true" 
398        filterable="true" 
399        exportable="true"
400      />
401      <%
402      for (AnnotationType at : annotationTypes)
403      {
404        Enumeration<String, String> annotationEnum = null;
405        if (at.isEnumeration())
406        {
407          annotationEnum = new Enumeration<String, String>();
408          List<?> values = at.getValues();
409          for (Object value : values)
410          {
411            String encoded = HTML.encodeTags(value.toString());
412            annotationEnum.add(encoded, encoded);
413          }
414        }
415        %>
416        <tbl:columndef 
417          id="<%="at"+at.getId()%>"
418          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
419          property="<%="#"+at.getId()%>"
420          annotation="true"
421          datatype="<%=at.getValueType().getStringValue()%>"
422          enumeration="<%=annotationEnum%>"
423          sortable="false" 
424          filterable="true" 
425          exportable="true"
426        />
427        <%
428      }
429      %>
430      <tbl:columndef
431        id="permission"
432        title="Permission"
433      />
434      <tbl:columndef 
435        id="sharedTo" 
436        title="Shared to"
437      />
438      <tbl:toolbar
439        visible="<%=mode.hasToolbar()%>"
440        >
441        <tbl:button 
442          disabled="<%=createPermission ? false : true%>" 
443          image="<%=createPermission ? "new.gif" : "new_disabled.gif"%>" 
444          onclick="newItem()" 
445          title="New&hellip;" 
446          tooltip="<%=createPermission ? "Create new raw bioassay" : "You do not have permission to create raw bioassays"%>" 
447        />
448        <tbl:button 
449          image="delete.gif"
450          onclick="deleteItems()" 
451          title="Delete" 
452          tooltip="Delete the selected items" 
453        />
454        <tbl:button 
455          image="restore.gif"
456          onclick="restoreItems()" 
457          title="Restore" 
458          tooltip="Restore the selected (deleted) items"
459        />
460        <tbl:button 
461          image="share.gif"
462          onclick="shareItems()" 
463          title="Share&hellip;" 
464          tooltip="Share the selected items"
465        />
466        <tbl:button 
467          image="take_ownership.png"
468          onclick="takeOwnership()" 
469          title="Take ownership&hellip;"
470          tooltip="Take ownership of the selected items"
471        />
472        <tbl:button 
473          image="columns.gif" 
474          onclick="configureColumns()" 
475          title="Columns&hellip;" 
476          tooltip="Show, hide and re-order columns" 
477        />
478        <tbl:button
479          image="add.png"
480          onclick="newExperiment()"
481          title="New experiment&hellip;"
482          tooltip="Create a new experiment from the selected raw bioassays"
483          visible="<%=sc.hasPermission(Permission.CREATE, Item.EXPERIMENT)%>"
484        />
485        <tbl:button 
486          image="import.gif" 
487          onclick="runPlugin('ImportItems')" 
488          title="Import&hellip;" 
489          tooltip="Import data" 
490          visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
491        />
492        <tbl:button 
493          image="export.gif" 
494          onclick="runPlugin('ExportItems')" 
495          title="Export&hellip;" 
496          tooltip="Export data" 
497          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
498        />
499        <tbl:button 
500          image="runplugin.gif" 
501          onclick="runPlugin('RunListPlugin')" 
502          title="Run plugin&hellip;" 
503          tooltip="Run a plugin" 
504          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
505        />
506      </tbl:toolbar>
507      <tbl:navigator
508        page="<%=cc.getPage()%>" 
509        rowsperpage="<%=cc.getRowsPerPage()%>" 
510        totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
511        visible="<%=mode.hasNavigator()%>"
512      />
513      <tbl:data>
514        <tbl:columns>
515        <tbl:presetselector 
516          clazz="columnheader"
517          colspan="3"
518          onchange="presetOnChange()"
519        />
520        </tbl:columns>
521
522        <tr>
523          <tbl:header 
524            clazz="index"
525            >&nbsp;</tbl:header>
526          <tbl:header 
527            clazz="check" 
528            visible="<%=mode.hasCheck()%>"
529            ><base:icon 
530              image="check_uncheck.gif" 
531              tooltip="Check/uncheck all" 
532              onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;"
533            /></tbl:header>
534          <tbl:header 
535            clazz="check" 
536            visible="<%=mode.hasRadio()%>"
537            >&nbsp;</tbl:header>
538          <tbl:header 
539            clazz="icons" 
540            visible="<%=mode.hasIcons()%>"
541            >&nbsp;</tbl:header>
542          <tbl:propertyfilter />
543        </tr>
544         
545          <tbl:rows>
546          <%
547          int index = cc.getPage()*cc.getRowsPerPage();
548          int selectedItemId = cc.getId();
549          if (rawBioAssays != null)
550          {           
551            while (rawBioAssays.hasNext())
552            {
553              RawBioAssay item = rawBioAssays.next();
554              RawDataType rdt = item.getRawDataType();
555              int itemId = item.getId();
556              String openSharePopup = "shareItem("+itemId+")";
557              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
558              boolean writePermission = item.hasPermission(Permission.WRITE);
559              String tooltip = mode.isSelectionMode() ? 
560                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
561              String name = HTML.encodeTags(item.getName());
562              index++;
563              numListed++;
564              %>
565              <tbl:row>
566                <tbl:header 
567                  clazz="index"
568                  ><%=index%></tbl:header>
569                <tbl:header 
570                  clazz="check" 
571                  visible="<%=mode.hasCheck()%>"
572                  ><input 
573                    type="checkbox" 
574                    name="<%=itemId%>" 
575                    value="<%=itemId%>" 
576                    title="<%=name%>" 
577                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
578                  ></tbl:header>
579                <tbl:header 
580                  clazz="check" 
581                  visible="<%=mode.hasRadio()%>"
582                  ><input 
583                    type="radio" 
584                    name="item_id" 
585                    value="<%=itemId%>" 
586                    title="<%=name%>" 
587                    <%=selectedItemId == itemId ? "checked" : ""%>
588                  ></tbl:header>
589                <tbl:header 
590                  clazz="icons" 
591                  visible="<%=mode.hasIcons()%>"
592                  ><base:icon 
593                    image="deleted.gif" 
594                    tooltip="This item has been scheduled for deletion" 
595                    visible="<%=item.isRemoved()%>"
596                  /><base:icon 
597                    image="<%=sharePermission ? "shared.gif" : "shared_disabled.gif"%>" 
598                    onclick="<%=sharePermission ? openSharePopup : null%>"
599                    tooltip="This item is shared to other users, groups and/or projects" 
600                    visible="<%=item.isShared()%>"
601                  />&nbsp;</tbl:header>
602                <tbl:cell column="name"><div class="link" 
603                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 
604                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
605                <tbl:cell column="numDbSpots"><%=item.getNumDbSpots()%></tbl:cell>
606                <tbl:cell column="numFileSpots"><%=item.getNumFileSpots()%></tbl:cell>
607                <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell>
608                <tbl:cell column="platform"
609                  ><base:propertyvalue 
610                    item="<%=item%>" 
611                    property="platform"
612                    enableEditLink="<%=mode.hasEditLink()%>" 
613                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
614                  /></tbl:cell>
615                <tbl:cell column="variant"
616                  ><base:propertyvalue 
617                    item="<%=item%>" 
618                    property="variant"
619                    enableEditLink="<%=mode.hasEditLink()%>" 
620                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
621                  /></tbl:cell>               <tbl:cell column="rawDataType"><%=HTML.encodeTags(rdt.getName())%></tbl:cell>
622                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
623                <tbl:cell column="scan"
624                  ><base:propertyvalue 
625                    item="<%=item%>" 
626                    property="scan"
627                    enableEditLink="<%=mode.hasEditLink()%>" 
628                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
629                  /></tbl:cell>
630                <tbl:cell column="software"
631                  ><base:propertyvalue 
632                    item="<%=item%>" 
633                    property="software"
634                    enableEditLink="<%=mode.hasEditLink()%>" 
635                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
636                  /></tbl:cell>
637                <tbl:cell column="protocol"
638                  ><base:propertyvalue 
639                    item="<%=item%>" 
640                    property="protocol"
641                    enableEditLink="<%=mode.hasEditLink()%>" 
642                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
643                  /></tbl:cell>
644                <tbl:cell column="arrayDesign"
645                  ><base:propertyvalue 
646                    item="<%=item%>" 
647                    property="arrayDesign"
648                    enableEditLink="<%=mode.hasEditLink()%>" 
649                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
650                  /></tbl:cell>
651                <tbl:cell column="experiments">
652                  <%
653                  experimentQuery.setParameter("rawBioAssay", itemId, Type.INT);
654                  try
655                  {
656                    String separator = "";
657                    for (Experiment e : experimentQuery.list(dc))
658                    {
659                      out.write(separator);
660                      if (mode.hasPropertyLink())
661                      {
662                        out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));
663                      }
664                      else
665                      {
666                        out.write(HTML.encodeTags(e.getName()));
667                      }
668                      separator = ", ";
669                    }
670                  }
671                  catch (Throwable t)
672                  {
673                    %>
674                    <div class="error"><%=t.getMessage()%></div>
675                    <%
676                  }
677                  %>
678                </tbl:cell>
679                <tbl:cell column="owner"
680                  ><base:propertyvalue 
681                    item="<%=item%>" 
682                    property="owner"
683                    enableEditLink="<%=mode.hasEditLink()%>" 
684                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
685                  /></tbl:cell>
686                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
687                <%
688                AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;
689                for (AnnotationType at : annotationTypes)
690                {
691                  %>
692                  <tbl:cell column="<%="at"+at.getId()%>">
693                    <%
694                    List<?> values = as == null || !as.hasAnnotation(at) ? null : as.getAnnotation(at).getValues();
695                    %>
696                    <%=values == null || values.size() == 0 ? "" : HTML.encodeTags(Values.getString(values, ", ", true))%>
697                  </tbl:cell>
698                  <%
699                }
700                %>
701                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
702                <tbl:cell column="sharedTo">
703                  <%
704                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
705                  while(sharees.hasNext())
706                  {
707                    Nameable n = sharees.next();
708                    if (mode.hasPropertyLink())
709                    {
710                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
711                    }
712                    else
713                    {
714                      out.write(HTML.encodeTags(n.getName()));
715                    }
716                    out.write(sharees.hasNext() ? ", " : "");
717                  }
718                  %>
719                </tbl:cell>
720              </tbl:row>
721              <%
722              }
723            }
724          %>
725          </tbl:rows>
726      </tbl:data>
727      <%
728      if (numListed == 0)
729      {
730        %>
731        <tbl:panel><%=rawBioAssays == null || rawBioAssays.getTotalCount() == 0 ? "No raw bioassays were found" : "No raw bioassays on this page. Please select another page!" %></tbl:panel>
732        <%
733      }
734      else
735      {
736        %>
737        <tbl:navigator
738          page="<%=cc.getPage()%>" 
739          rowsperpage="<%=cc.getRowsPerPage()%>" 
740          totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
741          visible="<%=mode.hasNavigator()%>"
742          locked="true"
743        />
744        <%
745      }
746      %>
747    </tbl:table>
748    <base:buttongroup align="center" clazz="fixedatbottom">
749      <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />
750      <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
751      <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />
752    </base:buttongroup>
753    <br><br><br>
754  </base:body>
755  </base:page>
756  <%
757}
758finally
759{
760  if (rawBioAssays != null) rawBioAssays.close();
761  if (dc != null) dc.close();
762}
763%>
Note: See TracBrowser for help on using the repository browser.