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

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

Fixes #221: Configure GenePattern? server

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 3.9 KB
Line 
1<%-- $Id: edit_server.jsp 1102 2009-05-29 06:14:55Z 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  </script>
84</base:head>
85<base:body>
86  <form action="submit.jsp?ID=<%=ID%>" method="post" name="options" onsubmit="return false;">
87  <input type=hidden name="cmd" value="SaveServer">
88 
89  <h3 class="docked"><%=HTML.encodeTags(title)%></h3>
90  <div class="boxedbottom">
91    <table class="form" cellspacing=0>
92    <tr>
93      <td class="prompt">Server URL</td>
94      <td><input class="text required" type="text" name="gpServer" size="40"
95          value="<%=HTML.encodeTags(server.getName())%>"></td>
96    </tr>
97    <tr>
98      <td class="prompt">Login</td>
99      <td><input class="text required" type="text" name="gpLogin" size="40"
100          value="<%=HTML.encodeTags(server.getSetting("server.login"))%>"></td>
101    </tr>
102    <tr>
103      <td class="prompt">Password</td>
104      <td><input class="text" type="password" name="gpPassword" size="20"
105          value="<%=HTML.encodeTags(server.getSetting("server.password"))%>"></td>
106    </tr>
107    </table>
108  </div>
109  <p>
110  <table align="center">
111  <tr>
112    <td width="50%"><base:button onclick="saveSettings();" title="Save" /></td>
113    <td width="50%"><base:button onclick="window.close();" title="Cancel" /></td>
114  </tr>
115  </table>
116</base:body>
117</base:page>
Note: See TracBrowser for help on using the repository browser.