www/lims/platetypes/list_platetypes.jsp

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