www/views/reporterlists/view_reporterlist.jsp

Code
Comments
Other
Rev Date Author Line
2149 04 Apr 06 nicklas 1 <%-- $Id$
2149 04 Apr 06 nicklas 2   ------------------------------------------------------------------
3675 16 Aug 07 jari 3   Copyright (C) 2006 Nicklas Nordborg, Martin Svensson
3675 16 Aug 07 jari 4   Copyright (C) 2007 Martin Svensson
2150 05 Apr 06 nicklas 5   
2150 05 Apr 06 nicklas 6   This file is part of BASE - BioArray Software Environment.
2150 05 Apr 06 nicklas 7   Available at http://base.thep.lu.se/
2150 05 Apr 06 nicklas 8   
2150 05 Apr 06 nicklas 9   BASE is free software; you can redistribute it and/or modify it
2150 05 Apr 06 nicklas 10   under the terms of the GNU General Public License as published by
4476 05 Sep 08 jari 11   the Free Software Foundation; either version 3 of the License, or
2150 05 Apr 06 nicklas 12   (at your option) any later version.
2150 05 Apr 06 nicklas 13   
2150 05 Apr 06 nicklas 14   BASE is distributed in the hope that it will be useful, but
2150 05 Apr 06 nicklas 15   WITHOUT ANY WARRANTY; without even the implied warranty of
2150 05 Apr 06 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2150 05 Apr 06 nicklas 17   General Public License for more details.
2150 05 Apr 06 nicklas 18   
2149 04 Apr 06 nicklas 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/>.
2149 04 Apr 06 nicklas 21   ------------------------------------------------------------------
2149 04 Apr 06 nicklas 22
2149 04 Apr 06 nicklas 23   @author Nicklas
2149 04 Apr 06 nicklas 24   @version 2.0
2149 04 Apr 06 nicklas 25 --%>
5426 24 Sep 10 nicklas 26 <%@ page pageEncoding="UTF-8" session="false"
2149 04 Apr 06 nicklas 27   import="net.sf.basedb.core.SessionControl"
2149 04 Apr 06 nicklas 28   import="net.sf.basedb.core.DbControl"
2149 04 Apr 06 nicklas 29   import="net.sf.basedb.core.SystemItems"
3547 03 Jul 07 martin 30   import="net.sf.basedb.core.Group"
2149 04 Apr 06 nicklas 31   import="net.sf.basedb.core.Item"
2149 04 Apr 06 nicklas 32   import="net.sf.basedb.core.ItemContext"
5045 12 Aug 09 martin 33   import="net.sf.basedb.core.ItemResultList"
2149 04 Apr 06 nicklas 34   import="net.sf.basedb.core.Permission"
2149 04 Apr 06 nicklas 35   import="net.sf.basedb.core.ReporterList"
2149 04 Apr 06 nicklas 36   import="net.sf.basedb.core.User"
2149 04 Apr 06 nicklas 37   import="net.sf.basedb.core.RawDataType"
3547 03 Jul 07 martin 38   import="net.sf.basedb.core.MultiPermissions"
2149 04 Apr 06 nicklas 39   import="net.sf.basedb.core.PermissionDeniedException"
2149 04 Apr 06 nicklas 40   import="net.sf.basedb.core.PluginDefinition"
2149 04 Apr 06 nicklas 41   import="net.sf.basedb.core.plugin.GuiContext"
2149 04 Apr 06 nicklas 42   import="net.sf.basedb.core.plugin.Plugin"
3547 03 Jul 07 martin 43   import="net.sf.basedb.core.Project"
2149 04 Apr 06 nicklas 44   import="net.sf.basedb.clients.web.Base"
2386 15 Jun 06 martin 45   import="net.sf.basedb.clients.web.PermissionUtil"
2149 04 Apr 06 nicklas 46   import="net.sf.basedb.clients.web.util.HTML"
2753 20 Oct 06 nicklas 47   import="net.sf.basedb.util.Values"
4698 10 Dec 08 nicklas 48   import="net.sf.basedb.util.formatter.Formatter"
4698 10 Dec 08 nicklas 49   import="net.sf.basedb.clients.web.formatter.FormatterFactory"
4879 03 Apr 09 nicklas 50   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
4879 03 Apr 09 nicklas 51   import="net.sf.basedb.clients.web.extensions.JspContext"
4879 03 Apr 09 nicklas 52   import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
7604 25 Feb 19 nicklas 53   import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" 
4879 03 Apr 09 nicklas 54   import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
4879 03 Apr 09 nicklas 55   import="net.sf.basedb.util.extensions.ExtensionsInvoker"
4698 10 Dec 08 nicklas 56   import="java.util.Date"
3547 03 Jul 07 martin 57   import="java.util.Collections"
2149 04 Apr 06 nicklas 58   import="java.util.List"
2149 04 Apr 06 nicklas 59   import="java.util.Map"
3547 03 Jul 07 martin 60   import="java.util.Set"
2149 04 Apr 06 nicklas 61 %>
2149 04 Apr 06 nicklas 62 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
2149 04 Apr 06 nicklas 63 <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
2149 04 Apr 06 nicklas 64 <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
2149 04 Apr 06 nicklas 65 <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
4879 03 Apr 09 nicklas 66 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
2149 04 Apr 06 nicklas 67 <%!
2149 04 Apr 06 nicklas 68   private static final Item itemType = Item.REPORTERLIST;
2149 04 Apr 06 nicklas 69   private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM);
2149 04 Apr 06 nicklas 70 %>
2149 04 Apr 06 nicklas 71 <%
2149 04 Apr 06 nicklas 72 final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
2149 04 Apr 06 nicklas 73 final String ID = sc.getId();
2149 04 Apr 06 nicklas 74 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
2149 04 Apr 06 nicklas 75 final int itemId = cc.getId();
2149 04 Apr 06 nicklas 76 final float scale = Base.getScale(sc);
7954 12 May 21 nicklas 77 final DbControl dc = sc.newDbControl(":View "+itemType);
2149 04 Apr 06 nicklas 78 try
2149 04 Apr 06 nicklas 79 {
4698 10 Dec 08 nicklas 80   Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
2149 04 Apr 06 nicklas 81   Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
2149 04 Apr 06 nicklas 82
2149 04 Apr 06 nicklas 83   String title = null;
2149 04 Apr 06 nicklas 84   final ReporterList reporterList = ReporterList.getById(dc, itemId);
2149 04 Apr 06 nicklas 85   
2149 04 Apr 06 nicklas 86   final boolean writePermission = reporterList.hasPermission(Permission.WRITE);
2149 04 Apr 06 nicklas 87   final boolean deletePermission = reporterList.hasPermission(Permission.DELETE);
2149 04 Apr 06 nicklas 88   final boolean sharePermission = reporterList.hasPermission(Permission.SET_PERMISSION);
2918 15 Nov 06 nicklas 89   final boolean setOwnerPermission = reporterList.hasPermission(Permission.SET_OWNER);
4003 26 Nov 07 nicklas 90   final boolean isRemoved = reporterList.isRemoved();
4003 26 Nov 07 nicklas 91   final boolean isUsed = isRemoved && reporterList.isUsed();
4003 26 Nov 07 nicklas 92   final boolean deletePermanentlyPermission = deletePermission && !isUsed;
2918 15 Nov 06 nicklas 93   final boolean isOwner = reporterList.isOwner();
4879 03 Apr 09 nicklas 94   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, reporterList);
7604 25 Feb 19 nicklas 95   ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext);
2149 04 Apr 06 nicklas 96   %>
6311 23 Aug 13 nicklas 97   <base:page title="<%=title%>" id="view-page">
6311 23 Aug 13 nicklas 98   <base:head scripts="tabcontrol-2.js,~reporterlists.js" styles="toolbar.css,headertabcontrol.css,path.css,table.css">
4879 03 Apr 09 nicklas 99     <ext:scripts context="<%=jspContext%>" />
4879 03 Apr 09 nicklas 100     <ext:stylesheets context="<%=jspContext%>" />
2149 04 Apr 06 nicklas 101   </base:head>
2149 04 Apr 06 nicklas 102   <base:body>
5939 30 Jan 12 nicklas 103     <p:path><p:pathelement
5939 30 Jan 12 nicklas 104       title="Reporter lists" href="<%="index.jsp?ID="+ID%>" 
5939 30 Jan 12 nicklas 105       /><p:pathelement title="<%=HTML.encodeTags(reporterList.getName())%>" 
5939 30 Jan 12 nicklas 106       /></p:path>
6311 23 Aug 13 nicklas 107     <div id="page-data" data-item-id="<%=itemId%>"></div>
2149 04 Apr 06 nicklas 108     
5939 30 Jan 12 nicklas 109     <t:tabcontrol 
5939 30 Jan 12 nicklas 110       id="main" 
5939 30 Jan 12 nicklas 111       subclass="content mastertabcontrol" 
6311 23 Aug 13 nicklas 112       active="properties">
2149 04 Apr 06 nicklas 113     <t:tab id="properties" title="Properties">
5939 30 Jan 12 nicklas 114       <div>
5939 30 Jan 12 nicklas 115       <table class="fullform bottomborder">
5939 30 Jan 12 nicklas 116       <tr>
5939 30 Jan 12 nicklas 117         <th class="itemstatus">
4003 26 Nov 07 nicklas 118           <base:icon 
5946 03 Feb 12 nicklas 119             image="shared.png" 
5939 30 Jan 12 nicklas 120             visible="<%=reporterList.isShared()%>"
5939 30 Jan 12 nicklas 121             tooltip="This item is shared to other users, groups and/or projects"
5939 30 Jan 12 nicklas 122           />
5939 30 Jan 12 nicklas 123           <base:icon 
6311 23 Aug 13 nicklas 124             id="btnDeletePermanently"
5946 03 Feb 12 nicklas 125             image="deleted.png"
5939 30 Jan 12 nicklas 126             tooltip="This item has been flagged for deletion. Click to delete it now."
5939 30 Jan 12 nicklas 127             enabled="<%=deletePermanentlyPermission %>"
5939 30 Jan 12 nicklas 128             visible="<%=isRemoved%>" 
5939 30 Jan 12 nicklas 129           />
6311 23 Aug 13 nicklas 130           <base:icon 
6311 23 Aug 13 nicklas 131             id="btnUsingItems"
6311 23 Aug 13 nicklas 132             image="used.png" 
5939 30 Jan 12 nicklas 133             tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one"
5939 30 Jan 12 nicklas 134             visible="<%=isRemoved && isUsed%>" />
5939 30 Jan 12 nicklas 135         </th>
5939 30 Jan 12 nicklas 136         <td style="padding: 0px;">
6605 18 Nov 14 nicklas 137           <tbl:toolbar subclass="bottomborder bg-filled-50">
5939 30 Jan 12 nicklas 138             <tbl:button 
6311 23 Aug 13 nicklas 139               id="btnEdit"
5942 01 Feb 12 nicklas 140               disabled="<%=!writePermission%>" 
5945 02 Feb 12 nicklas 141               image="edit.png" 
5939 30 Jan 12 nicklas 142               title="Edit&hellip;" 
5939 30 Jan 12 nicklas 143               tooltip="<%=writePermission ? "Edit this reporter list" : "You do not have permission to edit this reporter list"%>" 
5939 30 Jan 12 nicklas 144             />
5939 30 Jan 12 nicklas 145             <tbl:button 
6311 23 Aug 13 nicklas 146               id="btnDelete"
5942 01 Feb 12 nicklas 147               disabled="<%=!deletePermission%>" 
5946 03 Feb 12 nicklas 148               image="delete.png" 
5939 30 Jan 12 nicklas 149               title="Delete"
5939 30 Jan 12 nicklas 150               visible="<%=!reporterList.isRemoved()%>"
5939 30 Jan 12 nicklas 151               tooltip="<%=deletePermission ? "Delete this reporter list" : "You do not have permission to delete this reporter list"%>" 
5939 30 Jan 12 nicklas 152             />
5939 30 Jan 12 nicklas 153             <tbl:button 
6311 23 Aug 13 nicklas 154               id="btnRestore"
5942 01 Feb 12 nicklas 155               disabled="<%=!writePermission%>" 
5946 03 Feb 12 nicklas 156               image="restore.png" 
5939 30 Jan 12 nicklas 157               title="Restore"
5939 30 Jan 12 nicklas 158               visible="<%=reporterList.isRemoved()%>"
5939 30 Jan 12 nicklas 159               tooltip="<%=writePermission ? "Restore this reporter list" : "You do not have permission to restore this reporter list"%>" 
5939 30 Jan 12 nicklas 160             />
5939 30 Jan 12 nicklas 161             <tbl:button 
6311 23 Aug 13 nicklas 162               id="btnShare"
5942 01 Feb 12 nicklas 163               disabled="<%=!sharePermission%>"
5945 02 Feb 12 nicklas 164               image="share.png"
5939 30 Jan 12 nicklas 165               title="Share&hellip;" 
5939 30 Jan 12 nicklas 166               tooltip="<%=sharePermission ? "Share this reporter list to other user, groups and projects" : "You do not have permission to share this formula"%>"
5939 30 Jan 12 nicklas 167             />
5939 30 Jan 12 nicklas 168             <tbl:button 
6311 23 Aug 13 nicklas 169               id="btnSetOwner"
5942 01 Feb 12 nicklas 170               disabled="<%=!setOwnerPermission%>"
5939 30 Jan 12 nicklas 171               image="take_ownership.png"
5939 30 Jan 12 nicklas 172               title="Set owner&hellip;"
5939 30 Jan 12 nicklas 173               tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>"
5939 30 Jan 12 nicklas 174             />
5939 30 Jan 12 nicklas 175             <tbl:button
6311 23 Aug 13 nicklas 176               id="btnMergeUnion"
6311 23 Aug 13 nicklas 177               data-merge-type="union"
5939 30 Jan 12 nicklas 178               visible="<%=writePermission%>"
5939 30 Jan 12 nicklas 179               image="set_operations/union_small.png"
5939 30 Jan 12 nicklas 180               title="Union&hellip;"
5939 30 Jan 12 nicklas 181               tooltip="Add reporters from other lists to this list"
5939 30 Jan 12 nicklas 182             />
5939 30 Jan 12 nicklas 183             <tbl:button
6311 23 Aug 13 nicklas 184               id="btnMergeIntersection"
6311 23 Aug 13 nicklas 185               data-merge-type="intersection"
5939 30 Jan 12 nicklas 186               visible="<%=writePermission%>"
5939 30 Jan 12 nicklas 187               image="set_operations/intersection_small.png"
5939 30 Jan 12 nicklas 188               title="Intersection&hellip;"
5939 30 Jan 12 nicklas 189               tooltip="Keep only reporters that are present in other lists"
5939 30 Jan 12 nicklas 190             />
5939 30 Jan 12 nicklas 191             <tbl:button
6311 23 Aug 13 nicklas 192               id="btnMergeComplement"
6311 23 Aug 13 nicklas 193               data-merge-type="complement"
5939 30 Jan 12 nicklas 194               visible="<%=writePermission%>"
5939 30 Jan 12 nicklas 195               image="set_operations/complement_small.png"
5939 30 Jan 12 nicklas 196               title="Complement&hellip;"
5939 30 Jan 12 nicklas 197               tooltip="Remove reporters in other lists from this list"
5939 30 Jan 12 nicklas 198             />
5939 30 Jan 12 nicklas 199             <tbl:button 
6311 23 Aug 13 nicklas 200               id="btnImport"
5946 03 Feb 12 nicklas 201               image="import.png" 
6311 23 Aug 13 nicklas 202               data-plugin-type="IMPORT"  
5939 30 Jan 12 nicklas 203               title="Import&hellip;" 
5939 30 Jan 12 nicklas 204               tooltip="Import data" 
5939 30 Jan 12 nicklas 205               visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
5939 30 Jan 12 nicklas 206             />
5939 30 Jan 12 nicklas 207             <tbl:button 
6311 23 Aug 13 nicklas 208               id="btnExport"
6311 23 Aug 13 nicklas 209               image="export.png"
6311 23 Aug 13 nicklas 210               data-plugin-type="EXPORT" 
5939 30 Jan 12 nicklas 211               title="Export&hellip;" 
5939 30 Jan 12 nicklas 212               tooltip="Export data" 
5939 30 Jan 12 nicklas 213               visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
5939 30 Jan 12 nicklas 214             />
5939 30 Jan 12 nicklas 215             <tbl:button 
6311 23 Aug 13 nicklas 216               id="btnRunPlugin"
6311 23 Aug 13 nicklas 217               image="runplugin.png"  
6311 23 Aug 13 nicklas 218               data-plugin-type="OTHER" 
5939 30 Jan 12 nicklas 219               title="Run plugin&hellip;" 
5939 30 Jan 12 nicklas 220               tooltip="Run a plugin" 
5939 30 Jan 12 nicklas 221               visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
5939 30 Jan 12 nicklas 222             />
5939 30 Jan 12 nicklas 223             <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
7604 25 Feb 19 nicklas 224               wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/>
5939 30 Jan 12 nicklas 225             <tbl:button
5939 30 Jan 12 nicklas 226               image="help.png"
6311 23 Aug 13 nicklas 227               subclass="auto-init"
6311 23 Aug 13 nicklas 228               data-auto-init="help"
6311 23 Aug 13 nicklas 229               data-help-id="reporterlist.view.properties"
5939 30 Jan 12 nicklas 230               title="Help&hellip;"
5939 30 Jan 12 nicklas 231               tooltip="Get help about this page"
5939 30 Jan 12 nicklas 232             />
5939 30 Jan 12 nicklas 233           </tbl:toolbar>
5939 30 Jan 12 nicklas 234         </td>
5939 30 Jan 12 nicklas 235       </tr>
2149 04 Apr 06 nicklas 236       <tr>
5939 30 Jan 12 nicklas 237         <th>Name</th>
2149 04 Apr 06 nicklas 238         <td><%=HTML.encodeTags(reporterList.getName())%></td>
2149 04 Apr 06 nicklas 239       </tr>
2149 04 Apr 06 nicklas 240       <tr>
5939 30 Jan 12 nicklas 241         <th>Registered</th>
4698 10 Dec 08 nicklas 242         <td><%=dateFormatter.format(reporterList.getEntryDate())%></td>
4698 10 Dec 08 nicklas 243       </tr>
4698 10 Dec 08 nicklas 244       <tr>
5939 30 Jan 12 nicklas 245         <th>External ID</th>
2149 04 Apr 06 nicklas 246         <td><%=HTML.encodeTags(reporterList.getExternalId())%></td>
2149 04 Apr 06 nicklas 247       </tr>
2149 04 Apr 06 nicklas 248       <tr>
5939 30 Jan 12 nicklas 249         <th>Size</th>
4299 14 May 08 nicklas 250         <td><%=reporterList.getSize()%></td>
2428 27 Jun 06 nicklas 251       </tr>
2428 27 Jun 06 nicklas 252       <tr>
5939 30 Jan 12 nicklas 253         <th>Experiment</th>
3547 03 Jul 07 martin 254         <td><base:propertyvalue item="<%=reporterList%>" property="experiment" /></td>
3547 03 Jul 07 martin 255       </tr>
2428 27 Jun 06 nicklas 256       <tr>
5939 30 Jan 12 nicklas 257         <th>Owner</th>
2428 27 Jun 06 nicklas 258         <td><base:propertyvalue item="<%=reporterList%>" property="owner" /></td>
2149 04 Apr 06 nicklas 259       </tr>
2149 04 Apr 06 nicklas 260       <tr>
5939 30 Jan 12 nicklas 261         <th>Permissions</th>
5939 30 Jan 12 nicklas 262         <td><%=PermissionUtil.getFullPermissionNames(reporterList)%></td>
5939 30 Jan 12 nicklas 263       </tr>
5939 30 Jan 12 nicklas 264       <tr>
5939 30 Jan 12 nicklas 265         <th>Description</th>
2149 04 Apr 06 nicklas 266         <td><%=HTML.niceFormat(reporterList.getDescription())%></td>
2149 04 Apr 06 nicklas 267       </tr>
2149 04 Apr 06 nicklas 268       </table>
5939 30 Jan 12 nicklas 269       </div>
5502 18 Nov 10 nicklas 270       <jsp:include page="../../common/anytoany/list_anytoany.jsp">
5502 18 Nov 10 nicklas 271         <jsp:param name="ID" value="<%=ID%>" />
5502 18 Nov 10 nicklas 272         <jsp:param name="item_type" value="<%=itemType.name()%>" />
5502 18 Nov 10 nicklas 273         <jsp:param name="item_id" value="<%=itemId%>" />
5502 18 Nov 10 nicklas 274         <jsp:param name="title" value="Other items related to this reporter list" />
5502 18 Nov 10 nicklas 275       </jsp:include>
5939 30 Jan 12 nicklas 276       <jsp:include page="../../common/share/list_share.jsp">
5939 30 Jan 12 nicklas 277         <jsp:param name="ID" value="<%=ID%>" />
5939 30 Jan 12 nicklas 278         <jsp:param name="item_type" value="<%=itemType.name()%>" />
5939 30 Jan 12 nicklas 279         <jsp:param name="item_id" value="<%=itemId%>" />
5939 30 Jan 12 nicklas 280         <jsp:param name="title" value="Shared to" />
5939 30 Jan 12 nicklas 281       </jsp:include>
2149 04 Apr 06 nicklas 282     </t:tab>
2149 04 Apr 06 nicklas 283     
2428 27 Jun 06 nicklas 284     <t:tab id="reporters" title="Reporters" 
2428 27 Jun 06 nicklas 285       tooltip="List the reporters in this reporter list" />
2149 04 Apr 06 nicklas 286     
2149 04 Apr 06 nicklas 287     </t:tabcontrol>
2149 04 Apr 06 nicklas 288
2149 04 Apr 06 nicklas 289   </base:body>
2149 04 Apr 06 nicklas 290   </base:page>
2149 04 Apr 06 nicklas 291   <%
2149 04 Apr 06 nicklas 292 }
2149 04 Apr 06 nicklas 293 finally
2149 04 Apr 06 nicklas 294 {
2149 04 Apr 06 nicklas 295   if (dc != null) dc.close();
2149 04 Apr 06 nicklas 296 }
2149 04 Apr 06 nicklas 297
2149 04 Apr 06 nicklas 298 %>