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