source: trunk/www/views/rawbioassays/list_rawbioassays.jsp @ 6689

Last change on this file since 6689 was 6689, checked in by Nicklas Nordborg, 8 years ago

References #1906: Display inherited annotations in list views

The "Configure columns" dialog can now be used to add inherited annotation columns. This must be enabled from the list page by setting <tbl:table ... data-inherited-annotations="true"> in the table definition.

First implementation is made in the list raw bioassays table.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 26.3 KB
Line 
1<%-- $Id: list_rawbioassays.jsp 6689 2015-01-21 10:35:06Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, 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 3
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 BASE. If not, see <http://www.gnu.org/licenses/>.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25  @version 2.0
26--%>
27<%@ page pageEncoding="UTF-8" session="false"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.Item"
31  import="net.sf.basedb.core.RawBioAssay"
32  import="net.sf.basedb.core.Platform"
33  import="net.sf.basedb.core.RawDataType"
34  import="net.sf.basedb.core.RawDataTypes"
35  import="net.sf.basedb.core.Experiment"
36  import="net.sf.basedb.core.AnnotationType"
37  import="net.sf.basedb.core.AnnotationSet"
38  import="net.sf.basedb.core.Annotation"
39  import="net.sf.basedb.core.File"
40  import="net.sf.basedb.core.FileSetMember"
41  import="net.sf.basedb.core.ItemQuery"
42  import="net.sf.basedb.core.Include"
43  import="net.sf.basedb.core.Type"
44  import="net.sf.basedb.core.ItemResultIterator"
45  import="net.sf.basedb.core.ItemResultList"
46  import="net.sf.basedb.core.ItemContext"
47  import="net.sf.basedb.core.Job"
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.Quantity"
53  import="net.sf.basedb.core.Unit"
54  import="net.sf.basedb.core.query.Hql"
55  import="net.sf.basedb.core.query.Restrictions"
56  import="net.sf.basedb.core.query.Expressions"
57  import="net.sf.basedb.core.query.Orders"
58  import="net.sf.basedb.core.plugin.GuiContext"
59  import="net.sf.basedb.core.plugin.Plugin"
60  import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil"
61  import="net.sf.basedb.core.snapshot.AnnotationTypeFilter"
62  import="net.sf.basedb.core.snapshot.AnnotationSnapshot"
63  import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot"
64  import="net.sf.basedb.core.snapshot.SnapshotManager"
65  import="net.sf.basedb.util.Enumeration"
66  import="net.sf.basedb.util.ShareableUtil"
67  import="net.sf.basedb.util.formatter.Formatter"
68  import="net.sf.basedb.util.units.UnitUtil"
69  import="net.sf.basedb.clients.web.Base"
70  import="net.sf.basedb.clients.web.ModeInfo"
71  import="net.sf.basedb.clients.web.PermissionUtil"
72  import="net.sf.basedb.clients.web.util.HTML"
73  import="net.sf.basedb.util.Values"
74  import="net.sf.basedb.util.formatter.Formatter"
75  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
76  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
77  import="net.sf.basedb.clients.web.extensions.JspContext"
78  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
79  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
80  import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
81  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
82  import="java.util.Iterator"
83  import="java.util.List"
84  import="java.util.Map"
85  import="java.util.Date"
86  import="java.util.ArrayList"
87%>
88<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
89<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
90<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
91<%!
92  private static final Item itemType = Item.RAWBIOASSAY;
93  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
94%>
95<%
96final String root = request.getContextPath()+"/";
97final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
98final String ID = sc.getId();
99final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
100final boolean readPermission = sc.hasPermission(Permission.READ, itemType);
101final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
102
103final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
104final String callback = request.getParameter("callback");
105final String title = mode.generateTitle("raw bioassay", "raw bioassays");
106final DbControl dc = sc.newDbControl();
107ItemResultIterator<RawBioAssay> rawBioAssays = null;
108List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>();
109try
110{
111  ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
112  SnapshotManager manager = new SnapshotManager();
113  for (AnnotationType at : annotationTypeQuery.list(dc))
114  {
115    annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at));
116  }
117  annotationTypeQuery = Base.getInheritedAnnotationColumns(cc.getSetting("columns"));
118  for (AnnotationType at : annotationTypeQuery.list(dc))
119  {
120    annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at, false, true));
121  }
122
123  // Query for experiments relatated to the current raw bioassay
124  final ItemQuery<Experiment> experimentQuery = Experiment.getQuery();
125  experimentQuery.include(cc.getInclude());
126  experimentQuery.join(Hql.innerJoin("rawBioAssays", "rba"));
127  experimentQuery.restrict(Restrictions.eq(Hql.alias("rba"), Expressions.parameter("rawBioAssay")));
128  experimentQuery.order(Orders.asc(Hql.property("name"))); 
129 
130  // Get all platforms
131  final ItemQuery<Platform> platformQuery = Platform.getQuery();
132  platformQuery.include(cc.getInclude());
133  platformQuery.order(Orders.asc(Hql.property("name")));
134  platformQuery.setCacheResult(true);
135  Enumeration<String, String> platforms = new Enumeration<String, String>();
136  for (Platform p : platformQuery.list(dc))
137  {
138    platforms.add(Integer.toString(p.getId()), p.getName());
139  }
140 
141  Unit bytes = UnitUtil.getUnit(dc, Quantity.STORAGE_SIZE, "B");
142  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
143  try
144  {
145    final ItemQuery<RawBioAssay> query = Base.getConfiguredQuery(dc, cc, true, RawBioAssay.getQuery(), mode);
146    rawBioAssays = query.iterate(dc);
147  }
148  catch (Throwable t)
149  {
150    t.printStackTrace();
151    cc.setMessage(t.getMessage());
152  }
153  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
154  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
155  int numListed = 0;
156  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null);
157  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
158  ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext);
159  %>
160  <base:page title="<%=title==null ? "Raw bioassays" : title%>" type="<%=mode.getPageType()%>" id="list-page">
161  <base:head scripts="table.js,~bioassays.js" styles="table.css,toolbar.css">
162    <ext:scripts context="<%=jspContext%>" />
163    <ext:stylesheets context="<%=jspContext%>" />
164  </base:head>
165 
166  <base:body>
167    <h1><%=title==null ? "Raw bioassays" : title%></h1>
168    <div class="content">
169    <tbl:table 
170      id="rawbioassays" 
171      columns="<%=cc.getSetting("columns")%>"
172      sortby="<%=cc.getSortProperty()%>" 
173      direction="<%=cc.getSortDirection()%>"
174      action="index.jsp"
175      sc="<%=sc%>"
176      item="<%=itemType%>"
177      subclass="fulltable"
178      data-inherited-annotations="true"
179      >
180      <tbl:hidden 
181        name="mode" 
182        value="<%=mode.getName()%>" 
183      />
184      <tbl:hidden 
185        name="callback" 
186        value="<%=callback%>" 
187        skip="<%=callback == null%>" 
188      />
189      <tbl:columndef 
190        id="name"
191        property="name"
192        datatype="string"
193        title="Name"
194        sortable="true" 
195        filterable="true"
196        exportable="true"
197        show="always" 
198      />
199      <tbl:columndef 
200        id="id" 
201        clazz="uniquecol"
202        property="id"
203        datatype="int"
204        title="ID"
205        sortable="true"
206        filterable="true"
207        exportable="true"
208      />
209      <tbl:columndef 
210        id="entryDate"
211        property="entryDate"
212        datatype="date"
213        title="Registered"
214        sortable="true" 
215        filterable="true"
216        exportable="true"
217        formatter="<%=dateFormatter%>"
218      />
219      <tbl:columndef 
220        id="platform"
221        property="platform"
222        sortproperty="platform.name"
223        exportproperty="platform.name:string"
224        datatype="int"
225        enumeration="<%=platforms%>"
226        title="Platform"
227        sortable="true" 
228        filterable="true"
229        exportable="true"
230      /> 
231      <tbl:columndef 
232        id="variant"
233        property="variant.name"
234        datatype="string"
235        title="Variant"
236        sortable="true" 
237        filterable="true"
238        exportable="true"
239      />       
240      <%
241      Enumeration<String, String> rawEnumeration = new Enumeration<String, String>();
242      for (RawDataType rdt : RawDataTypes.getRawDataTypes())
243      {
244        rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName()));
245      }
246      rawEnumeration.sortValues();
247      %>
248      <tbl:columndef 
249        id="rawDataType"
250        property="rawDataType"
251        datatype="string"
252        enumeration="<%=rawEnumeration%>"
253        title="Raw data type"
254        sortable="true" 
255        filterable="true"
256        exportable="true"
257      />
258      <tbl:columndef 
259        id="hasData"
260        property="hasData"
261        datatype="boolean"
262        title="Has data"
263        sortable="true" 
264        filterable="true"
265        exportable="true"
266      />
267      <tbl:columndef 
268        id="spots"
269        property="spots"
270        datatype="int"
271        title="Db spots"
272        sortable="true" 
273        filterable="true"
274        exportable="true"
275      />
276      <tbl:columndef 
277        id="numFileSpots"
278        property="numFileSpots"
279        datatype="int"
280        title="File spots"
281        sortable="true" 
282        filterable="true"
283        exportable="true"
284      />     
285      <tbl:columndef 
286        id="bytes"
287        property="bytes"
288        datatype="long"
289        title="Bytes"
290        sortable="true" 
291        filterable="true"
292        exportable="true"
293        unit="<%=bytes%>"
294      />
295      <tbl:columndef 
296        id="parentBioAssay"
297        property="parentBioAssay.name"
298        datatype="string"
299        title="Parent bioassay"
300        sortable="true" 
301        filterable="true"
302        exportable="true"
303      />
304      <tbl:columndef 
305        id="parentExtract"
306        property="parentExtract.name"
307        datatype="string"
308        title="Parent extract"
309        sortable="true" 
310        filterable="true"
311        exportable="true"
312      />
313      <tbl:columndef 
314        id="software"
315        property="software.name"
316        datatype="string"
317        title="Software"
318        sortable="true" 
319        filterable="true"
320        exportable="true"
321      />
322      <tbl:columndef 
323        id="protocol"
324        property="protocol.name"
325        datatype="string"
326        title="Protocol"
327        sortable="true" 
328        filterable="true"
329        exportable="true"
330      />
331      <tbl:columndef 
332        id="arrayDesign"
333        property="arrayDesign.name"
334        datatype="string"
335        title="Array design"
336        sortable="true" 
337        filterable="true"
338        exportable="true"
339      />
340      <tbl:columndef 
341        id="plugin"
342        property="job.pluginDefinition.name"
343        datatype="string"
344        title="Plugin"
345        sortable="true"
346        filterable="true"
347        exportable="true"
348        tooltip="The plug-in that was used to import raw data"
349      />
350      <tbl:columndef 
351        id="configuration"
352        property="job.pluginConfiguration.name"
353        datatype="string"
354        title="Configuration"
355        sortable="true"
356        filterable="true"
357        exportable="true" 
358        tooltip="The configuration/file format that was used to import raw data"
359      />
360      <tbl:columndef 
361        id="importdate"
362        property="job.ended"
363        datatype="date"
364        title="Import date"
365        sortable="true"
366        filterable="true"
367        exportable="true" 
368        tooltip="The date and time of the raw data import"
369        formatter="<%=dateTimeFormatter%>"
370      />
371      <tbl:columndef
372        id="experiments"
373        title="Experiments"
374        property="&experiments(name)"
375        datatype="string"
376        filterable="true"
377        exportable="true"
378      />
379      <tbl:columndef
380        id="files"
381        title="Files"
382        property="&fileSet.members(file.name)"
383        datatype="string"
384        filterable="true"
385        exportable="true"
386      />
387      <tbl:columndef 
388        id="owner"
389        property="owner.name"
390        datatype="string"
391        title="Owner"
392        sortable="true" 
393        filterable="true"
394        exportable="true"
395      />
396      <tbl:columndef 
397        id="description"
398        property="description"
399        datatype="string"
400        title="Description" 
401        sortable="true" 
402        filterable="true" 
403        exportable="true"
404      />
405      <%
406      for (AnnotationLoaderUtil loader : annotationLoaders)
407      {
408        AnnotationType at = loader.getAnnotationType();
409        Enumeration<String, String> annotationEnum = null;
410        if (at.isEnumeration())
411        {
412          annotationEnum = new Enumeration<String, String>();
413          List<?> values = at.getValues();
414          for (Object value : values)
415          {
416            String encoded = HTML.encodeTags(value.toString());
417            annotationEnum.add(encoded, encoded);
418          }
419        }
420        %>
421        <tbl:columndef 
422          id="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+at.getId()%>"
423          title="<%=HTML.encodeTags(at.getName())+(loader.isSearchingInheritedAnnotations() ? " [I]" : " [A]")%>" 
424          property="<%=(loader.isSearchingInheritedAnnotations() ? "##" : "#")+at.getId()%>"
425          annotation="true"
426          datatype="<%=at.getValueType().getStringValue()%>"
427          enumeration="<%=annotationEnum%>"
428          smartenum="<%=at.getDisplayAsList() %>"
429          sortable="<%=at.getMultiplicity() == 1 && !loader.isSearchingInheritedAnnotations()%>" 
430          filterable="true" 
431          exportable="true"
432          unit="<%=at.getDefaultUnit()%>"
433        />
434        <%
435      }
436      %>
437      <tbl:columndef
438        id="permission"
439        title="Permission"
440      />
441      <tbl:columndef
442        id="sharedTo"
443        title="Shared to"
444        filterable="true"
445        filterproperty="!sharedTo.name"
446        datatype="string"
447      />
448      <tbl:columndef 
449        id="xt-columns" 
450        extensions="<%=columnsInvoker%>" 
451        jspcontext="<%=jspContext%>" 
452      />
453      <div class="panelgroup bg-filled-50 bottomborder">
454        <tbl:toolbar
455          subclass="bottomborder"
456          visible="<%=mode.hasToolbar()%>"
457          >
458          <tbl:button 
459            id="btnNewItem"
460            disabled="<%=!createPermission%>" 
461            image="new.png" 
462            title="New&hellip;" 
463            tooltip="<%=createPermission ? "Create new raw bioassay" : "You do not have permission to create raw bioassays"%>" 
464          />
465          <tbl:button 
466            id="btnDeleteItems"
467            image="delete.png"
468            title="Delete" 
469            tooltip="Delete the selected items" 
470          />
471          <tbl:button 
472            id="btnRestoreItems"
473            image="restore.png"
474            title="Restore" 
475            tooltip="Restore the selected (deleted) items"
476          />
477          <tbl:button 
478            id="btnShareItems"
479            image="share.png"
480            title="Share&hellip;" 
481            tooltip="Share the selected items"
482          />
483          <tbl:button 
484            id="btnSetOwner"
485            image="take_ownership.png"
486            title="Set owner&hellip;"
487            tooltip="Change owner of the selected items"
488          />
489          <tbl:button 
490            id="btnColumns"
491            image="columns.png" 
492            title="Columns&hellip;" 
493            tooltip="Show, hide and re-order columns" 
494          />
495          <tbl:button
496            id="btnNewExperiment"
497            image="add.png"
498            title="New experiment&hellip;"
499            tooltip="Create a new experiment from the selected raw bioassays"
500            visible="<%=sc.hasPermission(Permission.CREATE, Item.EXPERIMENT)%>"
501          />
502          <tbl:button 
503            id="btnImport"
504            data-plugin-type="IMPORT"
505            image="import.png" 
506            title="Import&hellip;" 
507            tooltip="Import data" 
508            visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
509          />
510          <tbl:button 
511            id="btnExport"
512            data-plugin-type="EXPORT"
513            image="export.png" 
514            title="Export&hellip;" 
515            tooltip="Export data" 
516            visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
517          />
518          <tbl:button 
519            id="btnRunPlugin"
520            data-plugin-type="OTHER"
521            image="runplugin.png" 
522            title="Run plugin&hellip;" 
523            tooltip="Run a plugin" 
524            visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
525          />
526          <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
527            wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
528        </tbl:toolbar>
529        <tbl:panel>
530          <tbl:presetselector />
531          <tbl:navigator
532            page="<%=cc.getPage()%>" 
533            rowsperpage="<%=cc.getRowsPerPage()%>" 
534            totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
535            visible="<%=mode.hasNavigator()%>"
536          />
537        </tbl:panel>
538      </div>
539      <tbl:data>
540        <tbl:headers>
541          <tbl:headerrow>
542            <tbl:header colspan="3" />
543            <tbl:columnheaders />
544          </tbl:headerrow>
545          <tbl:headerrow>
546            <tbl:header subclass="index" />
547            <tbl:header 
548              subclass="check" 
549              visible="<%=mode.hasCheck()%>"
550              ><base:icon 
551                id="check.uncheck"
552                image="check_uncheck.png" 
553                tooltip="Check/uncheck all" 
554                 
555              /></tbl:header>
556            <tbl:header 
557              subclass="check" 
558              visible="<%=mode.hasRadio()%>"
559              />
560            <tbl:header 
561              subclass="icons" 
562              visible="<%=mode.hasIcons()%>"
563              />
564            <tbl:propertyfilter />
565          </tbl:headerrow>
566        </tbl:headers>
567        <tbl:rows>
568          <%
569          if (cc.getMessage() != null)
570          {
571            %>
572            <tbl:panel subclass="bg-filled-50">
573              <div class="messagecontainer error"><%=cc.getMessage()%></div>
574            </tbl:panel>
575            <%
576            cc.setMessage(null);
577          }
578          int index = cc.getPage()*cc.getRowsPerPage();
579          int selectedItemId = cc.getId();
580          if (rawBioAssays != null)
581          {           
582            while (rawBioAssays.hasNext())
583            {
584              RawBioAssay item = rawBioAssays.next();
585              Job job = null;
586              try
587              {
588                job = item.getJob();
589              }
590              catch (Throwable t)
591              {}
592              int itemId = item.getId();
593             
594             
595              boolean deletePermission = item.hasPermission(Permission.DELETE);
596              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
597              boolean writePermission = item.hasPermission(Permission.WRITE);
598              String tooltip = mode.isSelectionMode() ? 
599                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
600              String name = HTML.encodeTags(item.getName());
601              index++;
602              numListed++;
603              %>
604              <tbl:row>
605                <tbl:header 
606                  clazz="index"
607                  ><%=index%></tbl:header>
608                <tbl:header 
609                  clazz="check" 
610                  visible="<%=mode.hasCheck()%>"
611                  ><input 
612                    type="checkbox" 
613                    name="<%=itemId%>" 
614                    value="<%=itemId%>" 
615                    title="<%=name%>" 
616                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
617                  ></tbl:header>
618                <tbl:header 
619                  clazz="check" 
620                  visible="<%=mode.hasRadio()%>"
621                  ><input 
622                    type="radio" 
623                    name="item_id" 
624                    value="<%=itemId%>" 
625                    title="<%=name%>" 
626                    <%=selectedItemId == itemId ? "checked" : ""%>
627                  ></tbl:header>
628                <tbl:header 
629                  clazz="icons" 
630                  visible="<%=mode.hasIcons()%>"
631                  ><base:icon 
632                    image="deleted.png"
633                    id="<%="delete."+itemId %>"
634                    subclass="<%=deletePermission ? "table-delete-item" : null %>"
635                    data-item-id="<%=itemId%>"
636                    tooltip="This item has been scheduled for deletion" 
637                    visible="<%=item.isRemoved()%>"
638                  /><base:icon 
639                    image="shared.png" 
640                    id="<%="share."+itemId %>"
641                    subclass="<%=sharePermission ? "table-share-item" : null %>"
642                    data-item-id="<%=itemId%>"
643                    tooltip="This item is shared to other users, groups and/or projects" 
644                    visible="<%=item.isShared()%>"
645                  />&nbsp;</tbl:header>
646                <tbl:cell column="name"><div 
647                  class="link table-item"
648                  data-item-id="<%=itemId%>"
649                  data-no-edit="<%=writePermission ? 0 : 1 %>" 
650                  tabindex="0"
651                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
652                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
653                <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" />
654                <tbl:cell column="spots"><%=item.getNumDbSpots()%></tbl:cell>
655                <tbl:cell column="numFileSpots"><%=item.getNumFileSpots()%></tbl:cell>
656                <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell>
657                <tbl:cell column="platform"
658                  ><base:propertyvalue 
659                    item="<%=item%>" 
660                    property="platform"
661                    enableEditLink="<%=mode.hasEditLink()%>" 
662                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
663                  /></tbl:cell>
664                <tbl:cell column="variant"
665                  ><base:propertyvalue 
666                    item="<%=item%>" 
667                    property="variant"
668                    enableEditLink="<%=mode.hasEditLink()%>" 
669                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
670                  /></tbl:cell>               
671                <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell>
672                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
673                <tbl:cell column="parentBioAssay"
674                  ><base:propertyvalue 
675                    item="<%=item%>" 
676                    property="parentBioAssay"
677                    enableEditLink="<%=mode.hasEditLink()%>" 
678                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
679                  /></tbl:cell>
680                <tbl:cell column="parentExtract"
681                  ><base:propertyvalue 
682                    item="<%=item%>" 
683                    property="parentExtract"
684                    enableEditLink="<%=mode.hasEditLink()%>" 
685                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
686                  /></tbl:cell>
687                <tbl:cell column="software"
688                  ><base:propertyvalue 
689                    item="<%=item%>" 
690                    property="software"
691                    enableEditLink="<%=mode.hasEditLink()%>" 
692                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
693                  /></tbl:cell>
694                <tbl:cell column="protocol"
695                  ><base:propertyvalue 
696                    item="<%=item%>" 
697                    property="protocol"
698                    enableEditLink="<%=mode.hasEditLink()%>" 
699                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
700                  /></tbl:cell>
701                <tbl:cell column="arrayDesign"
702                  ><base:propertyvalue 
703                    item="<%=item%>" 
704                    property="arrayDesign"
705                    enableEditLink="<%=mode.hasEditLink()%>" 
706                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
707                  /></tbl:cell>
708                <tbl:cell column="plugin">
709                  <base:propertyvalue 
710                    item="<%=item%>"
711                    property="job.pluginDefinition" 
712                    enableEditLink="<%=mode.hasEditLink()%>" 
713                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
714                    />
715                </tbl:cell>
716                <tbl:cell column="configuration">
717                  <base:propertyvalue 
718                    item="<%=item%>"
719                    property="job.pluginConfiguration" 
720                    enableEditLink="<%=mode.hasEditLink()%>" 
721                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
722                  />
723                </tbl:cell>
724                <tbl:cell 
725                  column="importdate" 
726                  value="<%=job == null ? null : job.getEnded() %>" 
727                />
728                <tbl:cell column="files">
729                  <% 
730                  if (item.hasFileSet())
731                  {
732                    for (FileSetMember member : item.getFileSet().getMembers().list(dc))
733                    {
734                      try
735                      {
736                        %>
737                        <%=Base.getLinkedFile(ID, member.getFile(), false, true, true, root) %><br>
738                        <%
739                      }
740                      catch (PermissionDeniedException ex)
741                      {}
742                    }
743                  }
744                  else
745                  {
746                    %>
747                    <i>- none -</i>
748                    <%
749                  }
750                  %>
751                </tbl:cell>
752                <tbl:cell column="experiments">
753                  <%
754                  experimentQuery.setParameter("rawBioAssay", itemId, Type.INT);
755                  try
756                  {
757                    String separator = "";
758                    for (Experiment e : experimentQuery.list(dc))
759                    {
760                      out.write(separator);
761                      if (mode.hasPropertyLink())
762                      {
763                        out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));
764                      }
765                      else
766                      {
767                        out.write(HTML.encodeTags(e.getName()));
768                      }
769                      separator = ", ";
770                    }
771                  }
772                  catch (Throwable t)
773                  {
774                    %>
775                    <div class="error"><%=t.getMessage()%></div>
776                    <%
777                  }
778                  %>
779                </tbl:cell>
780                <tbl:cell column="owner"
781                  ><base:propertyvalue 
782                    item="<%=item%>" 
783                    property="owner"
784                    enableEditLink="<%=mode.hasEditLink()%>" 
785                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
786                  /></tbl:cell>
787                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
788                <%
789                if (item.isAnnotated())
790                {
791                  AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId());
792                  for (AnnotationLoaderUtil loader : annotationLoaders)
793                  {
794                    if (loader.find(snapshot))
795                    {
796                      %>
797                      <tbl:cell 
798                        column="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+loader.getId()%>"
799                        ><tbl:cellvalue 
800                          list="<%=loader.getValues()%>"
801                          suffix="<%=loader.getUnitSymbol()%>"
802                      /></tbl:cell>
803                      <%
804                    }
805                  }
806                }
807                %>
808                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
809                <tbl:cell column="sharedTo">
810                  <%
811                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
812                  while(sharees.hasNext())
813                  {
814                    Nameable n = sharees.next();
815                    if (mode.hasPropertyLink())
816                    {
817                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
818                    }
819                    else
820                    {
821                      out.write(HTML.encodeTags(n.getName()));
822                    }
823                    out.write(sharees.hasNext() ? ", " : "");
824                  }
825                  %>
826                </tbl:cell>
827                <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
828                  <tbl:cell column="xt-columns" />
829                </tbl:xt-cells>
830              </tbl:row>
831              <%
832              }
833            }
834          if (numListed == 0)
835          {
836            %>
837            <tbl:panel subclass="bg-filled-50">
838              <div class="messagecontainer note">
839              <%=rawBioAssays == null || rawBioAssays.getTotalCount() == 0 ? "No raw bioassays were found" : "No raw bioassays on this page. Please select another page!" %>
840              </div>
841            </tbl:panel>
842            <%
843          }
844          %>
845        </tbl:rows>
846      </tbl:data>
847    </tbl:table>
848    </div>
849   
850    <base:buttongroup subclass="dialogbuttons">
851      <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
852      <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
853      <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
854    </base:buttongroup>
855   
856  </base:body>
857  </base:page>
858  <%
859}
860finally
861{
862  if (rawBioAssays != null) rawBioAssays.close();
863  if (dc != null) dc.close();
864}
865%>
Note: See TracBrowser for help on using the repository browser.