source: trunk/www/views/derivedbioassays/list_bioassays.jsp @ 6690

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

References #1906: Display inherited annotations in list views

Implemented this for samples, extracts physical bioassays, derived bioassays and array (slide/batch/desing) list views

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