source: trunk/www/views/hybridizations/list_hybridizations.jsp @ 4135

Last change on this file since 4135 was 4135, checked in by Nicklas Nordborg, 15 years ago

Fixes #868: Support for chips with multiple arrays

Found an incompatibility issue in the web client

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 22.3 KB
Line 
1<%-- $Id: list_hybridizations.jsp 4135 2008-02-08 14:03:25Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson
4  Copyright (C) 2007 Johan Enell, Martin Svensson
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 2
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330,
22  Boston, MA  02111-1307, USA.
23  ------------------------------------------------------------------
24
25  @author Nicklas
26  @version 2.0
27--%>
28<%@ page session="false"
29  import="net.sf.basedb.core.SessionControl"
30  import="net.sf.basedb.core.DbControl"
31  import="net.sf.basedb.core.Item"
32  import="net.sf.basedb.core.Hybridization"
33  import="net.sf.basedb.core.LabeledExtract"
34  import="net.sf.basedb.core.Label"
35  import="net.sf.basedb.core.Scan"
36  import="net.sf.basedb.core.BioMaterialEvent"
37  import="net.sf.basedb.core.AnnotationType"
38  import="net.sf.basedb.core.AnnotationSet"
39  import="net.sf.basedb.core.ItemQuery"
40  import="net.sf.basedb.core.Include"
41  import="net.sf.basedb.core.Type"
42  import="net.sf.basedb.core.ItemResultIterator"
43  import="net.sf.basedb.core.ItemResultList"
44  import="net.sf.basedb.core.ItemContext"
45  import="net.sf.basedb.core.Nameable"
46  import="net.sf.basedb.core.Permission"
47  import="net.sf.basedb.core.PermissionDeniedException"
48  import="net.sf.basedb.core.PluginDefinition"
49  import="net.sf.basedb.core.query.Hql"
50  import="net.sf.basedb.core.query.Restrictions"
51  import="net.sf.basedb.core.query.Expressions"
52  import="net.sf.basedb.core.query.Orders"
53  import="net.sf.basedb.core.query.Hql"
54  import="net.sf.basedb.core.plugin.GuiContext"
55  import="net.sf.basedb.core.plugin.Plugin"
56  import="net.sf.basedb.util.Enumeration"
57  import="net.sf.basedb.util.ShareableUtil"
58  import="net.sf.basedb.clients.web.Base"
59  import="net.sf.basedb.clients.web.ModeInfo"
60  import="net.sf.basedb.clients.web.PermissionUtil"
61  import="net.sf.basedb.clients.web.util.HTML"
62  import="net.sf.basedb.util.formatter.Formatter"
63  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
64  import="net.sf.basedb.util.Values"
65  import="java.util.Iterator"
66  import="java.util.List"
67  import="java.util.Map"
68  import="java.util.Date"
69%>
70<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
71<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
72<%!
73  private static final Item itemType = Item.HYBRIDIZATION;
74  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
75%>
76<%
77final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
78final String ID = sc.getId();
79final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
80final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
81
82final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
83final String callback = request.getParameter("callback");
84final String title = mode.generateTitle("hybridization", "hybridizations");
85final DbControl dc = sc.newDbControl();
86ItemResultIterator<Hybridization> hybridizations = null;
87ItemResultList<AnnotationType> annotationTypes = null;
88try
89{
90  final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
91
92  // Query for labeled extracts relatated to the current hybridization
93  final ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();
94  labeledExtractQuery.include(cc.getInclude());
95  labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
96  labeledExtractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
97  labeledExtractQuery.restrict(Restrictions.eq(Hql.property("evt", "hybridization"), Expressions.parameter("hybridization"))); 
98  labeledExtractQuery.order(Orders.asc(Hql.property("name"))); 
99
100  // Query for scans relatated to the current hybridization
101  final ItemQuery<Scan> scanQuery = Scan.getQuery();
102  scanQuery.include(cc.getInclude());
103  scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter("hybridization")));
104  scanQuery.order(Orders.asc(Hql.property("name"))); 
105  final boolean createScanPermission = sc.hasPermission(Permission.CREATE, Item.SCAN); 
106 
107  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
108  annotationTypes = annotationTypeQuery.list(dc);
109  try
110  {
111    final ItemQuery<Hybridization> query = Base.getConfiguredQuery(cc, true, Hybridization.getQuery(), mode);
112    hybridizations = query.iterate(dc);
113  }
114  catch (Throwable t)
115  {
116    cc.setMessage(t.getMessage());
117  }
118  int numListed = 0;
119  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
120  %>
121  <base:page title="<%=title==null ? "Hybridizations" : title%>" type="<%=mode.getPageType()%>">
122  <base:head scripts="menu.js,table.js" styles="menu.css,table.css">
123    <script language="JavaScript">
124    var submitPage = 'index.jsp';
125    var formId = 'hybridizations';
126    function newItem()
127    {
128      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);
129    }
130    function editItem(itemId)
131    {
132      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);
133    }
134    function viewItem(itemId)
135    {
136      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);
137    }
138    function itemOnClick(evt, itemId)
139    {
140      Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);
141    }
142    function deleteItems()
143    {
144      var frm = document.forms[formId];
145      if (Forms.numChecked(frm) == 0)
146      {
147        alert('Please select at least one item in the list');
148        return;
149      }
150      frm.action = submitPage;
151      frm.cmd.value = 'DeleteItems';
152      frm.submit();
153    }
154    function restoreItems()
155    {
156      var frm = document.forms[formId];
157      if (Forms.numChecked(frm) == 0)
158      {
159        alert('Please select at least one item in the list');
160        return;
161      }
162      frm.action = submitPage;
163      frm.cmd.value = 'RestoreItems';
164      frm.submit();
165    }
166    function deleteItemPermanently(itemId)
167    {
168      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
169    }
170    function takeOwnership()
171    {
172      var frm = document.forms[formId];
173      if (Forms.numChecked(frm) == 0)
174      {
175        alert('Please select at least one item in the list');
176        return;
177      }
178      if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.'))
179      {
180        frm.action = submitPage;
181        frm.cmd.value = 'TakeOwnershipOfItems';
182        frm.submit();
183      }
184    }
185    function shareItem(itemId)
186    {
187      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id='+itemId, 'ShareHybridizations', 600, 400);
188    }
189    function shareItems()
190    {
191      Table.shareItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'ShareItems');
192    }
193    function configureColumns()
194    {
195      Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
196    }
197    function runPlugin(cmd)
198    {
199      Table.submitToPopup(formId, cmd, 740, 540);
200    }
201    function returnSelected()
202    {
203      Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);
204      window.close();
205    }
206    function presetOnChange()
207    {
208      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
209    }
210    function newScan(hybridizationId)
211    {
212      Main.viewOrEditItem('<%=ID%>', 'SCAN', 0, true, '&hybridization_id='+hybridizationId);
213    }
214    </script>
215  </base:head>
216 
217  <base:body>
218    <%
219    if (cc.getMessage() != null)
220    {
221      %>
222      <div class="error"><%=cc.getMessage()%></div>
223      <%
224      cc.setMessage(null);
225    }
226    %>
227    <tbl:table 
228      id="hybridizations" 
229      clazz="itemlist" 
230      columns="<%=cc.getSetting("columns")%>"
231      sortby="<%=cc.getSortProperty()%>" 
232      direction="<%=cc.getSortDirection()%>"
233      title="<%=title%>"
234      action="index.jsp"
235      sc="<%=sc%>"
236      item="<%=itemType%>"
237      >
238      <tbl:hidden 
239        name="mode" 
240        value="<%=mode.getName()%>" 
241      />
242      <tbl:hidden 
243        name="callback" 
244        value="<%=callback%>" 
245        skip="<%=callback == null%>" 
246      />
247      <tbl:columndef 
248        id="name"
249        property="name"
250        datatype="string"
251        title="Name"
252        sortable="true" 
253        filterable="true"
254        exportable="true"
255        show="always" 
256      />
257      <tbl:columndef 
258        id="numArrays"
259        property="numArrays"
260        datatype="int"
261        title="Arrays/slide"
262        sortable="true" 
263        filterable="true"
264        exportable="true"
265      />
266      <tbl:columndef
267        id="labeledExtracts"
268        title="Labeled extracts"
269      />
270      <tbl:columndef 
271        id="arraySlide"
272        property="arraySlide.name"
273        datatype="string"
274        title="Array slide"
275        sortable="true" 
276        filterable="true"
277        exportable="true"
278      />
279      <tbl:columndef
280        id="scans"
281        title="Scans"
282      />
283      <tbl:columndef 
284        id="protocol"
285        property="creationEvent.protocol"
286        sortproperty="creationEvent.protocol.name"
287        filterproperty="creationEvent.protocol.name"
288        exportproperty="creationEvent.protocol.name"
289        datatype="string"
290        title="Protocol"
291        sortable="true" 
292        filterable="true"
293        exportable="true"
294      />
295      <tbl:columndef
296        id="hybStation"
297        property="creationEvent.hardware"
298        datatype="string"
299        title="Hardware"
300        sortable="true"
301        filterable="true"
302        exportable="true"
303      />
304      <tbl:columndef 
305        id="eventDate"
306        property="creationEvent.eventDate"
307        datatype="date"
308        title="Created"
309        sortable="true" 
310        filterable="true"
311        exportable="true"
312        formatter="<%=dateFormatter%>"
313      />
314      <tbl:columndef 
315        id="entryDate"
316        property="creationEvent.entryDate"
317        datatype="date"
318        title="Registered"
319        sortable="true" 
320        filterable="true"
321        exportable="true"
322        formatter="<%=dateFormatter%>"
323      />
324      <tbl:columndef 
325        id="owner"
326        property="owner.name"
327        datatype="string"
328        title="Owner"
329        sortable="true" 
330        filterable="true"
331        exportable="true"
332      />
333      <tbl:columndef 
334        id="description"
335        property="description"
336        datatype="string"
337        title="Description" 
338        sortable="true" 
339        filterable="true" 
340        exportable="true"
341      />
342      <%
343      for (AnnotationType at : annotationTypes)
344      {
345        Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
346        Enumeration<String, String> annotationEnum = null;
347        if (at.isEnumeration())
348        {
349          annotationEnum = new Enumeration<String, String>();
350          List<?> values = at.getValues();
351          for (Object value : values)
352          {
353            String encoded = formatter.format(value);
354            annotationEnum.add(encoded, encoded);
355          }
356        }
357        %>
358        <tbl:columndef 
359          id="<%="at"+at.getId()%>"
360          title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
361          property="<%="#"+at.getId()%>"
362          annotation="true"
363          datatype="<%=at.getValueType().getStringValue()%>"
364          enumeration="<%=annotationEnum%>"
365          sortable="false" 
366          filterable="true" 
367          exportable="true"
368          formatter="<%=formatter%>"
369        />
370        <%
371      }
372      %>
373      <tbl:columndef
374        id="permission"
375        title="Permission"
376      />
377      <tbl:columndef 
378        id="sharedTo"
379        title="Shared to"
380      />
381      <tbl:toolbar
382        visible="<%=mode.hasToolbar()%>"
383        >
384        <tbl:button 
385          disabled="<%=createPermission ? false : true%>" 
386          image="<%=createPermission ? "new.gif" : "new_disabled.gif"%>" 
387          onclick="newItem()" 
388          title="New&hellip;" 
389          tooltip="<%=createPermission ? "Create new hybridization" : "You do not have permission to create hybridizations"%>" 
390        />
391        <tbl:button 
392          image="delete.gif"
393          onclick="deleteItems()" 
394          title="Delete" 
395          tooltip="Delete the selected items" 
396        />
397        <tbl:button 
398          image="restore.gif"
399          onclick="restoreItems()" 
400          title="Restore" 
401          tooltip="Restore the selected (deleted) items"
402        />
403        <tbl:button 
404          image="share.gif"
405          onclick="shareItems()" 
406          title="Share&hellip;" 
407          tooltip="Share the selected items"
408        />
409        <tbl:button 
410          image="take_ownership.png"
411          onclick="takeOwnership()" 
412          title="Take ownership&hellip;"
413          tooltip="Take ownership of the selected items"
414        />
415        <tbl:button 
416          image="columns.gif" 
417          onclick="configureColumns()" 
418          title="Columns&hellip;" 
419          tooltip="Show, hide and re-order columns" 
420        />
421        <tbl:button 
422          image="import.gif" 
423          onclick="runPlugin('ImportItems')" 
424          title="Import&hellip;" 
425          tooltip="Import data" 
426          visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
427        />
428        <tbl:button 
429          image="export.gif" 
430          onclick="runPlugin('ExportItems')" 
431          title="Export&hellip;" 
432          tooltip="Export data" 
433          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
434        />
435        <tbl:button 
436          image="runplugin.gif" 
437          onclick="runPlugin('RunListPlugin')" 
438          title="Run plugin&hellip;" 
439          tooltip="Run a plugin" 
440          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
441        />
442      </tbl:toolbar>
443      <tbl:navigator
444        page="<%=cc.getPage()%>" 
445        rowsperpage="<%=cc.getRowsPerPage()%>" 
446        totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>" 
447        visible="<%=mode.hasNavigator()%>"
448      />
449      <tbl:data>
450        <tbl:columns>
451        <tbl:presetselector 
452          clazz="columnheader"
453          colspan="3"
454          onchange="presetOnChange()"
455        />
456        </tbl:columns>
457
458        <tr>
459          <tbl:header 
460            clazz="index"
461            >&nbsp;</tbl:header>
462          <tbl:header 
463            clazz="check" 
464            visible="<%=mode.hasCheck()%>"
465            ><base:icon 
466              image="check_uncheck.gif" 
467              tooltip="Check/uncheck all" 
468              onclick="Forms.checkUncheck(document.forms[formId])" style="align: left;"
469            /></tbl:header>
470          <tbl:header 
471            clazz="check" 
472            visible="<%=mode.hasRadio()%>"
473            >&nbsp;</tbl:header>
474          <tbl:header 
475            clazz="icons" 
476            visible="<%=mode.hasIcons()%>"
477            >&nbsp;</tbl:header>
478          <tbl:propertyfilter />
479        </tr>
480         
481          <tbl:rows>
482          <%
483          int index = cc.getPage()*cc.getRowsPerPage();
484          int selectedItemId = cc.getId();
485          if (hybridizations != null)
486          {           
487            while (hybridizations.hasNext())
488            {
489              Hybridization item = hybridizations.next();
490              BioMaterialEvent creationEvent = item.getCreationEvent();
491              int itemId = item.getId();
492              boolean usePermission = item.hasPermission(Permission.USE);
493              String openSharePopup = "shareItem("+itemId+")";
494              String deletePermanently = "deleteItemPermanently("+itemId+")";
495              boolean deletePermission = item.hasPermission(Permission.DELETE);
496              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
497              boolean writePermission = item.hasPermission(Permission.WRITE);
498              String tooltip = mode.isSelectionMode() ? 
499                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
500              String name = HTML.encodeTags(item.getName());
501              index++;
502              numListed++;
503              %>
504              <tbl:row>
505                <tbl:header 
506                  clazz="index"
507                  ><%=index%></tbl:header>
508                <tbl:header 
509                  clazz="check" 
510                  visible="<%=mode.hasCheck()%>"
511                  ><input 
512                    type="checkbox" 
513                    name="<%=itemId%>" 
514                    value="<%=itemId%>" 
515                    title="<%=name%>" 
516                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
517                  ></tbl:header>
518                <tbl:header 
519                  clazz="check" 
520                  visible="<%=mode.hasRadio()%>"
521                  ><input 
522                    type="radio" 
523                    name="item_id" 
524                    value="<%=itemId%>" 
525                    title="<%=name%>" 
526                    <%=selectedItemId == itemId ? "checked" : ""%>
527                  ></tbl:header>
528                <tbl:header 
529                  clazz="icons" 
530                  visible="<%=mode.hasIcons()%>"
531                  ><base:icon 
532                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
533                    onclick="<%=deletePermission ? deletePermanently : null%>"
534                    tooltip="This item has been scheduled for deletion" 
535                    visible="<%=item.isRemoved()%>"
536                  /><base:icon 
537                    image="<%=sharePermission ? "shared.gif" : "shared_disabled.gif"%>" 
538                    onclick="<%=sharePermission ? openSharePopup : null%>"
539                    tooltip="This item is shared to other users, groups and/or projects" 
540                    visible="<%=item.isShared()%>"
541                  />&nbsp;</tbl:header>
542                <tbl:cell column="name"><div class="link" 
543                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 
544                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
545                <tbl:cell column="numArrays"><%=item.getNumArrays()%></tbl:cell>
546                <tbl:cell column="labeledExtracts">
547                  <%
548                  labeledExtractQuery.setParameter("hybridization", itemId, Type.INT);
549                  try
550                  {
551                    String separator = "";
552                    boolean isMultiArrayHyb = item.getNumArrays() > 1;
553                    for (LabeledExtract le : labeledExtractQuery.list(dc))
554                    {
555                      Label label = null;
556                      boolean readLabel = true;
557                      try
558                      {
559                        label = le.getLabel();
560                      }
561                      catch (PermissionDeniedException ex)
562                      {
563                        readLabel = false;
564                      }
565                      out.write(separator);
566                      if (isMultiArrayHyb)
567                      {
568                        out.write(creationEvent.getSourceGroup(le) + ": ");
569                      }
570                      if (mode.hasPropertyLink())
571                      {
572                        out.write(Base.getLinkedName(ID, le, false, mode.hasEditLink()));
573                        out.write(" (" + Base.getLinkedName(ID, label, !readLabel, mode.hasEditLink()) + ")");
574                      }
575                      else
576                      {
577                        out.write(HTML.encodeTags(le.getName()));
578                        out.write(" (" + Base.getEncodedName(label, !readLabel) + ")");
579                      }
580                      separator = ", ";
581                    }
582                  }
583                  catch (Throwable t)
584                  {
585                    %>
586                    <div class="error"><%=t.getMessage()%></div>
587                    <%
588                  }
589                  %>             
590                </tbl:cell>
591                <tbl:cell column="arraySlide"
592                  ><base:propertyvalue 
593                    item="<%=item%>" 
594                    property="arraySlide"
595                    enableEditLink="<%=mode.hasEditLink()%>" 
596                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
597                  /></tbl:cell>
598                <tbl:cell column="scans">
599                  <%
600                  scanQuery.setParameter("hybridization", itemId, Type.INT);
601                  try
602                  {
603                    String separator = "";
604                    for (Scan s : scanQuery.list(dc))
605                    {
606                      out.write(separator);
607                      if (mode.hasPropertyLink())
608                      {
609                        out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink()));
610                      }
611                      else
612                      {
613                        out.write(HTML.encodeTags(s.getName()));
614                      }
615                      separator = ", ";
616                    }
617                  }
618                  catch (Throwable t)
619                  {
620                    %>
621                    <div class="error"><%=t.getMessage()%></div>
622                    <%
623                  }
624                  %>
625                  <base:icon
626                    image="add.png" 
627                    onclick="<%="newScan("+itemId+")"%>" 
628                    tooltip="Create new scan" 
629                    visible="<%=mode.hasEditLink() && createScanPermission && usePermission %>"
630                  />
631                </tbl:cell>
632                <tbl:cell column="protocol"
633                  ><base:propertyvalue 
634                    item="<%=creationEvent%>" 
635                    property="protocol"
636                    enableEditLink="<%=mode.hasEditLink()%>" 
637                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
638                  /></tbl:cell>
639                <tbl:cell column="hybStation"
640                  ><base:propertyvalue 
641                    item="<%=creationEvent%>"
642                    property="hardware"
643                    enableEditLink="<%=mode.hasEditLink()%>" 
644                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
645                  /></tbl:cell>
646                <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" />
647                <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" />
648                <tbl:cell column="owner"
649                  ><base:propertyvalue 
650                    item="<%=item%>" 
651                    property="owner"
652                    enableEditLink="<%=mode.hasEditLink()%>" 
653                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
654                  /></tbl:cell>
655                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
656                <%
657                AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;
658                if (as != null)
659                {
660                  for (AnnotationType at : annotationTypes)
661                  {
662                    if (as.hasAnnotation(at))
663                    {
664                      %>
665                      <tbl:cell column="<%="at"+at.getId()%>"
666                        ><tbl:cellvalue 
667                        list="<%=as.getAnnotation(at).getValues()%>" 
668                      /></tbl:cell>
669                      <%
670                    }
671                  }
672                }
673                %>
674                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
675                <tbl:cell column="sharedTo">
676                  <%
677                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
678                  while(sharees.hasNext())
679                  {
680                    Nameable n = sharees.next();
681                    if (mode.hasPropertyLink())
682                    {
683                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
684                    }
685                    else
686                    {
687                      out.write(HTML.encodeTags(n.getName()));
688                    }
689                    out.write(sharees.hasNext() ? ", " : "");
690                  }
691                  %>
692                </tbl:cell>
693              </tbl:row>
694              <%
695              }
696            }
697          %>
698          </tbl:rows>
699      </tbl:data>
700      <%
701      if (numListed == 0)
702      {
703        %>
704        <tbl:panel><%=hybridizations == null || hybridizations.getTotalCount() == 0 ? "No hybridizations were found" : "No hybridizations on this page. Please select another page!" %></tbl:panel>
705        <%
706      }
707      else
708      {
709        %>
710        <tbl:navigator
711          page="<%=cc.getPage()%>" 
712          rowsperpage="<%=cc.getRowsPerPage()%>" 
713          totalrows="<%=hybridizations == null ? 0 : hybridizations.getTotalCount()%>" 
714          visible="<%=mode.hasNavigator()%>"
715          locked="true"
716        />
717        <%
718      }
719      %>
720    </tbl:table>
721    <base:buttongroup align="center" clazz="fixedatbottom">
722      <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />
723      <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
724      <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />
725    </base:buttongroup>
726    <br><br><br>
727  </base:body>
728  </base:page>
729  <%
730}
731finally
732{
733  if (hybridizations != null) hybridizations.close();
734  if (dc != null) dc.close();
735}
736%>
Note: See TracBrowser for help on using the repository browser.