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

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

References #1908: Batch inheriting multiple annotations

Added InheritAnnotationsManager, InheritSpecification and a few other changes.

A test case has been implemented from the raw bioassays lists page which allows the user to select one or more annotation types to inherit to the selected raw bioassays. It is possible to select if existing inherited annotations should be removed or if new annotations should be inherited. For each annotation type is possible to select the parent type to inherit from (to avoid duplicate inheritance).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 26.6 KB
Line 
1<%-- $Id: list_rawbioassays.jsp 6694 2015-01-26 14:41:25Z 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        Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
410        Enumeration<String, String> annotationEnum = null;
411        if (at.isEnumeration())
412        {
413          annotationEnum = new Enumeration<String, String>();
414          List<?> values = at.getValues();
415          for (Object value : values)
416          {
417            String encoded = HTML.encodeTags(value.toString());
418            annotationEnum.add(encoded, encoded);
419          }
420        }
421        %>
422        <tbl:columndef 
423          id="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+at.getId()%>"
424          title="<%=HTML.encodeTags(at.getName())+(loader.isSearchingInheritedAnnotations() ? " [I]" : " [A]")%>" 
425          property="<%=(loader.isSearchingInheritedAnnotations() ? "##" : "#")+at.getId()%>"
426          annotation="true"
427          datatype="<%=at.getValueType().getStringValue()%>"
428          enumeration="<%=annotationEnum%>"
429          smartenum="<%=at.getDisplayAsList() %>"
430          sortable="<%=at.getMultiplicity() == 1 && !loader.isSearchingInheritedAnnotations()%>" 
431          filterable="true" 
432          exportable="true"
433          formatter="<%=formatter%>"
434          unit="<%=at.getDefaultUnit()%>"
435        />
436        <%
437      }
438      %>
439      <tbl:columndef
440        id="permission"
441        title="Permission"
442      />
443      <tbl:columndef
444        id="sharedTo"
445        title="Shared to"
446        filterable="true"
447        filterproperty="!sharedTo.name"
448        datatype="string"
449      />
450      <tbl:columndef 
451        id="xt-columns" 
452        extensions="<%=columnsInvoker%>" 
453        jspcontext="<%=jspContext%>" 
454      />
455      <div class="panelgroup bg-filled-50 bottomborder">
456        <tbl:toolbar
457          subclass="bottomborder"
458          visible="<%=mode.hasToolbar()%>"
459          >
460          <tbl:button 
461            id="btnNewItem"
462            disabled="<%=!createPermission%>" 
463            image="new.png" 
464            title="New&hellip;" 
465            tooltip="<%=createPermission ? "Create new raw bioassay" : "You do not have permission to create raw bioassays"%>" 
466          />
467          <tbl:button 
468            id="btnDeleteItems"
469            image="delete.png"
470            title="Delete" 
471            tooltip="Delete the selected items" 
472          />
473          <tbl:button 
474            id="btnRestoreItems"
475            image="restore.png"
476            title="Restore" 
477            tooltip="Restore the selected (deleted) items"
478          />
479          <tbl:button 
480            id="btnShareItems"
481            image="share.png"
482            title="Share&hellip;" 
483            tooltip="Share the selected items"
484          />
485          <tbl:button 
486            id="btnSetOwner"
487            image="take_ownership.png"
488            title="Set owner&hellip;"
489            tooltip="Change owner of the selected items"
490          />
491          <tbl:button 
492            id="btnColumns"
493            image="columns.png" 
494            title="Columns&hellip;" 
495            tooltip="Show, hide and re-order columns" 
496          />
497          <tbl:button
498            id="btnNewExperiment"
499            image="add.png"
500            title="New experiment&hellip;"
501            tooltip="Create a new experiment from the selected raw bioassays"
502            visible="<%=sc.hasPermission(Permission.CREATE, Item.EXPERIMENT)%>"
503          />
504          <tbl:button
505            id="btnInheritAnnotations"
506            image="inherit.png"
507            title="Inherit annotations&hellip;"
508            tooltip="Batch inherit annotations from parent items"
509          />
510          <tbl:button 
511            id="btnImport"
512            data-plugin-type="IMPORT"
513            image="import.png" 
514            title="Import&hellip;" 
515            tooltip="Import data" 
516            visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
517          />
518          <tbl:button 
519            id="btnExport"
520            data-plugin-type="EXPORT"
521            image="export.png" 
522            title="Export&hellip;" 
523            tooltip="Export data" 
524            visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
525          />
526          <tbl:button 
527            id="btnRunPlugin"
528            data-plugin-type="OTHER"
529            image="runplugin.png" 
530            title="Run plugin&hellip;" 
531            tooltip="Run a plugin" 
532            visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
533          />
534          <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
535            wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
536        </tbl:toolbar>
537        <tbl:panel>
538          <tbl:presetselector />
539          <tbl:navigator
540            page="<%=cc.getPage()%>" 
541            rowsperpage="<%=cc.getRowsPerPage()%>" 
542            totalrows="<%=rawBioAssays == null ? 0 : rawBioAssays.getTotalCount()%>" 
543            visible="<%=mode.hasNavigator()%>"
544          />
545        </tbl:panel>
546      </div>
547      <tbl:data>
548        <tbl:headers>
549          <tbl:headerrow>
550            <tbl:header colspan="3" />
551            <tbl:columnheaders />
552          </tbl:headerrow>
553          <tbl:headerrow>
554            <tbl:header subclass="index" />
555            <tbl:header 
556              subclass="check" 
557              visible="<%=mode.hasCheck()%>"
558              ><base:icon 
559                id="check.uncheck"
560                image="check_uncheck.png" 
561                tooltip="Check/uncheck all" 
562                 
563              /></tbl:header>
564            <tbl:header 
565              subclass="check" 
566              visible="<%=mode.hasRadio()%>"
567              />
568            <tbl:header 
569              subclass="icons" 
570              visible="<%=mode.hasIcons()%>"
571              />
572            <tbl:propertyfilter />
573          </tbl:headerrow>
574        </tbl:headers>
575        <tbl:rows>
576          <%
577          if (cc.getMessage() != null)
578          {
579            %>
580            <tbl:panel subclass="bg-filled-50">
581              <div class="messagecontainer error"><%=cc.getMessage()%></div>
582            </tbl:panel>
583            <%
584            cc.setMessage(null);
585          }
586          int index = cc.getPage()*cc.getRowsPerPage();
587          int selectedItemId = cc.getId();
588          if (rawBioAssays != null)
589          {           
590            while (rawBioAssays.hasNext())
591            {
592              RawBioAssay item = rawBioAssays.next();
593              Job job = null;
594              try
595              {
596                job = item.getJob();
597              }
598              catch (Throwable t)
599              {}
600              int itemId = item.getId();
601             
602             
603              boolean deletePermission = item.hasPermission(Permission.DELETE);
604              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
605              boolean writePermission = item.hasPermission(Permission.WRITE);
606              String tooltip = mode.isSelectionMode() ? 
607                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
608              String name = HTML.encodeTags(item.getName());
609              index++;
610              numListed++;
611              %>
612              <tbl:row>
613                <tbl:header 
614                  clazz="index"
615                  ><%=index%></tbl:header>
616                <tbl:header 
617                  clazz="check" 
618                  visible="<%=mode.hasCheck()%>"
619                  ><input 
620                    type="checkbox" 
621                    name="<%=itemId%>" 
622                    value="<%=itemId%>" 
623                    title="<%=name%>" 
624                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
625                  ></tbl:header>
626                <tbl:header 
627                  clazz="check" 
628                  visible="<%=mode.hasRadio()%>"
629                  ><input 
630                    type="radio" 
631                    name="item_id" 
632                    value="<%=itemId%>" 
633                    title="<%=name%>" 
634                    <%=selectedItemId == itemId ? "checked" : ""%>
635                  ></tbl:header>
636                <tbl:header 
637                  clazz="icons" 
638                  visible="<%=mode.hasIcons()%>"
639                  ><base:icon 
640                    image="deleted.png"
641                    id="<%="delete."+itemId %>"
642                    subclass="<%=deletePermission ? "table-delete-item" : null %>"
643                    data-item-id="<%=itemId%>"
644                    tooltip="This item has been scheduled for deletion" 
645                    visible="<%=item.isRemoved()%>"
646                  /><base:icon 
647                    image="shared.png" 
648                    id="<%="share."+itemId %>"
649                    subclass="<%=sharePermission ? "table-share-item" : null %>"
650                    data-item-id="<%=itemId%>"
651                    tooltip="This item is shared to other users, groups and/or projects" 
652                    visible="<%=item.isShared()%>"
653                  />&nbsp;</tbl:header>
654                <tbl:cell column="name"><div 
655                  class="link table-item"
656                  data-item-id="<%=itemId%>"
657                  data-no-edit="<%=writePermission ? 0 : 1 %>" 
658                  tabindex="0"
659                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
660                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
661                <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" />
662                <tbl:cell column="spots"><%=item.getNumDbSpots()%></tbl:cell>
663                <tbl:cell column="numFileSpots"><%=item.getNumFileSpots()%></tbl:cell>
664                <tbl:cell column="bytes"><%=Values.formatBytes(item.getBytes())%></tbl:cell>
665                <tbl:cell column="platform"
666                  ><base:propertyvalue 
667                    item="<%=item%>" 
668                    property="platform"
669                    enableEditLink="<%=mode.hasEditLink()%>" 
670                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
671                  /></tbl:cell>
672                <tbl:cell column="variant"
673                  ><base:propertyvalue 
674                    item="<%=item%>" 
675                    property="variant"
676                    enableEditLink="<%=mode.hasEditLink()%>" 
677                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
678                  /></tbl:cell>               
679                <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell>
680                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
681                <tbl:cell column="parentBioAssay"
682                  ><base:propertyvalue 
683                    item="<%=item%>" 
684                    property="parentBioAssay"
685                    enableEditLink="<%=mode.hasEditLink()%>" 
686                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
687                  /></tbl:cell>
688                <tbl:cell column="parentExtract"
689                  ><base:propertyvalue 
690                    item="<%=item%>" 
691                    property="parentExtract"
692                    enableEditLink="<%=mode.hasEditLink()%>" 
693                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
694                  /></tbl:cell>
695                <tbl:cell column="software"
696                  ><base:propertyvalue 
697                    item="<%=item%>" 
698                    property="software"
699                    enableEditLink="<%=mode.hasEditLink()%>" 
700                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
701                  /></tbl:cell>
702                <tbl:cell column="protocol"
703                  ><base:propertyvalue 
704                    item="<%=item%>" 
705                    property="protocol"
706                    enableEditLink="<%=mode.hasEditLink()%>" 
707                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
708                  /></tbl:cell>
709                <tbl:cell column="arrayDesign"
710                  ><base:propertyvalue 
711                    item="<%=item%>" 
712                    property="arrayDesign"
713                    enableEditLink="<%=mode.hasEditLink()%>" 
714                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
715                  /></tbl:cell>
716                <tbl:cell column="plugin">
717                  <base:propertyvalue 
718                    item="<%=item%>"
719                    property="job.pluginDefinition" 
720                    enableEditLink="<%=mode.hasEditLink()%>" 
721                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
722                    />
723                </tbl:cell>
724                <tbl:cell column="configuration">
725                  <base:propertyvalue 
726                    item="<%=item%>"
727                    property="job.pluginConfiguration" 
728                    enableEditLink="<%=mode.hasEditLink()%>" 
729                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
730                  />
731                </tbl:cell>
732                <tbl:cell 
733                  column="importdate" 
734                  value="<%=job == null ? null : job.getEnded() %>" 
735                />
736                <tbl:cell column="files">
737                  <% 
738                  if (item.hasFileSet())
739                  {
740                    for (FileSetMember member : item.getFileSet().getMembers().list(dc))
741                    {
742                      try
743                      {
744                        %>
745                        <%=Base.getLinkedFile(ID, member.getFile(), false, true, true, root) %><br>
746                        <%
747                      }
748                      catch (PermissionDeniedException ex)
749                      {}
750                    }
751                  }
752                  else
753                  {
754                    %>
755                    <i>- none -</i>
756                    <%
757                  }
758                  %>
759                </tbl:cell>
760                <tbl:cell column="experiments">
761                  <%
762                  experimentQuery.setParameter("rawBioAssay", itemId, Type.INT);
763                  try
764                  {
765                    String separator = "";
766                    for (Experiment e : experimentQuery.list(dc))
767                    {
768                      out.write(separator);
769                      if (mode.hasPropertyLink())
770                      {
771                        out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));
772                      }
773                      else
774                      {
775                        out.write(HTML.encodeTags(e.getName()));
776                      }
777                      separator = ", ";
778                    }
779                  }
780                  catch (Throwable t)
781                  {
782                    %>
783                    <div class="error"><%=t.getMessage()%></div>
784                    <%
785                  }
786                  %>
787                </tbl:cell>
788                <tbl:cell column="owner"
789                  ><base:propertyvalue 
790                    item="<%=item%>" 
791                    property="owner"
792                    enableEditLink="<%=mode.hasEditLink()%>" 
793                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
794                  /></tbl:cell>
795                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
796                <%
797                if (item.isAnnotated())
798                {
799                  AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId());
800                  for (AnnotationLoaderUtil loader : annotationLoaders)
801                  {
802                    if (loader.find(snapshot))
803                    {
804                      %>
805                      <tbl:cell 
806                        column="<%=(loader.isSearchingInheritedAnnotations() ? "ia" : "at")+loader.getId()%>"
807                        ><tbl:cellvalue 
808                          list="<%=loader.getValues()%>"
809                          suffix="<%=loader.getUnitSymbol()%>"
810                      /></tbl:cell>
811                      <%
812                    }
813                  }
814                }
815                %>
816                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
817                <tbl:cell column="sharedTo">
818                  <%
819                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
820                  while(sharees.hasNext())
821                  {
822                    Nameable n = sharees.next();
823                    if (mode.hasPropertyLink())
824                    {
825                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
826                    }
827                    else
828                    {
829                      out.write(HTML.encodeTags(n.getName()));
830                    }
831                    out.write(sharees.hasNext() ? ", " : "");
832                  }
833                  %>
834                </tbl:cell>
835                <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
836                  <tbl:cell column="xt-columns" />
837                </tbl:xt-cells>
838              </tbl:row>
839              <%
840              }
841            }
842          if (numListed == 0)
843          {
844            %>
845            <tbl:panel subclass="bg-filled-50">
846              <div class="messagecontainer note">
847              <%=rawBioAssays == null || rawBioAssays.getTotalCount() == 0 ? "No raw bioassays were found" : "No raw bioassays on this page. Please select another page!" %>
848              </div>
849            </tbl:panel>
850            <%
851          }
852          %>
853        </tbl:rows>
854      </tbl:data>
855    </tbl:table>
856    </div>
857   
858    <base:buttongroup subclass="dialogbuttons">
859      <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
860      <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
861      <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
862    </base:buttongroup>
863   
864  </base:body>
865  </base:page>
866  <%
867}
868finally
869{
870  if (rawBioAssays != null) rawBioAssays.close();
871  if (dc != null) dc.close();
872}
873%>
Note: See TracBrowser for help on using the repository browser.