978 |
27 Feb 09 |
nicklas |
1 |
<%-- $Id $ |
978 |
27 Feb 09 |
nicklas |
2 |
------------------------------------------------------------------ |
978 |
27 Feb 09 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
978 |
27 Feb 09 |
nicklas |
4 |
|
1416 |
20 Oct 11 |
nicklas |
5 |
This file is part of the MeV Launcher extension for BASE. |
1416 |
20 Oct 11 |
nicklas |
6 |
Available at http://baseplugins.thep.lu.se/ |
1416 |
20 Oct 11 |
nicklas |
7 |
BASE main site: http://base.thep.lu.se/ |
1416 |
20 Oct 11 |
nicklas |
8 |
----------------------------------------------------------- |
1416 |
20 Oct 11 |
nicklas |
9 |
|
1416 |
20 Oct 11 |
nicklas |
10 |
This is free software; you can redistribute it and/or |
978 |
27 Feb 09 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
978 |
27 Feb 09 |
nicklas |
12 |
as published by the Free Software Foundation; either version 3 |
978 |
27 Feb 09 |
nicklas |
13 |
of the License, or (at your option) any later version. |
1416 |
20 Oct 11 |
nicklas |
14 |
|
1416 |
20 Oct 11 |
nicklas |
15 |
The software is distributed in the hope that it will be useful, |
978 |
27 Feb 09 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
978 |
27 Feb 09 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
978 |
27 Feb 09 |
nicklas |
18 |
GNU General Public License for more details. |
1416 |
20 Oct 11 |
nicklas |
19 |
|
978 |
27 Feb 09 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
978 |
27 Feb 09 |
nicklas |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
978 |
27 Feb 09 |
nicklas |
22 |
------------------------------------------------------------------ |
978 |
27 Feb 09 |
nicklas |
23 |
|
978 |
27 Feb 09 |
nicklas |
24 |
@author Nicklas |
978 |
27 Feb 09 |
nicklas |
25 |
--%> |
1026 |
07 Apr 09 |
nicklas |
26 |
<%@ page |
1026 |
07 Apr 09 |
nicklas |
27 |
pageEncoding="UTF-8" |
1026 |
07 Apr 09 |
nicklas |
28 |
session="false" |
978 |
27 Feb 09 |
nicklas |
29 |
import="net.sf.basedb.core.Application" |
978 |
27 Feb 09 |
nicklas |
30 |
import="net.sf.basedb.core.SessionControl" |
978 |
27 Feb 09 |
nicklas |
31 |
import="net.sf.basedb.core.DbControl" |
978 |
27 Feb 09 |
nicklas |
32 |
import="net.sf.basedb.core.User" |
978 |
27 Feb 09 |
nicklas |
33 |
import="net.sf.basedb.clients.web.Base" |
978 |
27 Feb 09 |
nicklas |
34 |
import="net.sf.basedb.clients.web.WebException" |
978 |
27 Feb 09 |
nicklas |
35 |
import="net.sf.basedb.clients.web.util.HTML" |
978 |
27 Feb 09 |
nicklas |
36 |
import="net.sf.basedb.util.Values" |
978 |
27 Feb 09 |
nicklas |
37 |
%> |
978 |
27 Feb 09 |
nicklas |
38 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
978 |
27 Feb 09 |
nicklas |
39 |
<% |
978 |
27 Feb 09 |
nicklas |
40 |
SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
978 |
27 Feb 09 |
nicklas |
41 |
String ID = sc.getId(); |
978 |
27 Feb 09 |
nicklas |
42 |
String cmd = request.getParameter("cmd"); |
978 |
27 Feb 09 |
nicklas |
43 |
String root = request.getContextPath()+"/"; |
978 |
27 Feb 09 |
nicklas |
44 |
|
978 |
27 Feb 09 |
nicklas |
45 |
String redirect = null; |
978 |
27 Feb 09 |
nicklas |
46 |
String message = null; |
978 |
27 Feb 09 |
nicklas |
47 |
|
978 |
27 Feb 09 |
nicklas |
48 |
try |
978 |
27 Feb 09 |
nicklas |
49 |
{ |
978 |
27 Feb 09 |
nicklas |
50 |
if ("SaveOptions".equals(cmd)) |
978 |
27 Feb 09 |
nicklas |
51 |
{ |
978 |
27 Feb 09 |
nicklas |
52 |
int maxMemory = Values.getInt(request.getParameter("maxMemory"), 512); |
978 |
27 Feb 09 |
nicklas |
53 |
String mm = maxMemory == 512 ? null : Integer.toString(maxMemory); |
978 |
27 Feb 09 |
nicklas |
54 |
sc.setUserClientSetting("net.sf.basedb.mev.launchmev.jvm.maxmemory", mm); |
978 |
27 Feb 09 |
nicklas |
55 |
message = "Settings saved"; |
978 |
27 Feb 09 |
nicklas |
56 |
} |
978 |
27 Feb 09 |
nicklas |
57 |
else |
978 |
27 Feb 09 |
nicklas |
58 |
{ |
978 |
27 Feb 09 |
nicklas |
59 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
978 |
27 Feb 09 |
nicklas |
60 |
} |
978 |
27 Feb 09 |
nicklas |
61 |
} |
978 |
27 Feb 09 |
nicklas |
62 |
finally |
978 |
27 Feb 09 |
nicklas |
63 |
{} |
978 |
27 Feb 09 |
nicklas |
64 |
if (message == null) |
978 |
27 Feb 09 |
nicklas |
65 |
{ |
978 |
27 Feb 09 |
nicklas |
66 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&wait=0"); |
978 |
27 Feb 09 |
nicklas |
67 |
} |
978 |
27 Feb 09 |
nicklas |
68 |
else |
978 |
27 Feb 09 |
nicklas |
69 |
{ |
978 |
27 Feb 09 |
nicklas |
70 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&message="+HTML.urlEncode(message)); |
978 |
27 Feb 09 |
nicklas |
71 |
} |
978 |
27 Feb 09 |
nicklas |
72 |
%> |
978 |
27 Feb 09 |
nicklas |
73 |
|