www/biomaterials/tags/list_tags.jsp

Code
Comments
Other
Rev Date Author Line
1864 30 Jan 06 nicklas 1 <%-- $Id$
1864 30 Jan 06 nicklas 2   ------------------------------------------------------------------
5425 23 Sep 10 nicklas 3   Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
3675 16 Aug 07 jari 4   Copyright (C) 2007 Johan Enell, Martin Svensson
1864 30 Jan 06 nicklas 5
2304 22 May 06 jari 6   This file is part of BASE - BioArray Software Environment.
2304 22 May 06 jari 7   Available at http://base.thep.lu.se/
1864 30 Jan 06 nicklas 8
1864 30 Jan 06 nicklas 9   BASE is free software; you can redistribute it and/or
1864 30 Jan 06 nicklas 10   modify it under the terms of the GNU General Public License
4476 05 Sep 08 jari 11   as published by the Free Software Foundation; either version 3
1864 30 Jan 06 nicklas 12   of the License, or (at your option) any later version.
1864 30 Jan 06 nicklas 13
1864 30 Jan 06 nicklas 14   BASE is distributed in the hope that it will be useful,
1864 30 Jan 06 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
1864 30 Jan 06 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1864 30 Jan 06 nicklas 17   GNU General Public License for more details.
1864 30 Jan 06 nicklas 18
1864 30 Jan 06 nicklas 19   You should have received a copy of the GNU General Public License
4510 11 Sep 08 jari 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
1864 30 Jan 06 nicklas 21   ------------------------------------------------------------------
1864 30 Jan 06 nicklas 22
1864 30 Jan 06 nicklas 23   @author Nicklas
1864 30 Jan 06 nicklas 24   @version 2.0
1864 30 Jan 06 nicklas 25 --%>
5426 24 Sep 10 nicklas 26 <%@ page pageEncoding="UTF-8" session="false"
1864 30 Jan 06 nicklas 27   import="net.sf.basedb.core.SessionControl"
1864 30 Jan 06 nicklas 28   import="net.sf.basedb.core.DbControl"
1864 30 Jan 06 nicklas 29   import="net.sf.basedb.core.Item"
5632 17 May 11 nicklas 30   import="net.sf.basedb.core.Tag"
5632 17 May 11 nicklas 31   import="net.sf.basedb.core.ItemSubtype"
6335 21 Oct 13 olle 32   import="net.sf.basedb.core.Annotation"
6335 21 Oct 13 olle 33   import="net.sf.basedb.core.AnnotationType"
6335 21 Oct 13 olle 34   import="net.sf.basedb.core.AnnotationSet"
1864 30 Jan 06 nicklas 35   import="net.sf.basedb.core.ItemQuery"
1864 30 Jan 06 nicklas 36   import="net.sf.basedb.core.ItemResultIterator"
6335 21 Oct 13 olle 37   import="net.sf.basedb.core.ItemResultList"
1864 30 Jan 06 nicklas 38   import="net.sf.basedb.core.ItemContext"
3553 09 Jul 07 martin 39   import="net.sf.basedb.core.Nameable"
1864 30 Jan 06 nicklas 40   import="net.sf.basedb.core.Permission"
1864 30 Jan 06 nicklas 41   import="net.sf.basedb.core.PluginDefinition"
1864 30 Jan 06 nicklas 42   import="net.sf.basedb.core.plugin.GuiContext"
1864 30 Jan 06 nicklas 43   import="net.sf.basedb.core.plugin.Plugin"
2466 06 Jul 06 martin 44   import="net.sf.basedb.core.query.Hql"
2466 06 Jul 06 martin 45   import="net.sf.basedb.core.query.Orders"
6541 29 Sep 14 nicklas 46   import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil"
6541 29 Sep 14 nicklas 47   import="net.sf.basedb.core.snapshot.AnnotationTypeFilter"
6541 29 Sep 14 nicklas 48   import="net.sf.basedb.core.snapshot.AnnotationSnapshot"
6541 29 Sep 14 nicklas 49   import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot"
6541 29 Sep 14 nicklas 50   import="net.sf.basedb.core.snapshot.SnapshotManager"
1864 30 Jan 06 nicklas 51   import="net.sf.basedb.clients.web.Base"
2343 31 May 06 nicklas 52   import="net.sf.basedb.clients.web.PermissionUtil"
1864 30 Jan 06 nicklas 53   import="net.sf.basedb.clients.web.ModeInfo"
1864 30 Jan 06 nicklas 54   import="net.sf.basedb.clients.web.util.HTML"
5632 17 May 11 nicklas 55   import="net.sf.basedb.util.Enumeration"
3553 09 Jul 07 martin 56   import="net.sf.basedb.util.ShareableUtil"
2753 20 Oct 06 nicklas 57   import="net.sf.basedb.util.Values"
4698 10 Dec 08 nicklas 58   import="net.sf.basedb.util.formatter.Formatter"
4698 10 Dec 08 nicklas 59   import="net.sf.basedb.clients.web.formatter.FormatterFactory"
4882 03 Apr 09 nicklas 60   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
4882 03 Apr 09 nicklas 61   import="net.sf.basedb.clients.web.extensions.JspContext"
4882 03 Apr 09 nicklas 62   import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
7604 25 Feb 19 nicklas 63   import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" 
4882 03 Apr 09 nicklas 64   import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
7604 25 Feb 19 nicklas 65   import="net.sf.basedb.clients.web.extensions.list.ListColumnAction"
6038 29 Mar 12 nicklas 66   import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
7337 12 Apr 17 nicklas 67   import="net.sf.basedb.clients.web.util.ProjectSpecificInfoFilter"
4882 03 Apr 09 nicklas 68   import="net.sf.basedb.util.extensions.ExtensionsInvoker"
4698 10 Dec 08 nicklas 69   import="java.util.Date"
3553 09 Jul 07 martin 70   import="java.util.Iterator"
1864 30 Jan 06 nicklas 71   import="java.util.List"
1864 30 Jan 06 nicklas 72   import="java.util.Map"
6541 29 Sep 14 nicklas 73   import="java.util.ArrayList"
1864 30 Jan 06 nicklas 74 %>
1864 30 Jan 06 nicklas 75 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
1864 30 Jan 06 nicklas 76 <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
4882 03 Apr 09 nicklas 77 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
1864 30 Jan 06 nicklas 78 <%!
5632 17 May 11 nicklas 79   private static final Item itemType = Item.TAG;
1864 30 Jan 06 nicklas 80   private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
1864 30 Jan 06 nicklas 81 %>
1864 30 Jan 06 nicklas 82 <%
1864 30 Jan 06 nicklas 83 final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
1864 30 Jan 06 nicklas 84 final String ID = sc.getId();
1864 30 Jan 06 nicklas 85 final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
1864 30 Jan 06 nicklas 86 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
1864 30 Jan 06 nicklas 87
1864 30 Jan 06 nicklas 88 final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
1864 30 Jan 06 nicklas 89 final String callback = request.getParameter("callback");
5632 17 May 11 nicklas 90 final String title = mode.generateTitle("tag", "tags");
7954 12 May 21 nicklas 91 final DbControl dc = sc.newDbControl(":List "+itemType);
5632 17 May 11 nicklas 92 ItemResultIterator<Tag> tags = null;
6541 29 Sep 14 nicklas 93 List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>();
1864 30 Jan 06 nicklas 94 try
1864 30 Jan 06 nicklas 95 {
4698 10 Dec 08 nicklas 96   Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
1864 30 Jan 06 nicklas 97
5632 17 May 11 nicklas 98   final ItemQuery<ItemSubtype> typeQuery = ItemSubtype.getQuery(itemType);
5632 17 May 11 nicklas 99   typeQuery.order(Orders.asc(Hql.property("name")));
5632 17 May 11 nicklas 100   typeQuery.setCacheResult(true);
6335 21 Oct 13 olle 101   final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType);
6541 29 Sep 14 nicklas 102   SnapshotManager manager = new SnapshotManager();
7337 12 Apr 17 nicklas 103   ProjectSpecificInfoFilter psInfo = new ProjectSpecificInfoFilter();
6541 29 Sep 14 nicklas 104   for (AnnotationType at : annotationTypeQuery.list(dc))
6541 29 Sep 14 nicklas 105   {
6541 29 Sep 14 nicklas 106     annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at));
6541 29 Sep 14 nicklas 107   }
5632 17 May 11 nicklas 108
1864 30 Jan 06 nicklas 109   Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
7914 23 Feb 21 nicklas 110   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null);
2029 20 Feb 06 nicklas 111   try
2029 20 Feb 06 nicklas 112   {
7914 23 Feb 21 nicklas 113     final ItemQuery<Tag> query = Base.getConfiguredQuery(dc, cc, jspContext, true, Tag.getQuery(), mode);
5632 17 May 11 nicklas 114     tags = query.iterate(dc);
2029 20 Feb 06 nicklas 115   }
2029 20 Feb 06 nicklas 116   catch (Throwable t)
2029 20 Feb 06 nicklas 117   {
2029 20 Feb 06 nicklas 118     cc.setMessage(t.getMessage());
2029 20 Feb 06 nicklas 119   }
1864 30 Jan 06 nicklas 120   int numListed = 0;
7604 25 Feb 19 nicklas 121   ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext);
7604 25 Feb 19 nicklas 122   ExtensionsInvoker<ListColumnAction<Tag,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext);
1864 30 Jan 06 nicklas 123   %>
6260 27 Mar 13 nicklas 124   <base:page title="<%=title==null ? "Tags" : title%>" type="<%=mode.getPageType()%>" id="list-page">
6260 27 Mar 13 nicklas 125   <base:head scripts="table.js,~tags.js" styles="table.css,toolbar.css">
4882 03 Apr 09 nicklas 126     <ext:scripts context="<%=jspContext%>" />
4882 03 Apr 09 nicklas 127     <ext:stylesheets context="<%=jspContext%>" />
1864 30 Jan 06 nicklas 128   </base:head>
1864 30 Jan 06 nicklas 129   
1864 30 Jan 06 nicklas 130   <base:body>
5951 09 Feb 12 nicklas 131     <h1><%=title==null ? "Tags" : title%></h1>
5951 09 Feb 12 nicklas 132     <div class="content">
1864 30 Jan 06 nicklas 133     <tbl:table 
6021 19 Mar 12 nicklas 134       id="taglist" 
1864 30 Jan 06 nicklas 135       columns="<%=cc.getSetting("columns")%>"
1864 30 Jan 06 nicklas 136       sortby="<%=cc.getSortProperty()%>" 
1864 30 Jan 06 nicklas 137       direction="<%=cc.getSortDirection()%>"
1864 30 Jan 06 nicklas 138       action="index.jsp"
1864 30 Jan 06 nicklas 139       sc="<%=sc%>"
1864 30 Jan 06 nicklas 140       item="<%=itemType%>"
6701 30 Jan 15 nicklas 141       filterrows="<%=cc.getFilterRows()%>"
5951 09 Feb 12 nicklas 142       subclass="fulltable"
7982 14 Jun 21 nicklas 143       stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>"
1864 30 Jan 06 nicklas 144       >
1864 30 Jan 06 nicklas 145       <tbl:hidden 
1864 30 Jan 06 nicklas 146         name="mode" 
1864 30 Jan 06 nicklas 147         value="<%=mode.getName()%>" 
1864 30 Jan 06 nicklas 148       />
1864 30 Jan 06 nicklas 149       <tbl:hidden 
1864 30 Jan 06 nicklas 150         name="callback" 
1864 30 Jan 06 nicklas 151         value="<%=callback%>" 
1864 30 Jan 06 nicklas 152         skip="<%=callback == null%>" 
1864 30 Jan 06 nicklas 153       />
1864 30 Jan 06 nicklas 154       <tbl:columndef 
1864 30 Jan 06 nicklas 155         id="name"
1864 30 Jan 06 nicklas 156         property="name"
1864 30 Jan 06 nicklas 157         datatype="string"
1864 30 Jan 06 nicklas 158         title="Name"
1864 30 Jan 06 nicklas 159         sortable="true" 
1864 30 Jan 06 nicklas 160         filterable="true"
1864 30 Jan 06 nicklas 161         exportable="true"
1864 30 Jan 06 nicklas 162         show="always" 
1864 30 Jan 06 nicklas 163       />
1864 30 Jan 06 nicklas 164       <tbl:columndef 
4332 12 Jun 08 martin 165         id="id"
4387 11 Aug 08 nicklas 166         clazz="uniquecol"
4332 12 Jun 08 martin 167         property="id"
4332 12 Jun 08 martin 168         datatype="int"
4332 12 Jun 08 martin 169         title="ID"
4332 12 Jun 08 martin 170         sortable="true"
4332 12 Jun 08 martin 171         filterable="true"
4332 12 Jun 08 martin 172         exportable="true"
4332 12 Jun 08 martin 173       />
4332 12 Jun 08 martin 174       <tbl:columndef 
1864 30 Jan 06 nicklas 175         id="owner"
1864 30 Jan 06 nicklas 176         property="owner.name"
1864 30 Jan 06 nicklas 177         datatype="string"
1864 30 Jan 06 nicklas 178         title="Owner"
1864 30 Jan 06 nicklas 179         sortable="true" 
1864 30 Jan 06 nicklas 180         filterable="true"
1864 30 Jan 06 nicklas 181         exportable="true"
1864 30 Jan 06 nicklas 182       />
1864 30 Jan 06 nicklas 183       <tbl:columndef 
4698 10 Dec 08 nicklas 184         id="entryDate"
4698 10 Dec 08 nicklas 185         property="entryDate"
4698 10 Dec 08 nicklas 186         datatype="date"
4698 10 Dec 08 nicklas 187         title="Registered"
4698 10 Dec 08 nicklas 188         sortable="true" 
4698 10 Dec 08 nicklas 189         filterable="true"
4698 10 Dec 08 nicklas 190         exportable="true"
4698 10 Dec 08 nicklas 191         formatter="<%=dateFormatter%>"
4698 10 Dec 08 nicklas 192       />
5632 17 May 11 nicklas 193       <%
5632 17 May 11 nicklas 194       Enumeration<String, String> tagTypes = new Enumeration<String, String>();
5632 17 May 11 nicklas 195       for (ItemSubtype subtype : typeQuery.list(dc))
5632 17 May 11 nicklas 196       {
5632 17 May 11 nicklas 197         tagTypes.add(Integer.toString(subtype.getId()), HTML.encodeTags(subtype.getName()));
5632 17 May 11 nicklas 198       }
5632 17 May 11 nicklas 199       %>    
4698 10 Dec 08 nicklas 200       <tbl:columndef 
5632 17 May 11 nicklas 201         id="itemSubtype"
5632 17 May 11 nicklas 202         property="itemSubtype"
5632 17 May 11 nicklas 203         sortproperty="itemSubtype.name"
5666 23 Jun 11 nicklas 204         exportproperty="itemSubtype.name:string"
5632 17 May 11 nicklas 205         datatype="int"
5632 17 May 11 nicklas 206         enumeration="<%=tagTypes%>"
5632 17 May 11 nicklas 207         title="Type"
5632 17 May 11 nicklas 208         sortable="true" 
5632 17 May 11 nicklas 209         filterable="true"
5632 17 May 11 nicklas 210         exportable="true"
5632 17 May 11 nicklas 211       />
5632 17 May 11 nicklas 212       <tbl:columndef 
1864 30 Jan 06 nicklas 213         id="description"
1864 30 Jan 06 nicklas 214         property="description"
1864 30 Jan 06 nicklas 215         datatype="string"
1864 30 Jan 06 nicklas 216         title="Description" 
1864 30 Jan 06 nicklas 217         sortable="true" 
1864 30 Jan 06 nicklas 218         filterable="true" 
1864 30 Jan 06 nicklas 219         exportable="true"
1864 30 Jan 06 nicklas 220       />
6335 21 Oct 13 olle 221       <%
6541 29 Sep 14 nicklas 222       for (AnnotationLoaderUtil loader : annotationLoaders)
6335 21 Oct 13 olle 223       {
6541 29 Sep 14 nicklas 224         AnnotationType at = loader.getAnnotationType();
6335 21 Oct 13 olle 225         Enumeration<String, String> annotationEnum = null;
7605 26 Feb 19 nicklas 226         Formatter<Object> formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType());
6335 21 Oct 13 olle 227         if (at.isEnumeration())
6335 21 Oct 13 olle 228         {
6335 21 Oct 13 olle 229           annotationEnum = new Enumeration<String, String>();
6784 18 Mar 15 nicklas 230           if (!at.getDisplayAsList()) annotationEnum.add("", "-none-");
6335 21 Oct 13 olle 231           List<?> values = at.getValues();
6335 21 Oct 13 olle 232           for (Object value : values)
6335 21 Oct 13 olle 233           {
6335 21 Oct 13 olle 234             String encoded = formatter.format(value);
6335 21 Oct 13 olle 235             annotationEnum.add(encoded, encoded);
6335 21 Oct 13 olle 236           }
6335 21 Oct 13 olle 237         }
6335 21 Oct 13 olle 238         %>
6335 21 Oct 13 olle 239         <tbl:columndef 
6335 21 Oct 13 olle 240           id="<%="at"+at.getId()%>"
6335 21 Oct 13 olle 241           title="<%=HTML.encodeTags(at.getName())+" [A]"%>" 
6335 21 Oct 13 olle 242           property="<%="#"+at.getId()%>"
6335 21 Oct 13 olle 243           annotation="true"
6335 21 Oct 13 olle 244           datatype="<%=at.getValueType().getStringValue()%>"
6335 21 Oct 13 olle 245           enumeration="<%=annotationEnum%>"
6335 21 Oct 13 olle 246           smartenum="<%=at.getDisplayAsList() %>"
6335 21 Oct 13 olle 247           sortable="<%=at.getMultiplicity() == 1%>" 
6335 21 Oct 13 olle 248           filterable="true" 
6335 21 Oct 13 olle 249           exportable="true"
6335 21 Oct 13 olle 250           formatter="<%=formatter%>"
6335 21 Oct 13 olle 251           unit="<%=at.getDefaultUnit()%>"
6335 21 Oct 13 olle 252         />
6335 21 Oct 13 olle 253         <%
6335 21 Oct 13 olle 254       }
6335 21 Oct 13 olle 255       %>  
2343 31 May 06 nicklas 256       <tbl:columndef
2343 31 May 06 nicklas 257         id="permission"
2343 31 May 06 nicklas 258         title="Permission"
2343 31 May 06 nicklas 259       />
5165 28 Oct 09 nicklas 260       <tbl:columndef
5165 28 Oct 09 nicklas 261         id="sharedTo"
3553 09 Jul 07 martin 262         title="Shared to"
5165 28 Oct 09 nicklas 263         filterable="true"
5165 28 Oct 09 nicklas 264         filterproperty="!sharedTo.name"
5165 28 Oct 09 nicklas 265         datatype="string"
3553 09 Jul 07 martin 266       />
6038 29 Mar 12 nicklas 267       <tbl:columndef 
6038 29 Mar 12 nicklas 268         id="xt-columns" 
6038 29 Mar 12 nicklas 269         extensions="<%=columnsInvoker%>" 
6038 29 Mar 12 nicklas 270         jspcontext="<%=jspContext%>" 
6038 29 Mar 12 nicklas 271       />
6604 18 Nov 14 nicklas 272       <div class="panelgroup bg-filled-50 bottomborder">
5951 09 Feb 12 nicklas 273         <tbl:toolbar
5952 10 Feb 12 nicklas 274           subclass="bottomborder"
5951 09 Feb 12 nicklas 275           visible="<%=mode.hasToolbar()%>"
5951 09 Feb 12 nicklas 276           >
5951 09 Feb 12 nicklas 277           <tbl:button 
6260 27 Mar 13 nicklas 278             id="btnNewItem"
5951 09 Feb 12 nicklas 279             disabled="<%=!createPermission%>" 
5951 09 Feb 12 nicklas 280             image="new.png" 
5951 09 Feb 12 nicklas 281             title="New&hellip;" 
5951 09 Feb 12 nicklas 282             tooltip="<%=createPermission ? "Create new tag" : "You do not have permission to create tags"%>" 
5951 09 Feb 12 nicklas 283           />
5951 09 Feb 12 nicklas 284           <tbl:button 
6260 27 Mar 13 nicklas 285             id="btnDeleteItems"
5951 09 Feb 12 nicklas 286             image="delete.png"
5951 09 Feb 12 nicklas 287             title="Delete" 
5951 09 Feb 12 nicklas 288             tooltip="Delete the selected items" 
5951 09 Feb 12 nicklas 289           />
5951 09 Feb 12 nicklas 290           <tbl:button 
6260 27 Mar 13 nicklas 291             id="btnRestoreItems"
5951 09 Feb 12 nicklas 292             image="restore.png"
5951 09 Feb 12 nicklas 293             title="Restore" 
5951 09 Feb 12 nicklas 294             tooltip="Restore the selected (deleted) items"
5951 09 Feb 12 nicklas 295           />
5951 09 Feb 12 nicklas 296           <tbl:button 
6260 27 Mar 13 nicklas 297             id="btnShareItems"
5951 09 Feb 12 nicklas 298             image="share.png"
5951 09 Feb 12 nicklas 299             title="Share&hellip;" 
5951 09 Feb 12 nicklas 300             tooltip="Share the selected items"
5951 09 Feb 12 nicklas 301           />
5951 09 Feb 12 nicklas 302           <tbl:button 
6260 27 Mar 13 nicklas 303             id="btnSetOwner"
5951 09 Feb 12 nicklas 304             image="take_ownership.png"
5951 09 Feb 12 nicklas 305             title="Set owner&hellip;"
5951 09 Feb 12 nicklas 306             tooltip="Change owner of the selected items"
5951 09 Feb 12 nicklas 307           />
5951 09 Feb 12 nicklas 308           <tbl:button 
6260 27 Mar 13 nicklas 309             id="btnColumns"
5951 09 Feb 12 nicklas 310             image="columns.png" 
5951 09 Feb 12 nicklas 311             title="Columns&hellip;" 
5951 09 Feb 12 nicklas 312             tooltip="Show, hide and re-order columns" 
5951 09 Feb 12 nicklas 313           />
5951 09 Feb 12 nicklas 314           <tbl:button 
6260 27 Mar 13 nicklas 315             id="btnImport"
6260 27 Mar 13 nicklas 316             data-plugin-type="IMPORT"
5951 09 Feb 12 nicklas 317             image="import.png" 
5951 09 Feb 12 nicklas 318             title="Import&hellip;" 
5951 09 Feb 12 nicklas 319             tooltip="Import data" 
5951 09 Feb 12 nicklas 320             visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
5951 09 Feb 12 nicklas 321           />
5951 09 Feb 12 nicklas 322           <tbl:button 
6260 27 Mar 13 nicklas 323             id="btnExport"
6260 27 Mar 13 nicklas 324             data-plugin-type="EXPORT"
5951 09 Feb 12 nicklas 325             image="export.png" 
5951 09 Feb 12 nicklas 326             title="Export&hellip;" 
5951 09 Feb 12 nicklas 327             tooltip="Export data" 
5951 09 Feb 12 nicklas 328             visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
5951 09 Feb 12 nicklas 329           />
5951 09 Feb 12 nicklas 330           <tbl:button 
6260 27 Mar 13 nicklas 331             id="btnRunPlugin"
6260 27 Mar 13 nicklas 332             data-plugin-type="OTHER"
5951 09 Feb 12 nicklas 333             image="runplugin.png" 
5951 09 Feb 12 nicklas 334             title="Run plugin&hellip;" 
5951 09 Feb 12 nicklas 335             tooltip="Run a plugin" 
5951 09 Feb 12 nicklas 336             visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
5951 09 Feb 12 nicklas 337           />
5951 09 Feb 12 nicklas 338           <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
7604 25 Feb 19 nicklas 339             wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/>
5951 09 Feb 12 nicklas 340         </tbl:toolbar>
5951 09 Feb 12 nicklas 341         <tbl:panel>
6182 23 Oct 12 nicklas 342           <tbl:presetselector />
5951 09 Feb 12 nicklas 343           <tbl:navigator
5951 09 Feb 12 nicklas 344             page="<%=cc.getPage()%>" 
5951 09 Feb 12 nicklas 345             rowsperpage="<%=cc.getRowsPerPage()%>" 
5951 09 Feb 12 nicklas 346             totalrows="<%=tags == null ? 0 : tags.getTotalCount()%>" 
5951 09 Feb 12 nicklas 347             visible="<%=mode.hasNavigator()%>"
5951 09 Feb 12 nicklas 348           />
5951 09 Feb 12 nicklas 349         </tbl:panel>
5951 09 Feb 12 nicklas 350       </div>
1864 30 Jan 06 nicklas 351       <tbl:data>
5948 08 Feb 12 nicklas 352         <tbl:headers>
5948 08 Feb 12 nicklas 353           <tbl:headerrow>
7943 04 May 21 nicklas 354             <tbl:header clazz="row-index bg-filled-100" />
5948 08 Feb 12 nicklas 355             <tbl:columnheaders />
5948 08 Feb 12 nicklas 356           </tbl:headerrow>
6701 30 Jan 15 nicklas 357           <%
6701 30 Jan 15 nicklas 358           int numFilters = cc.getNumPropertyFilters();
6701 30 Jan 15 nicklas 359           int numRows = cc.getFilterRows();
6701 30 Jan 15 nicklas 360           for (int filterNo = 0; filterNo < numRows; filterNo++)
6701 30 Jan 15 nicklas 361           {
6701 30 Jan 15 nicklas 362             boolean lastRow = filterNo == numRows-1;
6701 30 Jan 15 nicklas 363             %>
6701 30 Jan 15 nicklas 364             <tbl:headerrow>
7943 04 May 21 nicklas 365               <tbl:header subclass="row-index bg-filled-100">
7943 04 May 21 nicklas 366                 <div class="index-<%=mode.getName()%>">
7943 04 May 21 nicklas 367                   <div class="index"></div>
7943 04 May 21 nicklas 368                   <div class="check">
7943 04 May 21 nicklas 369                     <base:icon 
7943 04 May 21 nicklas 370                       subclass="link table-check"
7943 04 May 21 nicklas 371                       image="check_uncheck.png" 
7943 04 May 21 nicklas 372                       tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" 
7943 04 May 21 nicklas 373                       visible="<%=lastRow && mode.hasCheck()%>"
7943 04 May 21 nicklas 374                     />
7943 04 May 21 nicklas 375                   </div>
7943 04 May 21 nicklas 376                   <div class="icons">
7943 04 May 21 nicklas 377                     <base:icon
7943 04 May 21 nicklas 378                       subclass="link table-filter-row-action"
7943 04 May 21 nicklas 379                       image="add.png"
7943 04 May 21 nicklas 380                       tooltip="Add extra filter row"
7943 04 May 21 nicklas 381                       visible="<%=lastRow%>"
7943 04 May 21 nicklas 382                     /><base:icon
7943 04 May 21 nicklas 383                       subclass="link table-filter-row-action"
7943 04 May 21 nicklas 384                       image="remove.png"
7943 04 May 21 nicklas 385                       tooltip="Remove this filter row"
7943 04 May 21 nicklas 386                       visible="<%=numRows > 1 || numFilters > 0 %>"
7943 04 May 21 nicklas 387                       data-remove-row="<%=filterNo%>"
7943 04 May 21 nicklas 388                     />
7943 04 May 21 nicklas 389                   </div>
7943 04 May 21 nicklas 390                 </div>
6701 30 Jan 15 nicklas 391               </tbl:header>
6701 30 Jan 15 nicklas 392               <tbl:propertyfilter row="<%=filterNo%>" />
6701 30 Jan 15 nicklas 393             </tbl:headerrow>
6701 30 Jan 15 nicklas 394             <%
6701 30 Jan 15 nicklas 395           }
6701 30 Jan 15 nicklas 396           %>
7913 22 Feb 21 nicklas 397           <tbl:columnsubtitles />
5948 08 Feb 12 nicklas 398         </tbl:headers>
5948 08 Feb 12 nicklas 399         <tbl:rows>
1864 30 Jan 06 nicklas 400           <%
5951 09 Feb 12 nicklas 401           if (cc.getMessage() != null)
5951 09 Feb 12 nicklas 402           {
5951 09 Feb 12 nicklas 403             %>
6604 18 Nov 14 nicklas 404             <tbl:panel subclass="bg-filled-50">
5951 09 Feb 12 nicklas 405               <div class="messagecontainer error"><%=cc.getMessage()%></div>
5951 09 Feb 12 nicklas 406             </tbl:panel>
5951 09 Feb 12 nicklas 407             <%
5951 09 Feb 12 nicklas 408             cc.setMessage(null);
5951 09 Feb 12 nicklas 409           }
1864 30 Jan 06 nicklas 410           int index = cc.getPage()*cc.getRowsPerPage();
1864 30 Jan 06 nicklas 411           int selectedItemId = cc.getId();
5632 17 May 11 nicklas 412           if (tags != null)
2501 09 Aug 06 martin 413           {            
5632 17 May 11 nicklas 414             while (tags.hasNext())
2029 20 Feb 06 nicklas 415             {
5632 17 May 11 nicklas 416               Tag item = tags.next();
5632 17 May 11 nicklas 417               int itemId = item.getId();  
6221 10 Jan 13 nicklas 418               
6221 10 Jan 13 nicklas 419               
4003 26 Nov 07 nicklas 420               boolean deletePermission = item.hasPermission(Permission.DELETE);
2466 06 Jul 06 martin 421               boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);  
2466 06 Jul 06 martin 422               boolean usePermission = item.hasPermission(Permission.USE);
2501 09 Aug 06 martin 423               boolean writePermission = item.hasPermission(Permission.WRITE);
2501 09 Aug 06 martin 424               String tooltip = mode.isSelectionMode() ? 
2501 09 Aug 06 martin 425                   "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
2029 20 Feb 06 nicklas 426               String name = HTML.encodeTags(item.getName());
2029 20 Feb 06 nicklas 427               index++;
2029 20 Feb 06 nicklas 428               numListed++;
2029 20 Feb 06 nicklas 429               %>
2029 20 Feb 06 nicklas 430               <tbl:row>
7943 04 May 21 nicklas 431                 <tbl:header clazz="row-index bg-filled-100">
7943 04 May 21 nicklas 432                   <div class="index-<%=mode.getName()%>">
7943 04 May 21 nicklas 433                     <div class="index <%=index>999?"index-smaller":""%>"><%=index%></div>
7943 04 May 21 nicklas 434                     <div class="check">
7943 04 May 21 nicklas 435                       <base:input
7943 04 May 21 nicklas 436                         type="checkbox" 
7943 04 May 21 nicklas 437                         name="<%=itemId%>" 
7943 04 May 21 nicklas 438                         value="<%=itemId%>" 
7943 04 May 21 nicklas 439                         title="<%=name%>" 
7943 04 May 21 nicklas 440                         checked="<%=cc.getSelected().contains(itemId)%>"
7943 04 May 21 nicklas 441                         visible="<%=mode.hasCheck()%>"
7943 04 May 21 nicklas 442                       />
7943 04 May 21 nicklas 443                       <base:input 
7943 04 May 21 nicklas 444                         type="radio" 
7943 04 May 21 nicklas 445                         name="item_id" 
7943 04 May 21 nicklas 446                         value="<%=itemId%>" 
7943 04 May 21 nicklas 447                         title="<%=name%>" 
7943 04 May 21 nicklas 448                         checked="<%=selectedItemId == itemId%>"
7943 04 May 21 nicklas 449                         visible="<%=mode.hasRadio()%>"
7943 04 May 21 nicklas 450                       />
7943 04 May 21 nicklas 451                     </div>
7943 04 May 21 nicklas 452                     <div class="icons">
7943 04 May 21 nicklas 453                       <base:icon 
7943 04 May 21 nicklas 454                         image="deleted.png"
7943 04 May 21 nicklas 455                         id="<%="delete."+itemId %>"
7943 04 May 21 nicklas 456                         subclass="<%=deletePermission ? "table-delete-item" : "disabled" %>"
7943 04 May 21 nicklas 457                         data-item-id="<%=itemId%>"
7943 04 May 21 nicklas 458                         tooltip="This item has been scheduled for deletion" 
7943 04 May 21 nicklas 459                         visible="<%=item.isRemoved()%>"
7943 04 May 21 nicklas 460                       /><base:icon 
7943 04 May 21 nicklas 461                         image="shared.png" 
7943 04 May 21 nicklas 462                         id="<%="share."+itemId %>"
7943 04 May 21 nicklas 463                         subclass="<%=sharePermission ? "table-share-item" : "disabled" %>"
7943 04 May 21 nicklas 464                         data-item-id="<%=itemId%>"
7943 04 May 21 nicklas 465                         tooltip="This item is shared to other users, groups and/or projects" 
7943 04 May 21 nicklas 466                         visible="<%=item.isShared()%>"
7943 04 May 21 nicklas 467                       />
7943 04 May 21 nicklas 468                     </div>
7943 04 May 21 nicklas 469                   </div>
7943 04 May 21 nicklas 470                 </tbl:header>
6260 27 Mar 13 nicklas 471                 <tbl:cell column="name"><div
6260 27 Mar 13 nicklas 472                   class="link table-item"
6260 27 Mar 13 nicklas 473                   data-item-id="<%=itemId%>"
6260 27 Mar 13 nicklas 474                   data-no-edit="<%=writePermission ? 0 : 1 %>" 
6260 27 Mar 13 nicklas 475                   tabindex="0"
2501 09 Aug 06 martin 476                   title="<%=tooltip%>"><%=name%></div></tbl:cell>
4332 12 Jun 08 martin 477                 <tbl:cell column="id"><%=item.getId()%></tbl:cell>
2354 07 Jun 06 martin 478                 <tbl:cell column="owner"
2354 07 Jun 06 martin 479                   ><base:propertyvalue 
2354 07 Jun 06 martin 480                     item="<%=item%>" 
2354 07 Jun 06 martin 481                     property="owner"
2354 07 Jun 06 martin 482                     enableEditLink="<%=mode.hasEditLink()%>" 
2354 07 Jun 06 martin 483                     enablePropertyLink="<%=mode.hasPropertyLink()%>"
2354 07 Jun 06 martin 484                   /></tbl:cell>
4698 10 Dec 08 nicklas 485                 <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" />
5632 17 May 11 nicklas 486                 <tbl:cell column="itemSubtype"
5632 17 May 11 nicklas 487                   ><base:propertyvalue 
5632 17 May 11 nicklas 488                     item="<%=item%>" 
5632 17 May 11 nicklas 489                     property="itemSubtype"
5632 17 May 11 nicklas 490                     enableEditLink="<%=mode.hasEditLink()%>" 
5632 17 May 11 nicklas 491                     enablePropertyLink="<%=mode.hasPropertyLink()%>"
5632 17 May 11 nicklas 492                   /></tbl:cell>
2029 20 Feb 06 nicklas 493                 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
6335 21 Oct 13 olle 494                 <%
6541 29 Sep 14 nicklas 495                 if (item.isAnnotated())
6335 21 Oct 13 olle 496                 {
6541 29 Sep 14 nicklas 497                   AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId());
6541 29 Sep 14 nicklas 498                   for (AnnotationLoaderUtil loader : annotationLoaders)
6335 21 Oct 13 olle 499                   {
6721 10 Feb 15 nicklas 500                     %>
6721 10 Feb 15 nicklas 501                     <tbl:cell 
6721 10 Feb 15 nicklas 502                       column="<%="at"+loader.getId()%>"
6721 10 Feb 15 nicklas 503                       ><%
7337 12 Apr 17 nicklas 504                       if (loader.find(snapshot, psInfo.reset())) 
6721 10 Feb 15 nicklas 505                       {
6721 10 Feb 15 nicklas 506                         %><tbl:cellvalue 
6541 29 Sep 14 nicklas 507                           list="<%=loader.getValues()%>"
8160 07 Jun 23 nicklas 508                           bulletlist="<%=loader.useBulletList() %>"
6541 29 Sep 14 nicklas 509                           suffix="<%=loader.getUnitSymbol()%>"
8083 20 Oct 22 nicklas 510                           clazz="<%=psInfo.hasProjectSpecificAnnotation() ? "ps-annotation" : null%>"
6721 10 Feb 15 nicklas 511                         /><%
6721 10 Feb 15 nicklas 512                       }
6721 10 Feb 15 nicklas 513                       %></tbl:cell>
6721 10 Feb 15 nicklas 514                     <%
6335 21 Oct 13 olle 515                   }
6335 21 Oct 13 olle 516                 }
6335 21 Oct 13 olle 517                 %>
2343 31 May 06 nicklas 518                 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
3553 09 Jul 07 martin 519                 <tbl:cell column="sharedTo">
3553 09 Jul 07 martin 520                   <%
3553 09 Jul 07 martin 521                   Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
3553 09 Jul 07 martin 522                   while(sharees.hasNext())
3553 09 Jul 07 martin 523                   {
3553 09 Jul 07 martin 524                     Nameable n = sharees.next();
3553 09 Jul 07 martin 525                     if (mode.hasPropertyLink())
3553 09 Jul 07 martin 526                     {
3553 09 Jul 07 martin 527                       out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
3553 09 Jul 07 martin 528                     }
3553 09 Jul 07 martin 529                     else
3553 09 Jul 07 martin 530                     {
3553 09 Jul 07 martin 531                       out.write(HTML.encodeTags(n.getName()));
3553 09 Jul 07 martin 532                     }
3553 09 Jul 07 martin 533                     out.write(sharees.hasNext() ? ", " : "");
3553 09 Jul 07 martin 534                   }
3553 09 Jul 07 martin 535                   %>
3553 09 Jul 07 martin 536                 </tbl:cell>
6038 29 Mar 12 nicklas 537                 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
6038 29 Mar 12 nicklas 538                   <tbl:cell column="xt-columns" />
6038 29 Mar 12 nicklas 539                 </tbl:xt-cells>
2029 20 Feb 06 nicklas 540               </tbl:row>
2029 20 Feb 06 nicklas 541               <%
2029 20 Feb 06 nicklas 542               }
1864 30 Jan 06 nicklas 543             }
5951 09 Feb 12 nicklas 544           if (numListed == 0)
5951 09 Feb 12 nicklas 545           {
5951 09 Feb 12 nicklas 546             %>
6604 18 Nov 14 nicklas 547             <tbl:panel subclass="bg-filled-50">
5951 09 Feb 12 nicklas 548               <div class="messagecontainer note">
5951 09 Feb 12 nicklas 549                 <%=tags == null || tags.getTotalCount() == 0 ? "No tags were found" : "No tags on this page. Please select another page!" %>
5951 09 Feb 12 nicklas 550               </div>
5951 09 Feb 12 nicklas 551             </tbl:panel>
5951 09 Feb 12 nicklas 552             <%
5951 09 Feb 12 nicklas 553           }
1864 30 Jan 06 nicklas 554           %>
5951 09 Feb 12 nicklas 555         </tbl:rows>
1864 30 Jan 06 nicklas 556       </tbl:data>
1864 30 Jan 06 nicklas 557     </tbl:table>
5951 09 Feb 12 nicklas 558     </div>
5951 09 Feb 12 nicklas 559     <base:buttongroup subclass="dialogbuttons">
6260 27 Mar 13 nicklas 560       <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
6260 27 Mar 13 nicklas 561       <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
6260 27 Mar 13 nicklas 562       <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
1864 30 Jan 06 nicklas 563     </base:buttongroup>
1864 30 Jan 06 nicklas 564   </base:body>
1864 30 Jan 06 nicklas 565   </base:page>
1864 30 Jan 06 nicklas 566   <%
1864 30 Jan 06 nicklas 567 }
1864 30 Jan 06 nicklas 568 finally
1864 30 Jan 06 nicklas 569 {
5632 17 May 11 nicklas 570   if (tags != null) tags.close();
1864 30 Jan 06 nicklas 571   if (dc != null) dc.close();
1864 30 Jan 06 nicklas 572 }
3675 16 Aug 07 jari 573 %>