www/admin/datafiletypes/list_filetypes.jsp

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