source: extensions/net.sf.basedb.genepattern/trunk/resources/edit_server.jsp @ 1104

Last change on this file since 1104 was 1104, checked in by Nicklas Nordborg, 14 years ago

References #224: Add a "Test" button on the GenePattern? 'edit server' page

The "Test" button is now in place. The installation may still be a bit messy since the GenePattern? jar files has to be manually installed. We need a way to figure out what to do about that. Another problem is that the default configuration of a GenePattern? server allows a user to login with any username. Non-existing accounts are automatically created and given server admin permissions! It is possible to lock this down, but there is no web interface for adminitration of GenePattern? user accounts. There is some documentation about this: http://www.broad.mit.edu/cancer/software/genepattern/tutorial/gp_web_client.html#_Securing_the_Server

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.4 KB
Line 
1<%-- $Id: edit_server.jsp 1104 2009-05-29 12:53:33Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2009 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 2
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA  02111-1307, USA.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25--%>
26<%@ page
27  pageEncoding="UTF-8"
28  session="false"
29  import="net.sf.basedb.core.Application"
30  import="net.sf.basedb.core.BioAssaySet"
31  import="net.sf.basedb.core.Experiment"
32  import="net.sf.basedb.core.Directory"
33  import="net.sf.basedb.core.User"
34  import="net.sf.basedb.core.DbControl"
35  import="net.sf.basedb.core.SessionControl"
36  import="net.sf.basedb.core.Path"
37  import="net.sf.basedb.core.Presets"
38  import="net.sf.basedb.core.Presets.Preset"
39  import="net.sf.basedb.clients.web.Base"
40  import="net.sf.basedb.clients.web.util.HTML"
41  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
42  import="net.sf.basedb.util.Values"
43%>
44<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
45<%
46final SessionControl sc = Base.getExistingSessionControl(request, true);
47final String ID = sc.getId();
48final float scale = Base.getScale(sc);
49final String homeUrl = ExtensionsControl.getHomeUrl("net.sf.basedb.genepattern.options");
50
51final String gpServer = Values.getStringOrNull(request.getParameter("gpServer"));
52String presetsXml = sc.getUserClientSetting("net.sf.basedb.genepattern.options");
53Presets presets = new Presets();
54if (presetsXml != null) presets.loadFrom(presetsXml);
55Preset server = gpServer == null ? presets.getDefault() : presets.getPreset(gpServer);
56String title = "Options for " + (gpServer == null ? "new" : gpServer);
57%>
58<base:page type="popup" title="<%=HTML.encodeTags(title)%>">
59<base:head scripts="tabcontrol.js" styles="tabcontrol.css">
60  <script language="JavaScript">
61  function validate()
62  {
63    var frm = document.forms['options'];
64    if (frm.gpServer.value == '')
65    {
66      alert('A server URL must be specified');
67      frm.gpServer.focus();
68      return false;
69    }
70    else if (frm.gpLogin.value == '')
71    {
72      alert('A login must be specified');
73      frm.gpServer.focus();
74      return false;
75    }
76    return true;
77  }
78
79  function saveSettings()
80  {
81    if (validate()) document.forms['options'].submit();
82  }
83  function testServer()
84  {
85    if (!validate()) return;
86    var frm = document.forms['options'];
87    var url = '<%=homeUrl%>/TestServer.servlet';
88    url += '?server=' + encodeURIComponent(frm.gpServer.value);
89    url += '&login=' + encodeURIComponent(frm.gpLogin.value);
90    url += '&password=' + encodeURIComponent(frm.gpPassword.value);
91    Main.openPopup(url, 'TestGPServer', 700, 500);
92  }
93  </script>
94</base:head>
95<base:body>
96  <form action="submit.jsp?ID=<%=ID%>" method="post" name="options" onsubmit="return false;">
97  <input type=hidden name="cmd" value="SaveServer">
98 
99  <h3 class="docked"><%=HTML.encodeTags(title)%></h3>
100  <div class="boxedbottom">
101    <table class="form" cellspacing=0>
102    <tr>
103      <td class="prompt">Server URL</td>
104      <td><input class="text required" type="text" name="gpServer" size="40"
105          value="<%=HTML.encodeTags(server.getName())%>"></td>
106    </tr>
107    <tr>
108      <td class="prompt">Login</td>
109      <td><input class="text required" type="text" name="gpLogin" size="40"
110          value="<%=HTML.encodeTags(server.getSetting("server.login"))%>"></td>
111    </tr>
112    <tr>
113      <td class="prompt">Password</td>
114      <td><input class="text" type="password" name="gpPassword" size="20"
115          value="<%=HTML.encodeTags(server.getSetting("server.password"))%>"></td>
116    </tr>
117    </table>
118  </div>
119  <p>
120  <table align="center">
121  <tr>
122    <td width="33%"><base:button onclick="testServer();" title="Test" 
123      image="<%=homeUrl + "/images/genepattern.gif" %>" 
124      onclick="testServer()" /></td>
125    <td width="33%"><base:button onclick="saveSettings();" title="Save" /></td>
126    <td width="33%"><base:button onclick="window.close();" title="Cancel" /></td>
127  </tr>
128  </table>
129</base:body>
130</base:page>
Note: See TracBrowser for help on using the repository browser.