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

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

References #721: Most things for attaching files to rw bioassays are now in place.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 22.3 KB
Line 
1<%-- $Id: list_rawbioassays.jsp 3807 2007-10-05 13:36:13Z 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      Enumeration<String, String> rawEnumeration = new Enumeration<String, String>();
286      for (RawDataType rdt : RawDataTypes.getRawDataTypes())
287      {
288        rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName()));
289      }
290      %>
291      <tbl:columndef 
292        id="rawDataType"
293        property="rawDataType"
294        datatype="string"
295        enumeration="<%=rawEnumeration%>"
296        title="Raw data type"
297        sortable="true" 
298        filterable="true"
299        exportable="true"
300      />
301      <tbl:columndef 
302        id="hasData"
303        property="hasData"
304        datatype="boolean"
305        title="Has data"
306        sortable="true" 
307        filterable="true"
308        exportable="true"
309      />
310      <tbl:columndef 
311        id="numDbSpots"
312        property="numDbSpots"
313        datatype="int"
314        title="Db spots"
315        sortable="true" 
316        filterable="true"
317        exportable="true"
318      />
319      <tbl:columndef 
320        id="numFileSpots"
321        property="numFileSpots"
322        datatype="int"
323        title="File spots"
324        sortable="true" 
325        filterable="true"
326        exportable="true"
327      />     
328      <tbl:columndef 
329        id="bytes"
330        property="bytes"
331        datatype="long"
332        title="Bytes"
333        sortable="true" 
334        filterable="true"
335        exportable="true"
336      />
337      <tbl:columndef 
338        id="scan"
339        property="scan.name"
340        datatype="string"
341        title="Scan"
342        sortable="true" 
343        filterable="true"
344        exportable="true"
345      />
346      <tbl:columndef 
347        id="software"
348        property="software.name"
349        datatype="string"
350        title="Software"
351        sortable="true" 
352        filterable="true"
353        exportable="true"
354      />
355      <tbl:columndef 
356        id="protocol"
357        property="protocol.name"
358        datatype="string"
359        title="Protocol"
360        sortable="true" 
361        filterable="true"
362        exportable="true"
363      />
364      <tbl:columndef 
365        id="arrayDesign"
366        property="arrayDesign.name"
367        datatype="string"
368        title="Array design"
369        sortable="true" 
370        filterable="true"
371        exportable="true"
372      />
373      <tbl:columndef
374        id="experiments"
375        title="Experiments"
376      />
377      <tbl:columndef 
378        id="owner"
379        property="owner.name"
380        datatype="string"
381        title="Owner"
382        sortable="true" 
383        filterable="true"
384        exportable="true"
385      />
386      <tbl:columndef 
387        id="description"
388        property="description"
389        datatype="string"
390        title="Description" 
391        sortable="true" 
392        filterable="true" 
393        exportable="true"
394      />
395      <%
396      for (AnnotationType at : annotationTypes)
397      {
398        Enumeration<String, String> annotationEnum = null;
399        if (at.isEnumeration())
400        {
401          annotationEnum = new Enumeration<String, String>();
402          List<?> values = at.getValues();
403          for (Object value : values)
404          {
405            String encoded = HTML.encodeTags(value.toString());
406            annotationEnum.add(encoded, encoded);
407          }
408        }
409        %>
410        <tbl:columndef 
411          id="<%="at"+at.getId()%>"
412          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
413          property="<%="#"+at.getId()%>"
414          annotation="true"
415          datatype="<%=at.getValueType().getStringValue()%>"
416          enumeration="<%=annotationEnum%>"
417          sortable="false" 
418          filterable="true" 
419          exportable="true"
420        />
421        <%
422      }
423      %>
424      <tbl:columndef
425        id="permission"
426        title="Permission"
427      />
428      <tbl:columndef 
429        id="sharedTo" 
430        title="Shared to"
431      />
432      <tbl:toolbar
433        visible="<%=mode.hasToolbar()%>"
434        >
435        <tbl:button 
436          disabled="<%=createPermission ? false : true%>" 
437          image="<%=createPermission ? "new.gif" : "new_disabled.gif"%>" 
438          onclick="newItem()" 
439          title="New&hellip;" 
440          tooltip="<%=createPermission ? "Create new raw bioassay" : "You do not have permission to create raw bioassays"%>" 
441        />
442        <tbl:button 
443          image="delete.gif"
444          onclick="deleteItems()" 
445          title="Delete" 
446          tooltip="Delete the selected items" 
447        />
448        <tbl:button 
449          image="restore.gif"
450          onclick="restoreItems()" 
451          title="Restore" 
452          tooltip="Restore the selected (deleted) items"
453        />
454        <tbl:button 
455          image="share.gif"
456          onclick="shareItems()" 
457          title="Share&hellip;" 
458          tooltip="Share the selected items"
459        />
460        <tbl:button 
461          image="take_ownership.png"
462          onclick="takeOwnership()" 
463          title="Take ownership&hellip;"
464          tooltip="Take ownership of the selected items"
465        />
466        <tbl:button 
467          image="columns.gif" 
468          onclick="configureColumns()" 
469          title="Columns&hellip;" 
470          tooltip="Show, hide and re-order columns" 
471        />
472        <tbl:button
473          image="add.png"
474          onclick="newExperiment()"
475          title="New experiment&hellip;"
476          tooltip="Create a new experiment from the selected raw bioassays"
477          visible="<%=sc.hasPermission(Permission.CREATE, Item.EXPERIMENT)%>"
478        />
479        <tbl:button 
480          image="import.gif" 
481          onclick="runPlugin('ImportItems')" 
482          title="Import&hellip;" 
483          tooltip="Import data" 
484          visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
485        />
486        <tbl:button 
487          image="export.gif" 
488          onclick="runPlugin('ExportItems')" 
489          title="Export&hellip;" 
490          tooltip="Export data" 
491          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
492        />
493        <tbl:button 
494          image="runplugin.gif" 
495          onclick="runPlugin('RunListPlugin')" 
496          title="Run plugin&hellip;" 
497          tooltip="Run a plugin" 
498          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
499        />
500      </tbl:toolbar>
501      <tbl:navigator
502        page="<%=cc.getPage()%>" 
503        rowsperpage="<%=cc.getRowsPerPage()%>" 
504        totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
505        visible="<%=mode.hasNavigator()%>"
506      />
507      <tbl:data>
508        <tbl:columns>
509        <tbl:presetselector 
510          clazz="columnheader"
511          colspan="3"
512          onchange="presetOnChange()"
513        />
514        </tbl:columns>
515
516        <tr>
517          <tbl:header 
518            clazz="index"
519            >&nbsp;</tbl:header>
520          <tbl:header 
521            clazz="check" 
522            visible="<%=mode.hasCheck()%>"
523            ><base:icon 
524              image="check_uncheck.gif" 
525              tooltip="Check/uncheck all" 
526              onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;"
527            /></tbl:header>
528          <tbl:header 
529            clazz="check" 
530            visible="<%=mode.hasRadio()%>"
531            >&nbsp;</tbl:header>
532          <tbl:header 
533            clazz="icons" 
534            visible="<%=mode.hasIcons()%>"
535            >&nbsp;</tbl:header>
536          <tbl:propertyfilter />
537        </tr>
538         
539          <tbl:rows>
540          <%
541          int index = cc.getPage()*cc.getRowsPerPage();
542          int selectedItemId = cc.getId();
543          if (rawBioAssays != null)
544          {           
545            while (rawBioAssays.hasNext())
546            {
547              RawBioAssay item = rawBioAssays.next();
548              RawDataType rdt = item.getRawDataType();
549              int itemId = item.getId();
550              String openSharePopup = "shareItem("+itemId+")";
551              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
552              boolean writePermission = item.hasPermission(Permission.WRITE);
553              String tooltip = mode.isSelectionMode() ? 
554                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
555              String name = HTML.encodeTags(item.getName());
556              index++;
557              numListed++;
558              %>
559              <tbl:row>
560                <tbl:header 
561                  clazz="index"
562                  ><%=index%></tbl:header>
563                <tbl:header 
564                  clazz="check" 
565                  visible="<%=mode.hasCheck()%>"
566                  ><input 
567                    type="checkbox" 
568                    name="<%=itemId%>" 
569                    value="<%=itemId%>" 
570                    title="<%=name%>" 
571                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
572                  ></tbl:header>
573                <tbl:header 
574                  clazz="check" 
575                  visible="<%=mode.hasRadio()%>"
576                  ><input 
577                    type="radio" 
578                    name="item_id" 
579                    value="<%=itemId%>" 
580                    title="<%=name%>" 
581                    <%=selectedItemId == itemId ? "checked" : ""%>
582                  ></tbl:header>
583                <tbl:header 
584                  clazz="icons" 
585                  visible="<%=mode.hasIcons()%>"
586                  ><base:icon 
587                    image="deleted.gif" 
588                    tooltip="This item has been scheduled for deletion" 
589                    visible="<%=item.isRemoved()%>"
590                  /><base:icon 
591                    image="<%=sharePermission ? "shared.gif" : "shared_disabled.gif"%>" 
592                    onclick="<%=sharePermission ? openSharePopup : null%>"
593                    tooltip="This item is shared to other users, groups and/or projects" 
594                    visible="<%=item.isShared()%>"
595                  />&nbsp;</tbl:header>
596                <tbl:cell column="name"><div class="link" 
597                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 
598                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
599                <tbl:cell column="numDbSpots"><%=item.getNumDbSpots()%></tbl:cell>
600                <tbl:cell column="numFileSpots"><%=item.getNumFileSpots()%></tbl:cell>
601                <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell>
602                <tbl:cell column="platform"
603                  ><base:propertyvalue 
604                    item="<%=item%>" 
605                    property="platform"
606                    enableEditLink="<%=mode.hasEditLink()%>" 
607                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
608                  /></tbl:cell>
609                <tbl:cell column="variant"
610                  ><base:propertyvalue 
611                    item="<%=item%>" 
612                    property="variant"
613                    enableEditLink="<%=mode.hasEditLink()%>" 
614                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
615                  /></tbl:cell>               <tbl:cell column="rawDataType"><%=HTML.encodeTags(rdt.getName())%></tbl:cell>
616                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
617                <tbl:cell column="scan"
618                  ><base:propertyvalue 
619                    item="<%=item%>" 
620                    property="scan"
621                    enableEditLink="<%=mode.hasEditLink()%>" 
622                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
623                  /></tbl:cell>
624                <tbl:cell column="software"
625                  ><base:propertyvalue 
626                    item="<%=item%>" 
627                    property="software"
628                    enableEditLink="<%=mode.hasEditLink()%>" 
629                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
630                  /></tbl:cell>
631                <tbl:cell column="protocol"
632                  ><base:propertyvalue 
633                    item="<%=item%>" 
634                    property="protocol"
635                    enableEditLink="<%=mode.hasEditLink()%>" 
636                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
637                  /></tbl:cell>
638                <tbl:cell column="arrayDesign"
639                  ><base:propertyvalue 
640                    item="<%=item%>" 
641                    property="arrayDesign"
642                    enableEditLink="<%=mode.hasEditLink()%>" 
643                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
644                  /></tbl:cell>
645                <tbl:cell column="experiments">
646                  <%
647                  experimentQuery.setParameter("rawBioAssay", itemId, Type.INT);
648                  try
649                  {
650                    String separator = "";
651                    for (Experiment e : experimentQuery.list(dc))
652                    {
653                      out.write(separator);
654                      if (mode.hasPropertyLink())
655                      {
656                        out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));
657                      }
658                      else
659                      {
660                        out.write(HTML.encodeTags(e.getName()));
661                      }
662                      separator = ", ";
663                    }
664                  }
665                  catch (Throwable t)
666                  {
667                    %>
668                    <div class="error"><%=t.getMessage()%></div>
669                    <%
670                  }
671                  %>
672                </tbl:cell>
673                <tbl:cell column="owner"
674                  ><base:propertyvalue 
675                    item="<%=item%>" 
676                    property="owner"
677                    enableEditLink="<%=mode.hasEditLink()%>" 
678                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
679                  /></tbl:cell>
680                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
681                <%
682                AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;
683                for (AnnotationType at : annotationTypes)
684                {
685                  %>
686                  <tbl:cell column="<%="at"+at.getId()%>">
687                    <%
688                    List<?> values = as == null || !as.hasAnnotation(at) ? null : as.getAnnotation(at).getValues();
689                    %>
690                    <%=values == null || values.size() == 0 ? "" : HTML.encodeTags(Values.getString(values, ", ", true))%>
691                  </tbl:cell>
692                  <%
693                }
694                %>
695                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
696                <tbl:cell column="sharedTo">
697                  <%
698                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
699                  while(sharees.hasNext())
700                  {
701                    Nameable n = sharees.next();
702                    if (mode.hasPropertyLink())
703                    {
704                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
705                    }
706                    else
707                    {
708                      out.write(HTML.encodeTags(n.getName()));
709                    }
710                    out.write(sharees.hasNext() ? ", " : "");
711                  }
712                  %>
713                </tbl:cell>
714              </tbl:row>
715              <%
716              }
717            }
718          %>
719          </tbl:rows>
720      </tbl:data>
721      <%
722      if (numListed == 0)
723      {
724        %>
725        <tbl:panel><%=rawBioAssays == null || rawBioAssays.getTotalCount() == 0 ? "No raw bioassays were found" : "No raw bioassays on this page. Please select another page!" %></tbl:panel>
726        <%
727      }
728      else
729      {
730        %>
731        <tbl:navigator
732          page="<%=cc.getPage()%>" 
733          rowsperpage="<%=cc.getRowsPerPage()%>" 
734          totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
735          visible="<%=mode.hasNavigator()%>"
736          locked="true"
737        />
738        <%
739      }
740      %>
741    </tbl:table>
742    <base:buttongroup align="center" clazz="fixedatbottom">
743      <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />
744      <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
745      <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />
746    </base:buttongroup>
747    <br><br><br>
748  </base:body>
749  </base:page>
750  <%
751}
752finally
753{
754  if (rawBioAssays != null) rawBioAssays.close();
755  if (dc != null) dc.close();
756}
757%>
Note: See TracBrowser for help on using the repository browser.