source: branches/3.18-stable/www/views/rawbioassays/list_rawbioassays.jsp @ 7957

Last change on this file since 7957 was 7957, checked in by Nicklas Nordborg, 22 months ago

References #2253: Configure sticky column

It should now be possible to select a sticky column in the "Configure columns" dialog. The setting is stored in the current ItemContext under the key columns.sticky.

So far, only the raw bioassays list page has been update to use the new setting.

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