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