www/admin/platforms/list_platforms.jsp

Code
Comments
Other
Rev Date Author Line
4003 26 Nov 07 nicklas 1 <%-- $Id:list_platforms.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.Platform"
3793 27 Sep 07 nicklas 30   import="net.sf.basedb.core.PlatformVariant"
8026 15 Dec 21 nicklas 31   import="net.sf.basedb.core.Project"
3793 27 Sep 07 nicklas 32   import="net.sf.basedb.core.RawDataType"
3793 27 Sep 07 nicklas 33   import="net.sf.basedb.core.ItemQuery"
3793 27 Sep 07 nicklas 34   import="net.sf.basedb.core.Include"
3793 27 Sep 07 nicklas 35   import="net.sf.basedb.core.Type"
3793 27 Sep 07 nicklas 36   import="net.sf.basedb.core.ItemResultIterator"
3793 27 Sep 07 nicklas 37   import="net.sf.basedb.core.ItemResultList"
3793 27 Sep 07 nicklas 38   import="net.sf.basedb.core.ItemContext"
3793 27 Sep 07 nicklas 39   import="net.sf.basedb.core.Permission"
3793 27 Sep 07 nicklas 40   import="net.sf.basedb.core.PluginDefinition"
3793 27 Sep 07 nicklas 41   import="net.sf.basedb.core.query.Orders"
3793 27 Sep 07 nicklas 42   import="net.sf.basedb.core.query.Hql"
3793 27 Sep 07 nicklas 43   import="net.sf.basedb.core.query.Expressions"
3793 27 Sep 07 nicklas 44   import="net.sf.basedb.core.query.Restrictions"
3793 27 Sep 07 nicklas 45   import="net.sf.basedb.core.plugin.GuiContext"
3793 27 Sep 07 nicklas 46   import="net.sf.basedb.core.plugin.Plugin"
3793 27 Sep 07 nicklas 47   import="net.sf.basedb.util.Enumeration"
3793 27 Sep 07 nicklas 48   import="net.sf.basedb.clients.web.Base"
3793 27 Sep 07 nicklas 49   import="net.sf.basedb.clients.web.PermissionUtil"
3793 27 Sep 07 nicklas 50   import="net.sf.basedb.clients.web.ModeInfo"
3793 27 Sep 07 nicklas 51   import="net.sf.basedb.clients.web.util.HTML"
3793 27 Sep 07 nicklas 52   import="net.sf.basedb.util.formatter.Formatter"
3793 27 Sep 07 nicklas 53   import="net.sf.basedb.clients.web.formatter.FormatterFactory"
4886 03 Apr 09 nicklas 54   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
4886 03 Apr 09 nicklas 55   import="net.sf.basedb.clients.web.extensions.JspContext"
4886 03 Apr 09 nicklas 56   import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
7604 25 Feb 19 nicklas 57   import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" 
4886 03 Apr 09 nicklas 58   import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
7604 25 Feb 19 nicklas 59   import="net.sf.basedb.clients.web.extensions.list.ListColumnAction"
6045 03 Apr 12 nicklas 60   import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
4886 03 Apr 09 nicklas 61   import="net.sf.basedb.util.extensions.ExtensionsInvoker"
3793 27 Sep 07 nicklas 62   import="net.sf.basedb.util.Values"
3793 27 Sep 07 nicklas 63   import="java.util.List"
3793 27 Sep 07 nicklas 64   import="java.util.Map"
3793 27 Sep 07 nicklas 65   import="java.util.Date"
3793 27 Sep 07 nicklas 66 %>
3793 27 Sep 07 nicklas 67 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
3793 27 Sep 07 nicklas 68 <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
4886 03 Apr 09 nicklas 69 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
3793 27 Sep 07 nicklas 70 <%!
3793 27 Sep 07 nicklas 71   private static final Item itemType = Item.PLATFORM;
3793 27 Sep 07 nicklas 72   private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
3793 27 Sep 07 nicklas 73 %>
3793 27 Sep 07 nicklas 74 <%
3793 27 Sep 07 nicklas 75 final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
3793 27 Sep 07 nicklas 76 final String ID = sc.getId();
3793 27 Sep 07 nicklas 77 final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
3793 27 Sep 07 nicklas 78 final boolean writePermission = sc.hasPermission(Permission.WRITE, itemType);
3793 27 Sep 07 nicklas 79 final boolean deletePermission = sc.hasPermission(Permission.DELETE, itemType);
3793 27 Sep 07 nicklas 80 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
3793 27 Sep 07 nicklas 81
3793 27 Sep 07 nicklas 82 final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
3793 27 Sep 07 nicklas 83 final String callback = request.getParameter("callback");
3793 27 Sep 07 nicklas 84 final String title = mode.generateTitle("platform", "platforms");
7954 12 May 21 nicklas 85 final DbControl dc = sc.newDbControl(":List "+itemType);
3793 27 Sep 07 nicklas 86 ItemResultIterator<Platform> platforms = null;
3793 27 Sep 07 nicklas 87 try
3793 27 Sep 07 nicklas 88 {
3793 27 Sep 07 nicklas 89   // Query for variants of a platform
3793 27 Sep 07 nicklas 90   final ItemQuery<PlatformVariant> variantQuery = PlatformVariant.getQuery();
3793 27 Sep 07 nicklas 91   variantQuery.include(cc.getInclude());
3793 27 Sep 07 nicklas 92   variantQuery.restrict(Restrictions.eq(Hql.property("platform"), Expressions.parameter("platform")));
3793 27 Sep 07 nicklas 93   variantQuery.order(Orders.asc(Hql.property("name"))); 
3793 27 Sep 07 nicklas 94   final boolean createVariantPermission = sc.hasPermission(Permission.CREATE, Item.PLATFORMVARIANT);   
3793 27 Sep 07 nicklas 95
3793 27 Sep 07 nicklas 96   Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
7914 23 Feb 21 nicklas 97   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null);
3793 27 Sep 07 nicklas 98   try
3793 27 Sep 07 nicklas 99   {
7914 23 Feb 21 nicklas 100     final ItemQuery<Platform> query = Base.getConfiguredQuery(dc, cc, jspContext, true, Platform.getQuery(), mode);
3793 27 Sep 07 nicklas 101     platforms = query.iterate(dc);
3793 27 Sep 07 nicklas 102   }
3793 27 Sep 07 nicklas 103   catch (Throwable t)
3793 27 Sep 07 nicklas 104   {
3793 27 Sep 07 nicklas 105     cc.setMessage(t.getMessage());
3793 27 Sep 07 nicklas 106   }
8026 15 Dec 21 nicklas 107   Project activeProject = Project.getActive(dc);
3793 27 Sep 07 nicklas 108   int numListed = 0;
7604 25 Feb 19 nicklas 109   ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext);
7604 25 Feb 19 nicklas 110   ExtensionsInvoker<ListColumnAction<Platform,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext);
3793 27 Sep 07 nicklas 111   %>
6289 05 Jun 13 nicklas 112   <base:page title="<%=title==null ? "Platforms" : title%>" type="<%=mode.getPageType()%>" id="list-page">
6289 05 Jun 13 nicklas 113   <base:head scripts="table.js,~platforms.js" styles="table.css,toolbar.css">
4886 03 Apr 09 nicklas 114     <ext:scripts context="<%=jspContext%>" />
4886 03 Apr 09 nicklas 115     <ext:stylesheets context="<%=jspContext%>" />
3793 27 Sep 07 nicklas 116   </base:head>
3793 27 Sep 07 nicklas 117   
3793 27 Sep 07 nicklas 118   <base:body>
5954 13 Feb 12 nicklas 119     <h1><%=title==null ? "Platforms" : title%></h1>
5954 13 Feb 12 nicklas 120     <div class="content">
3793 27 Sep 07 nicklas 121     <tbl:table 
3793 27 Sep 07 nicklas 122       id="platforms" 
3793 27 Sep 07 nicklas 123       columns="<%=cc.getSetting("columns")%>"
3793 27 Sep 07 nicklas 124       sortby="<%=cc.getSortProperty()%>" 
3793 27 Sep 07 nicklas 125       direction="<%=cc.getSortDirection()%>"
3793 27 Sep 07 nicklas 126       action="index.jsp"
3793 27 Sep 07 nicklas 127       sc="<%=sc%>"
3793 27 Sep 07 nicklas 128       item="<%=itemType%>"
6706 02 Feb 15 nicklas 129       filterrows="<%=cc.getFilterRows()%>"
5954 13 Feb 12 nicklas 130       subclass="fulltable"
7982 14 Jun 21 nicklas 131       stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>"
3793 27 Sep 07 nicklas 132       >
3793 27 Sep 07 nicklas 133       <tbl:hidden 
3793 27 Sep 07 nicklas 134         name="mode" 
3793 27 Sep 07 nicklas 135         value="<%=mode.getName()%>" 
3793 27 Sep 07 nicklas 136       />
3793 27 Sep 07 nicklas 137       <tbl:hidden 
3793 27 Sep 07 nicklas 138         name="callback" 
3793 27 Sep 07 nicklas 139         value="<%=callback%>" 
3793 27 Sep 07 nicklas 140         skip="<%=callback == null%>" 
3793 27 Sep 07 nicklas 141       />
3793 27 Sep 07 nicklas 142       <tbl:columndef 
3793 27 Sep 07 nicklas 143         id="name"
3793 27 Sep 07 nicklas 144         property="name"
3793 27 Sep 07 nicklas 145         datatype="string"
3793 27 Sep 07 nicklas 146         title="Name"
3793 27 Sep 07 nicklas 147         sortable="true" 
3793 27 Sep 07 nicklas 148         filterable="true"
3793 27 Sep 07 nicklas 149         exportable="true"
3793 27 Sep 07 nicklas 150         show="always" 
3793 27 Sep 07 nicklas 151       />
3793 27 Sep 07 nicklas 152       <tbl:columndef 
4332 12 Jun 08 martin 153         id="id"
4387 11 Aug 08 nicklas 154         clazz="uniquecol"
4332 12 Jun 08 martin 155         property="id"
4332 12 Jun 08 martin 156         datatype="int"
4332 12 Jun 08 martin 157         title="ID"
4332 12 Jun 08 martin 158         sortable="true"
4332 12 Jun 08 martin 159         filterable="true"
4332 12 Jun 08 martin 160         exportable="true"
4332 12 Jun 08 martin 161       />
4332 12 Jun 08 martin 162       <tbl:columndef 
3798 28 Sep 07 nicklas 163         id="externalId"
4387 11 Aug 08 nicklas 164         clazz="uniquecol"
3798 28 Sep 07 nicklas 165         property="externalId"
3793 27 Sep 07 nicklas 166         datatype="string"
3798 28 Sep 07 nicklas 167         title="External ID"
3793 27 Sep 07 nicklas 168         sortable="true"
3793 27 Sep 07 nicklas 169         filterable="true"
3793 27 Sep 07 nicklas 170         exportable="true"
3793 27 Sep 07 nicklas 171       />
3793 27 Sep 07 nicklas 172       <tbl:columndef 
3793 27 Sep 07 nicklas 173         id="fileOnly"
3793 27 Sep 07 nicklas 174         property="fileOnly"
3793 27 Sep 07 nicklas 175         datatype="boolean"
3793 27 Sep 07 nicklas 176         title="File-only"
3793 27 Sep 07 nicklas 177         sortable="true"
3793 27 Sep 07 nicklas 178         filterable="true"
3793 27 Sep 07 nicklas 179         exportable="true"
3793 27 Sep 07 nicklas 180       />
3793 27 Sep 07 nicklas 181       <tbl:columndef 
3793 27 Sep 07 nicklas 182         id="rawDataType"
3793 27 Sep 07 nicklas 183         property="rawDataType"
3793 27 Sep 07 nicklas 184         datatype="string"
3793 27 Sep 07 nicklas 185         title="Raw data type"
3793 27 Sep 07 nicklas 186         sortable="true"
3793 27 Sep 07 nicklas 187         filterable="true"
3793 27 Sep 07 nicklas 188         exportable="true"
3793 27 Sep 07 nicklas 189       />
3793 27 Sep 07 nicklas 190       <tbl:columndef 
3793 27 Sep 07 nicklas 191         id="channels"
3793 27 Sep 07 nicklas 192         property="channels"
3793 27 Sep 07 nicklas 193         datatype="int"
3793 27 Sep 07 nicklas 194         title="Channels"
3793 27 Sep 07 nicklas 195         sortable="true"
3793 27 Sep 07 nicklas 196         filterable="true"
3793 27 Sep 07 nicklas 197         exportable="true"
3793 27 Sep 07 nicklas 198       />
3793 27 Sep 07 nicklas 199       <tbl:columndef
3793 27 Sep 07 nicklas 200         id="variants"
3793 27 Sep 07 nicklas 201         title="Variants"
4609 28 Oct 08 nicklas 202         property="&variants(name)"
4609 28 Oct 08 nicklas 203         datatype="string"
4609 28 Oct 08 nicklas 204         filterable="true"
4906 24 Apr 09 martin 205         exportable="true"
3793 27 Sep 07 nicklas 206       />
3793 27 Sep 07 nicklas 207       <tbl:columndef 
3793 27 Sep 07 nicklas 208         id="description"
3793 27 Sep 07 nicklas 209         property="description"
3793 27 Sep 07 nicklas 210         datatype="string"
3793 27 Sep 07 nicklas 211         title="Description" 
3793 27 Sep 07 nicklas 212         sortable="true" 
3793 27 Sep 07 nicklas 213         filterable="true" 
3793 27 Sep 07 nicklas 214         exportable="true"
3793 27 Sep 07 nicklas 215       />
6045 03 Apr 12 nicklas 216       <tbl:columndef 
6045 03 Apr 12 nicklas 217         id="xt-columns" 
6045 03 Apr 12 nicklas 218         extensions="<%=columnsInvoker%>" 
6045 03 Apr 12 nicklas 219         jspcontext="<%=jspContext%>" 
6045 03 Apr 12 nicklas 220       />
6604 18 Nov 14 nicklas 221       <div class="panelgroup bg-filled-50 bottomborder">
5954 13 Feb 12 nicklas 222         <tbl:toolbar
5954 13 Feb 12 nicklas 223           subclass="bottomborder"
5954 13 Feb 12 nicklas 224           visible="<%=mode.hasToolbar()%>"
5954 13 Feb 12 nicklas 225           >
5954 13 Feb 12 nicklas 226           <tbl:button 
6289 05 Jun 13 nicklas 227             id="btnNewItem"
5954 13 Feb 12 nicklas 228             disabled="<%=!createPermission%>" 
5954 13 Feb 12 nicklas 229             image="new.png" 
5954 13 Feb 12 nicklas 230             title="New&hellip;" 
5954 13 Feb 12 nicklas 231             tooltip="<%=createPermission ? "Create platforms" : "You do not have permission to create platforms"%>" 
5954 13 Feb 12 nicklas 232           />
5954 13 Feb 12 nicklas 233           <tbl:button 
6289 05 Jun 13 nicklas 234             id="btnDeleteItems"
5954 13 Feb 12 nicklas 235             disabled="<%=!deletePermission%>" 
5954 13 Feb 12 nicklas 236             image="delete.png" 
5954 13 Feb 12 nicklas 237             title="Delete" 
5954 13 Feb 12 nicklas 238             tooltip="<%=deletePermission ? "Delete the selected items" : "You do not have permission to delete platforms" %>" 
5954 13 Feb 12 nicklas 239           />
5954 13 Feb 12 nicklas 240           <tbl:button 
6289 05 Jun 13 nicklas 241             id="btnRestoreItems"
5954 13 Feb 12 nicklas 242             disabled="<%=!writePermission%>" 
5954 13 Feb 12 nicklas 243             image="restore.png" 
5954 13 Feb 12 nicklas 244             title="Restore" 
5954 13 Feb 12 nicklas 245             tooltip="<%=writePermission ? "Restore the selected (deleted) items" : "You do not have permission to edit platforms" %>" 
5954 13 Feb 12 nicklas 246           />
5954 13 Feb 12 nicklas 247           <tbl:button 
6289 05 Jun 13 nicklas 248             id="btnColumns"
5954 13 Feb 12 nicklas 249             image="columns.png" 
5954 13 Feb 12 nicklas 250             title="Columns&hellip;" 
5954 13 Feb 12 nicklas 251             tooltip="Show, hide and re-order columns" 
5954 13 Feb 12 nicklas 252           />
5954 13 Feb 12 nicklas 253           <tbl:button 
6289 05 Jun 13 nicklas 254             id="btnImport"
6289 05 Jun 13 nicklas 255             data-plugin-type="IMPORT"
5954 13 Feb 12 nicklas 256             image="import.png" 
5954 13 Feb 12 nicklas 257             title="Import&hellip;" 
5954 13 Feb 12 nicklas 258             tooltip="Import data" 
5954 13 Feb 12 nicklas 259             visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
5954 13 Feb 12 nicklas 260           />
5954 13 Feb 12 nicklas 261           <tbl:button 
6289 05 Jun 13 nicklas 262             id="btnExport"
6289 05 Jun 13 nicklas 263             data-plugin-type="EXPORT"
5954 13 Feb 12 nicklas 264             image="export.png" 
5954 13 Feb 12 nicklas 265             title="Export&hellip;" 
5954 13 Feb 12 nicklas 266             tooltip="Export data" 
5954 13 Feb 12 nicklas 267             visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
5954 13 Feb 12 nicklas 268           />
5954 13 Feb 12 nicklas 269           <tbl:button 
6289 05 Jun 13 nicklas 270             id="btnRunPlugin"
6289 05 Jun 13 nicklas 271             data-plugin-type="OTHER"
5954 13 Feb 12 nicklas 272             image="runplugin.png" 
5954 13 Feb 12 nicklas 273             title="Run plugin&hellip;" 
5954 13 Feb 12 nicklas 274             tooltip="Run a plugin" 
5954 13 Feb 12 nicklas 275             visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
5954 13 Feb 12 nicklas 276           />
5954 13 Feb 12 nicklas 277           <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
7604 25 Feb 19 nicklas 278             wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/>
5954 13 Feb 12 nicklas 279         </tbl:toolbar>
5954 13 Feb 12 nicklas 280         <tbl:panel>
6182 23 Oct 12 nicklas 281           <tbl:presetselector />
5954 13 Feb 12 nicklas 282           <tbl:navigator
5954 13 Feb 12 nicklas 283             page="<%=cc.getPage()%>" 
5954 13 Feb 12 nicklas 284             rowsperpage="<%=cc.getRowsPerPage()%>" 
5954 13 Feb 12 nicklas 285             totalrows="<%=platforms == null ? 0 : platforms.getTotalCount()%>" 
5954 13 Feb 12 nicklas 286             visible="<%=mode.hasNavigator()%>"
5954 13 Feb 12 nicklas 287           />
5954 13 Feb 12 nicklas 288         </tbl:panel>
5954 13 Feb 12 nicklas 289       </div>
3793 27 Sep 07 nicklas 290       <tbl:data>
5948 08 Feb 12 nicklas 291         <tbl:headers>
5948 08 Feb 12 nicklas 292           <tbl:headerrow>
7943 04 May 21 nicklas 293             <tbl:header clazz="row-index bg-filled-100" />
5948 08 Feb 12 nicklas 294             <tbl:columnheaders />
5948 08 Feb 12 nicklas 295           </tbl:headerrow>
6706 02 Feb 15 nicklas 296           <%
6706 02 Feb 15 nicklas 297           int numFilters = cc.getNumPropertyFilters();
6706 02 Feb 15 nicklas 298           int numRows = cc.getFilterRows();
6706 02 Feb 15 nicklas 299           for (int filterNo = 0; filterNo < numRows; filterNo++)
6706 02 Feb 15 nicklas 300           {
6706 02 Feb 15 nicklas 301             boolean lastRow = filterNo == numRows-1;
6706 02 Feb 15 nicklas 302             %>
6706 02 Feb 15 nicklas 303             <tbl:headerrow>
7943 04 May 21 nicklas 304               <tbl:header subclass="row-index bg-filled-100">
7943 04 May 21 nicklas 305                 <div class="index-<%=mode.getName()%>">
7943 04 May 21 nicklas 306                   <div class="index"></div>
7943 04 May 21 nicklas 307                   <div class="check">
7943 04 May 21 nicklas 308                     <base:icon 
7943 04 May 21 nicklas 309                       subclass="link table-check"
7943 04 May 21 nicklas 310                       image="check_uncheck.png" 
7943 04 May 21 nicklas 311                       tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" 
7943 04 May 21 nicklas 312                       visible="<%=lastRow && mode.hasCheck()%>"
7943 04 May 21 nicklas 313                     />
7943 04 May 21 nicklas 314                   </div>
7943 04 May 21 nicklas 315                   <div class="icons">
7943 04 May 21 nicklas 316                     <base:icon
7943 04 May 21 nicklas 317                       subclass="link table-filter-row-action"
7943 04 May 21 nicklas 318                       image="add.png"
7943 04 May 21 nicklas 319                       tooltip="Add extra filter row"
7943 04 May 21 nicklas 320                       visible="<%=lastRow%>"
7943 04 May 21 nicklas 321                     /><base:icon
7943 04 May 21 nicklas 322                       subclass="link table-filter-row-action"
7943 04 May 21 nicklas 323                       image="remove.png"
7943 04 May 21 nicklas 324                       tooltip="Remove this filter row"
7943 04 May 21 nicklas 325                       visible="<%=numRows > 1 || numFilters > 0 %>"
7943 04 May 21 nicklas 326                       data-remove-row="<%=filterNo%>"
7943 04 May 21 nicklas 327                     />
7943 04 May 21 nicklas 328                   </div>
7943 04 May 21 nicklas 329                 </div>
6706 02 Feb 15 nicklas 330               </tbl:header>
6706 02 Feb 15 nicklas 331               <tbl:propertyfilter row="<%=filterNo%>" />
6706 02 Feb 15 nicklas 332             </tbl:headerrow>
6706 02 Feb 15 nicklas 333             <%
6706 02 Feb 15 nicklas 334           }
6706 02 Feb 15 nicklas 335           %>
7913 22 Feb 21 nicklas 336           <tbl:columnsubtitles />
5948 08 Feb 12 nicklas 337         </tbl:headers>
5948 08 Feb 12 nicklas 338         <tbl:rows>
3793 27 Sep 07 nicklas 339           <%
5954 13 Feb 12 nicklas 340           if (cc.getMessage() != null)
5954 13 Feb 12 nicklas 341           {
5954 13 Feb 12 nicklas 342             %>
6604 18 Nov 14 nicklas 343             <tbl:panel subclass="bg-filled-50">
5954 13 Feb 12 nicklas 344               <div class="messagecontainer error"><%=cc.getMessage()%></div>
5954 13 Feb 12 nicklas 345             </tbl:panel>
5954 13 Feb 12 nicklas 346             <%
5954 13 Feb 12 nicklas 347             cc.setMessage(null);
5954 13 Feb 12 nicklas 348           }
3793 27 Sep 07 nicklas 349           int index = cc.getPage()*cc.getRowsPerPage();
3793 27 Sep 07 nicklas 350           int selectedItemId = cc.getId();
3793 27 Sep 07 nicklas 351           if (platforms != null)
3793 27 Sep 07 nicklas 352           {            
3793 27 Sep 07 nicklas 353             while (platforms.hasNext())
3793 27 Sep 07 nicklas 354             {
3793 27 Sep 07 nicklas 355               Platform item = platforms.next();
3793 27 Sep 07 nicklas 356               RawDataType rdt = item.getRawDataType();
3793 27 Sep 07 nicklas 357               int itemId = item.getId();
3793 27 Sep 07 nicklas 358               String name = HTML.encodeTags(item.getName());
3793 27 Sep 07 nicklas 359               String tooltip = mode.isSelectionMode() ? 
3793 27 Sep 07 nicklas 360                   "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 
6221 10 Jan 13 nicklas 361               
3793 27 Sep 07 nicklas 362               index++;
3793 27 Sep 07 nicklas 363               numListed++;
3793 27 Sep 07 nicklas 364               %>
3793 27 Sep 07 nicklas 365               <tbl:row>
7943 04 May 21 nicklas 366                 <tbl:header clazz="row-index bg-filled-100">
7943 04 May 21 nicklas 367                   <div class="index-<%=mode.getName()%>">
7943 04 May 21 nicklas 368                     <div class="index <%=index>999?"index-smaller":""%>"><%=index%></div>
7943 04 May 21 nicklas 369                     <div class="check">
7943 04 May 21 nicklas 370                       <base:input
7943 04 May 21 nicklas 371                         type="checkbox" 
7943 04 May 21 nicklas 372                         name="<%=itemId%>" 
7943 04 May 21 nicklas 373                         value="<%=itemId%>" 
7943 04 May 21 nicklas 374                         title="<%=name%>" 
7943 04 May 21 nicklas 375                         checked="<%=cc.getSelected().contains(itemId)%>"
7943 04 May 21 nicklas 376                         visible="<%=mode.hasCheck()%>"
7943 04 May 21 nicklas 377                       />
7943 04 May 21 nicklas 378                       <base:input 
7943 04 May 21 nicklas 379                         type="radio" 
7943 04 May 21 nicklas 380                         name="item_id" 
7943 04 May 21 nicklas 381                         value="<%=itemId%>" 
7943 04 May 21 nicklas 382                         title="<%=name%>" 
7943 04 May 21 nicklas 383                         checked="<%=selectedItemId == itemId%>"
7943 04 May 21 nicklas 384                         visible="<%=mode.hasRadio()%>"
7943 04 May 21 nicklas 385                       />
7943 04 May 21 nicklas 386                     </div>
7943 04 May 21 nicklas 387                     <div class="icons">
8026 15 Dec 21 nicklas 388                       <base:icon
8026 15 Dec 21 nicklas 389                         image="star.png"
8026 15 Dec 21 nicklas 390                         tooltip="This is a default item for the current project"
8026 15 Dec 21 nicklas 391                         visible="<%=activeProject != null && activeProject.isDefaultItem(item)%>" 
8026 15 Dec 21 nicklas 392                       />
7943 04 May 21 nicklas 393                       <base:icon 
7943 04 May 21 nicklas 394                         image="deleted.png"
7943 04 May 21 nicklas 395                         id="<%="delete."+itemId %>"
7943 04 May 21 nicklas 396                         subclass="<%=deletePermission ? "table-delete-item" : "disabled" %>"
7943 04 May 21 nicklas 397                         data-item-id="<%=itemId%>"
7943 04 May 21 nicklas 398                         tooltip="This item has been scheduled for deletion" 
7943 04 May 21 nicklas 399                         visible="<%=item.isRemoved()%>"
7943 04 May 21 nicklas 400                       />
7943 04 May 21 nicklas 401                     </div>
7943 04 May 21 nicklas 402                   </div>
7943 04 May 21 nicklas 403                 </tbl:header>
6289 05 Jun 13 nicklas 404                 <tbl:cell column="name"><div 
6289 05 Jun 13 nicklas 405                   class="link table-item"
6289 05 Jun 13 nicklas 406                   data-item-id="<%=itemId%>"
6289 05 Jun 13 nicklas 407                   data-no-edit="<%=writePermission ? 0 : 1 %>" 
6289 05 Jun 13 nicklas 408                   tabindex="0"
3793 27 Sep 07 nicklas 409                   title="<%=tooltip%>"><%=name%></div></tbl:cell>
4332 12 Jun 08 martin 410                 <tbl:cell column="id"><%=item.getId()%></tbl:cell>
3798 28 Sep 07 nicklas 411                 <tbl:cell column="externalId"><%=item.getExternalId()%></tbl:cell>
3793 27 Sep 07 nicklas 412                 <tbl:cell column="fileOnly"><%=item.isFileOnly() ? "yes" : "no"%></tbl:cell>
3793 27 Sep 07 nicklas 413                 <tbl:cell column="channels"><%=rdt == null ? "N/A" : rdt.getChannels()%></tbl:cell>
3793 27 Sep 07 nicklas 414                 <tbl:cell column="rawDataType">
3793 27 Sep 07 nicklas 415                   <%=item.isFileOnly() ? "N/A" : (rdt == null ? "<i>- any -</i>" : rdt.getName())%>
3793 27 Sep 07 nicklas 416                 </tbl:cell>
3793 27 Sep 07 nicklas 417                 <tbl:cell column="variants">
3793 27 Sep 07 nicklas 418                   <%
3793 27 Sep 07 nicklas 419                   variantQuery.setParameter("platform", itemId, Type.INT);
3793 27 Sep 07 nicklas 420                   try
3793 27 Sep 07 nicklas 421                   {
3793 27 Sep 07 nicklas 422                     String separator = "";
3793 27 Sep 07 nicklas 423                     for (PlatformVariant v : variantQuery.list(dc))
3793 27 Sep 07 nicklas 424                     {
3793 27 Sep 07 nicklas 425                       out.write(separator);
3793 27 Sep 07 nicklas 426                       if (mode.hasPropertyLink())
3793 27 Sep 07 nicklas 427                       {
3793 27 Sep 07 nicklas 428                         out.write(Base.getLinkedName(ID, v, false, mode.hasEditLink()));
3793 27 Sep 07 nicklas 429                       }
3793 27 Sep 07 nicklas 430                       else
3793 27 Sep 07 nicklas 431                       {
3793 27 Sep 07 nicklas 432                         out.write(HTML.encodeTags(v.getName()));
3793 27 Sep 07 nicklas 433                       }
3793 27 Sep 07 nicklas 434                       separator = ", ";
3793 27 Sep 07 nicklas 435                     }
3793 27 Sep 07 nicklas 436                   }
3793 27 Sep 07 nicklas 437                   catch (Throwable t)
3793 27 Sep 07 nicklas 438                   {
3793 27 Sep 07 nicklas 439                     %>
3793 27 Sep 07 nicklas 440                     <div class="error"><%=t.getMessage()%></div>
3793 27 Sep 07 nicklas 441                     <%
3793 27 Sep 07 nicklas 442                   }
3793 27 Sep 07 nicklas 443                   %>
3793 27 Sep 07 nicklas 444                   <base:icon
6289 05 Jun 13 nicklas 445                     id="<%="new-variant."+itemId %>"
3793 27 Sep 07 nicklas 446                     image="add.png" 
6289 05 Jun 13 nicklas 447                     subclass="auto-init"
6289 05 Jun 13 nicklas 448                     data-auto-init="new-variant"
6289 05 Jun 13 nicklas 449                     data-item-id="<%=itemId %>"
3793 27 Sep 07 nicklas 450                     tooltip="Create new variant" 
3793 27 Sep 07 nicklas 451                     visible="<%=mode.hasEditLink() && createVariantPermission %>"
3793 27 Sep 07 nicklas 452                   />
3793 27 Sep 07 nicklas 453                 </tbl:cell>
3793 27 Sep 07 nicklas 454                 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
6045 03 Apr 12 nicklas 455                 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
6045 03 Apr 12 nicklas 456                   <tbl:cell column="xt-columns" />
6045 03 Apr 12 nicklas 457                 </tbl:xt-cells>
3793 27 Sep 07 nicklas 458               </tbl:row>
3793 27 Sep 07 nicklas 459               <%
3793 27 Sep 07 nicklas 460               }
3793 27 Sep 07 nicklas 461             }
5954 13 Feb 12 nicklas 462           if (numListed == 0)
5954 13 Feb 12 nicklas 463           {
5954 13 Feb 12 nicklas 464             %>
6604 18 Nov 14 nicklas 465             <tbl:panel subclass="bg-filled-50">
5954 13 Feb 12 nicklas 466               <div class="messagecontainer note">
5954 13 Feb 12 nicklas 467               <%=platforms == null || platforms.getTotalCount() == 0 ? "No platforms were found" : "No platforms on this page. Please select another page!" %>
5954 13 Feb 12 nicklas 468               </div>
5954 13 Feb 12 nicklas 469             </tbl:panel>
5954 13 Feb 12 nicklas 470             <%
5954 13 Feb 12 nicklas 471           }
3793 27 Sep 07 nicklas 472           %>
3793 27 Sep 07 nicklas 473           </tbl:rows>
3793 27 Sep 07 nicklas 474       </tbl:data>
3793 27 Sep 07 nicklas 475     </tbl:table>
5954 13 Feb 12 nicklas 476     </div>
5954 13 Feb 12 nicklas 477     
5951 09 Feb 12 nicklas 478     <base:buttongroup subclass="dialogbuttons">
6289 05 Jun 13 nicklas 479       <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
6289 05 Jun 13 nicklas 480       <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
6289 05 Jun 13 nicklas 481       <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
3793 27 Sep 07 nicklas 482     </base:buttongroup>
5951 09 Feb 12 nicklas 483     
3793 27 Sep 07 nicklas 484   </base:body>
3793 27 Sep 07 nicklas 485   </base:page>
3793 27 Sep 07 nicklas 486   <%
3793 27 Sep 07 nicklas 487 }
3793 27 Sep 07 nicklas 488 finally
3793 27 Sep 07 nicklas 489 {
3793 27 Sep 07 nicklas 490   if (platforms != null) platforms.close();
3793 27 Sep 07 nicklas 491   if (dc != null) dc.close();
3793 27 Sep 07 nicklas 492 }
3793 27 Sep 07 nicklas 493 %>