www/admin/plugintypes/edit_plugintype.jsp

Code
Comments
Other
Rev Date Author Line
1382 27 Sep 05 nicklas 1 <%-- $Id$
1382 27 Sep 05 nicklas 2   ------------------------------------------------------------------
3675 16 Aug 07 jari 3   Copyright (C) 2005 Nicklas Nordborg
5425 23 Sep 10 nicklas 4   Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
1382 27 Sep 05 nicklas 5
2304 22 May 06 jari 6   This file is part of BASE - BioArray Software Environment.
2304 22 May 06 jari 7   Available at http://base.thep.lu.se/
1382 27 Sep 05 nicklas 8
1382 27 Sep 05 nicklas 9   BASE is free software; you can redistribute it and/or
1382 27 Sep 05 nicklas 10   modify it under the terms of the GNU General Public License
4476 05 Sep 08 jari 11   as published by the Free Software Foundation; either version 3
1382 27 Sep 05 nicklas 12   of the License, or (at your option) any later version.
1382 27 Sep 05 nicklas 13
1382 27 Sep 05 nicklas 14   BASE is distributed in the hope that it will be useful,
1382 27 Sep 05 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
1382 27 Sep 05 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1382 27 Sep 05 nicklas 17   GNU General Public License for more details.
1382 27 Sep 05 nicklas 18
1382 27 Sep 05 nicklas 19   You should have received a copy of the GNU General Public License
4510 11 Sep 08 jari 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
1382 27 Sep 05 nicklas 21   ------------------------------------------------------------------
1382 27 Sep 05 nicklas 22
1382 27 Sep 05 nicklas 23
1382 27 Sep 05 nicklas 24   @author Nicklas
1382 27 Sep 05 nicklas 25   @version 2.0
1382 27 Sep 05 nicklas 26 --%>
5426 24 Sep 10 nicklas 27 <%@ page pageEncoding="UTF-8" session="false"
1382 27 Sep 05 nicklas 28   import="net.sf.basedb.core.SessionControl"
1382 27 Sep 05 nicklas 29   import="net.sf.basedb.core.DbControl"
1382 27 Sep 05 nicklas 30   import="net.sf.basedb.core.Item"
1991 15 Feb 06 nicklas 31   import="net.sf.basedb.core.ItemContext"
1382 27 Sep 05 nicklas 32   import="net.sf.basedb.core.Permission"
1382 27 Sep 05 nicklas 33   import="net.sf.basedb.core.PluginType"
1991 15 Feb 06 nicklas 34   import="net.sf.basedb.core.PermissionDeniedException"
1382 27 Sep 05 nicklas 35   import="net.sf.basedb.clients.web.Base"
1382 27 Sep 05 nicklas 36   import="net.sf.basedb.clients.web.util.HTML"
2753 20 Oct 06 nicklas 37   import="net.sf.basedb.util.Values"
5508 19 Nov 10 nicklas 38   import="net.sf.basedb.core.plugin.GuiContext"
5508 19 Nov 10 nicklas 39   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
5508 19 Nov 10 nicklas 40   import="net.sf.basedb.clients.web.extensions.JspContext"
5508 19 Nov 10 nicklas 41   import="net.sf.basedb.clients.web.extensions.edit.EditUtil"
7604 25 Feb 19 nicklas 42   import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction"
5508 19 Nov 10 nicklas 43   import="net.sf.basedb.util.extensions.ExtensionsInvoker"
1382 27 Sep 05 nicklas 44 %>
1382 27 Sep 05 nicklas 45 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
1382 27 Sep 05 nicklas 46 <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
6147 21 Sep 12 nicklas 47 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
1382 27 Sep 05 nicklas 48 <%
1991 15 Feb 06 nicklas 49 final Item itemType = Item.PLUGINTYPE;
1991 15 Feb 06 nicklas 50 final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
1991 15 Feb 06 nicklas 51 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
1991 15 Feb 06 nicklas 52 final int itemId = cc.getId();
1382 27 Sep 05 nicklas 53 final String ID = sc.getId();
1382 27 Sep 05 nicklas 54 final float scale = Base.getScale(sc);
7954 12 May 21 nicklas 55 final DbControl dc = sc.newDbControl(":Edit "+itemType);
1382 27 Sep 05 nicklas 56 try
1382 27 Sep 05 nicklas 57 {
1382 27 Sep 05 nicklas 58   String title = null;
1382 27 Sep 05 nicklas 59   PluginType pluginType = null;
1991 15 Feb 06 nicklas 60
1991 15 Feb 06 nicklas 61   if (itemId == 0)
1382 27 Sep 05 nicklas 62   {
1382 27 Sep 05 nicklas 63     title = "Create plugin type";
1991 15 Feb 06 nicklas 64     cc.removeObject("item");
1382 27 Sep 05 nicklas 65   }
1382 27 Sep 05 nicklas 66   else
1382 27 Sep 05 nicklas 67   {
1991 15 Feb 06 nicklas 68     pluginType = PluginType.getById(dc, itemId);
6305 09 Aug 13 nicklas 69     pluginType.checkPermission(Permission.WRITE);
1991 15 Feb 06 nicklas 70     cc.setObject("item", pluginType);
1382 27 Sep 05 nicklas 71     title = "Edit plugin type -- " + HTML.encodeTags(pluginType.getName());
1382 27 Sep 05 nicklas 72   }
1991 15 Feb 06 nicklas 73   
5508 19 Nov 10 nicklas 74   JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), pluginType);
7604 25 Feb 19 nicklas 75   ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext);
1382 27 Sep 05 nicklas 76   %>
6305 09 Aug 13 nicklas 77   <base:page type="popup" title="<%=title%>" id="edit-page">
6305 09 Aug 13 nicklas 78   <base:head scripts="tabcontrol-2.js,~plugintypes.js" styles="tabcontrol.css">
5508 19 Nov 10 nicklas 79     <ext:scripts context="<%=jspContext%>" />
5508 19 Nov 10 nicklas 80     <ext:stylesheets context="<%=jspContext%>" />
1382 27 Sep 05 nicklas 81   </base:head>
6305 09 Aug 13 nicklas 82   <base:body>
5922 11 Jan 12 nicklas 83     <h1><%=title%> <base:help tabcontrol="settings" /></h1>
6162 10 Oct 12 nicklas 84     <form action="index.jsp?ID=<%=ID%>" method="post" name="pluginType">
1991 15 Feb 06 nicklas 85     <input type="hidden" name="cmd" value="UpdateItem">
1991 15 Feb 06 nicklas 86
5922 11 Jan 12 nicklas 87     <t:tabcontrol id="settings"
5922 11 Jan 12 nicklas 88       subclass="content dialogtabcontrol"
5508 19 Nov 10 nicklas 89       position="bottom" remember="<%=pluginType != null%>"
5508 19 Nov 10 nicklas 90       extensions="<%=invoker%>">
6305 09 Aug 13 nicklas 91     <t:tab id="info" title="Plugin type" helpid="plugintype.edit">
5922 11 Jan 12 nicklas 92       <table class="fullform input100 smaller">
1382 27 Sep 05 nicklas 93       <tr>
5922 11 Jan 12 nicklas 94         <th>Name</th>
6305 09 Aug 13 nicklas 95         <td><input class="text required auto-init" data-auto-init="<%=pluginType == null ? "focus-select" : "focus" %>"
6305 09 Aug 13 nicklas 96           type="text" name="name" 
1991 15 Feb 06 nicklas 97           value="<%=HTML.encodeTags(pluginType == null ? 
1991 15 Feb 06 nicklas 98             Values.getString(cc.getPropertyValue("name"), "New plugin type") : pluginType.getName())%>" 
5922 11 Jan 12 nicklas 99           maxlength="<%=PluginType.MAX_NAME_LENGTH%>"></td>
5922 11 Jan 12 nicklas 100         <td></td>
1382 27 Sep 05 nicklas 101       </tr>
1382 27 Sep 05 nicklas 102       <tr>
5922 11 Jan 12 nicklas 103         <th>Interface</th>
6217 14 Dec 12 nicklas 104         <td><input class="text required" type="text" name="interfaceName" 
1991 15 Feb 06 nicklas 105           value="<%=HTML.encodeTags(pluginType == null ? cc.getPropertyValue("interfaceName") : pluginType.getInterfaceName())%>" 
5922 11 Jan 12 nicklas 106           maxlength="<%=PluginType.MAX_INTERFACENAME_LENGTH%>"></td>
5922 11 Jan 12 nicklas 107         <td></td>
1382 27 Sep 05 nicklas 108       </tr>
1382 27 Sep 05 nicklas 109       <tr>
5922 11 Jan 12 nicklas 110         <th>Jar file</th>
6217 14 Dec 12 nicklas 111         <td><input class="text" type="text" name="jarFile" 
5613 18 Apr 11 nicklas 112           value="<%=HTML.encodeTags(pluginType == null ? cc.getPropertyValue("jarFile") : pluginType.getJarFile())%>" 
5922 11 Jan 12 nicklas 113           maxlength="<%=PluginType.MAX_JARFILE_LENGTH%>"></td>
5922 11 Jan 12 nicklas 114         <td></td>
1382 27 Sep 05 nicklas 115       </tr>
5922 11 Jan 12 nicklas 116       <tr class="dynamic">
5922 11 Jan 12 nicklas 117         <th>Description</th>
5922 11 Jan 12 nicklas 118         <td>
6217 14 Dec 12 nicklas 119           <textarea class="text" rows="6" name="description" id="description"
1991 15 Feb 06 nicklas 120             ><%=HTML.encodeTags(pluginType == null ? cc.getPropertyValue("description") : pluginType.getDescription())%></textarea>
1382 27 Sep 05 nicklas 121         </td>
5922 11 Jan 12 nicklas 122         <td style="width: 20px;">
6215 13 Dec 12 nicklas 123           <base:zoom textarea="description" title="Description" />
5922 11 Jan 12 nicklas 124         </td>
1382 27 Sep 05 nicklas 125       </tr>
1382 27 Sep 05 nicklas 126       </table>
1382 27 Sep 05 nicklas 127     </t:tab>
1382 27 Sep 05 nicklas 128     </t:tabcontrol>
5922 11 Jan 12 nicklas 129     </form>
5922 11 Jan 12 nicklas 130     
5922 11 Jan 12 nicklas 131     <div class="legend">
5946 03 Feb 12 nicklas 132       <base:icon image="required.png" />= required information
5922 11 Jan 12 nicklas 133     </div>
1382 27 Sep 05 nicklas 134
5922 11 Jan 12 nicklas 135     <base:buttongroup subclass="dialogbuttons">
6305 09 Aug 13 nicklas 136       <base:button id="btnSave" title="Save" />
6305 09 Aug 13 nicklas 137       <base:button id="close" title="Cancel" />
5922 11 Jan 12 nicklas 138     </base:buttongroup>
1382 27 Sep 05 nicklas 139   </base:body>
1382 27 Sep 05 nicklas 140   </base:page>
1382 27 Sep 05 nicklas 141   <%
1382 27 Sep 05 nicklas 142 }
1382 27 Sep 05 nicklas 143 finally
1382 27 Sep 05 nicklas 144 {
1382 27 Sep 05 nicklas 145   if (dc != null) dc.close();
1382 27 Sep 05 nicklas 146 }
1382 27 Sep 05 nicklas 147 %>