7407 |
05 Oct 17 |
nicklas |
1 |
<%-- $Id: index.jsp 6192 2012-10-31 12:34:19Z nicklas $ |
7407 |
05 Oct 17 |
nicklas |
2 |
------------------------------------------------------------------ |
7407 |
05 Oct 17 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
7407 |
05 Oct 17 |
nicklas |
Copyright (C) 2007 Nicklas Nordborg |
7407 |
05 Oct 17 |
nicklas |
5 |
|
7407 |
05 Oct 17 |
nicklas |
6 |
This file is part of BASE - BioArray Software Environment. |
7407 |
05 Oct 17 |
nicklas |
7 |
Available at http://base.thep.lu.se/ |
7407 |
05 Oct 17 |
nicklas |
8 |
|
7407 |
05 Oct 17 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
7407 |
05 Oct 17 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
7407 |
05 Oct 17 |
nicklas |
11 |
as published by the Free Software Foundation; either version 3 |
7407 |
05 Oct 17 |
nicklas |
12 |
of the License, or (at your option) any later version. |
7407 |
05 Oct 17 |
nicklas |
13 |
|
7407 |
05 Oct 17 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
7407 |
05 Oct 17 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7407 |
05 Oct 17 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7407 |
05 Oct 17 |
nicklas |
17 |
GNU General Public License for more details. |
7407 |
05 Oct 17 |
nicklas |
18 |
|
7407 |
05 Oct 17 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
7407 |
05 Oct 17 |
nicklas |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7407 |
05 Oct 17 |
nicklas |
21 |
------------------------------------------------------------------ |
7407 |
05 Oct 17 |
nicklas |
22 |
|
7407 |
05 Oct 17 |
nicklas |
23 |
@author Nicklas |
7407 |
05 Oct 17 |
nicklas |
24 |
@version 2.0 |
7407 |
05 Oct 17 |
nicklas |
25 |
--%> |
7407 |
05 Oct 17 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
7407 |
05 Oct 17 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl" |
7407 |
05 Oct 17 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
7407 |
05 Oct 17 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
7407 |
05 Oct 17 |
nicklas |
30 |
import="net.sf.basedb.core.Type" |
7407 |
05 Oct 17 |
nicklas |
31 |
import="net.sf.basedb.core.Include" |
7407 |
05 Oct 17 |
nicklas |
32 |
import="net.sf.basedb.core.User" |
7407 |
05 Oct 17 |
nicklas |
33 |
import="net.sf.basedb.core.UserDevice" |
7407 |
05 Oct 17 |
nicklas |
34 |
import="net.sf.basedb.core.ItemQuery" |
7407 |
05 Oct 17 |
nicklas |
35 |
import="net.sf.basedb.core.Permission" |
7407 |
05 Oct 17 |
nicklas |
36 |
import="net.sf.basedb.core.ItemContext" |
7407 |
05 Oct 17 |
nicklas |
37 |
import="net.sf.basedb.core.ItemQuery" |
7407 |
05 Oct 17 |
nicklas |
38 |
import="net.sf.basedb.core.PermissionDeniedException" |
7407 |
05 Oct 17 |
nicklas |
39 |
import="net.sf.basedb.core.ItemAlreadyExistsException" |
7407 |
05 Oct 17 |
nicklas |
40 |
import="net.sf.basedb.util.RemovableUtil" |
7407 |
05 Oct 17 |
nicklas |
41 |
import="net.sf.basedb.clients.web.Base" |
7407 |
05 Oct 17 |
nicklas |
42 |
import="net.sf.basedb.clients.web.WebException" |
7407 |
05 Oct 17 |
nicklas |
43 |
import="net.sf.basedb.util.Values" |
7407 |
05 Oct 17 |
nicklas |
44 |
import="net.sf.basedb.clients.web.util.HTML" |
7407 |
05 Oct 17 |
nicklas |
45 |
import="net.sf.basedb.core.plugin.GuiContext" |
7407 |
05 Oct 17 |
nicklas |
46 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
7407 |
05 Oct 17 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
7407 |
05 Oct 17 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
7407 |
05 Oct 17 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveAction" |
7407 |
05 Oct 17 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" |
7407 |
05 Oct 17 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnExportRenderer" |
7604 |
25 Feb 19 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
7407 |
05 Oct 17 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
7407 |
05 Oct 17 |
nicklas |
55 |
import="java.util.Set" |
7407 |
05 Oct 17 |
nicklas |
56 |
import="java.util.HashSet" |
7407 |
05 Oct 17 |
nicklas |
57 |
import="java.util.List" |
7407 |
05 Oct 17 |
nicklas |
58 |
import="java.util.ArrayList" |
7407 |
05 Oct 17 |
nicklas |
59 |
import="java.util.Collections" |
7407 |
05 Oct 17 |
nicklas |
60 |
import="java.util.Arrays" |
7407 |
05 Oct 17 |
nicklas |
61 |
%> |
7407 |
05 Oct 17 |
nicklas |
62 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7407 |
05 Oct 17 |
nicklas |
63 |
<%! |
7816 |
05 Jun 20 |
nicklas |
64 |
private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,client,verified,lastUsed,lastRemoteId,location,description"); |
7407 |
05 Oct 17 |
nicklas |
65 |
private static final Item itemType = Item.USERDEVICE; |
7407 |
05 Oct 17 |
nicklas |
66 |
%> |
7407 |
05 Oct 17 |
nicklas |
67 |
<% |
7407 |
05 Oct 17 |
nicklas |
68 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
7407 |
05 Oct 17 |
nicklas |
69 |
final String ID = sc.getId(); |
7407 |
05 Oct 17 |
nicklas |
70 |
final String cmd = request.getParameter("cmd"); |
7407 |
05 Oct 17 |
nicklas |
71 |
final String root = request.getContextPath()+"/"; |
7407 |
05 Oct 17 |
nicklas |
72 |
final String mode = request.getParameter("mode"); |
7407 |
05 Oct 17 |
nicklas |
73 |
final String callback = request.getParameter("callback"); |
7407 |
05 Oct 17 |
nicklas |
74 |
final String itemId = request.getParameter("item_id"); |
7407 |
05 Oct 17 |
nicklas |
75 |
final String listPage = "list_devices.jsp?ID="+ID |
7407 |
05 Oct 17 |
nicklas |
76 |
+(mode == null ? "" : "&mode="+mode) |
7407 |
05 Oct 17 |
nicklas |
77 |
+(callback == null ? "" : "&callback="+callback) |
7407 |
05 Oct 17 |
nicklas |
78 |
+(itemId == null ? "" : "&item_id="+itemId); |
7407 |
05 Oct 17 |
nicklas |
79 |
final String viewPage = "view_device.jsp?ID="+ID; |
7407 |
05 Oct 17 |
nicklas |
80 |
final String editPage = "edit_device.jsp?ID="+ID; |
7407 |
05 Oct 17 |
nicklas |
81 |
|
7407 |
05 Oct 17 |
nicklas |
82 |
String forward = null; |
7407 |
05 Oct 17 |
nicklas |
83 |
String redirect = null; |
7407 |
05 Oct 17 |
nicklas |
84 |
String message = null; |
7407 |
05 Oct 17 |
nicklas |
85 |
DbControl dc = null; |
7407 |
05 Oct 17 |
nicklas |
86 |
|
7407 |
05 Oct 17 |
nicklas |
87 |
try |
7407 |
05 Oct 17 |
nicklas |
88 |
{ |
7407 |
05 Oct 17 |
nicklas |
89 |
if (cmd == null || "List".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
90 |
{ |
7407 |
05 Oct 17 |
nicklas |
91 |
// Display the list page without updatinging the current context |
7407 |
05 Oct 17 |
nicklas |
92 |
Base.getAndSetCurrentContext(sc, itemType, null, defaultContext, true); |
7407 |
05 Oct 17 |
nicklas |
93 |
redirect = listPage; |
7407 |
05 Oct 17 |
nicklas |
94 |
} |
7407 |
05 Oct 17 |
nicklas |
95 |
else if ("UpdateContext".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
96 |
{ |
7407 |
05 Oct 17 |
nicklas |
97 |
// Display the list page after updating the current context from the request parameters |
7407 |
05 Oct 17 |
nicklas |
98 |
Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
99 |
redirect = listPage; |
7407 |
05 Oct 17 |
nicklas |
100 |
} |
7407 |
05 Oct 17 |
nicklas |
101 |
else if ("LoadContext".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
102 |
{ |
7407 |
05 Oct 17 |
nicklas |
103 |
// Display the list page after loading a saved context |
7407 |
05 Oct 17 |
nicklas |
104 |
int contextId = Values.getInt(request.getParameter("context")); |
7407 |
05 Oct 17 |
nicklas |
105 |
Base.loadContext(sc, contextId, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
106 |
redirect = listPage; |
7407 |
05 Oct 17 |
nicklas |
107 |
} |
7407 |
05 Oct 17 |
nicklas |
108 |
|
7407 |
05 Oct 17 |
nicklas |
109 |
else if ("ViewItem".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
110 |
{ |
7407 |
05 Oct 17 |
nicklas |
111 |
// Display the view page for a single item |
7407 |
05 Oct 17 |
nicklas |
112 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
113 |
forward = viewPage; |
7407 |
05 Oct 17 |
nicklas |
114 |
} |
7407 |
05 Oct 17 |
nicklas |
115 |
else if ("EditItem".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
116 |
{ |
7407 |
05 Oct 17 |
nicklas |
117 |
// Display the edit page for a single item (should be opened in a popup) |
7407 |
05 Oct 17 |
nicklas |
118 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
119 |
redirect = editPage; |
7407 |
05 Oct 17 |
nicklas |
120 |
} |
7407 |
05 Oct 17 |
nicklas |
121 |
else if ("UpdateItem".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
122 |
{ |
7407 |
05 Oct 17 |
nicklas |
123 |
// Update the properties on an item (will close the popup) |
7407 |
05 Oct 17 |
nicklas |
124 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
125 |
final int maxRecent = Base.getMaxRecent(sc); |
7954 |
12 May 21 |
nicklas |
126 |
dc = sc.newDbControl(":Edit "+itemType); |
7605 |
26 Feb 19 |
nicklas |
127 |
UserDevice device = cc.getObject("item"); |
7407 |
05 Oct 17 |
nicklas |
128 |
if (device == null) |
7407 |
05 Oct 17 |
nicklas |
129 |
{ |
7407 |
05 Oct 17 |
nicklas |
130 |
throw new PermissionDeniedException(Permission.CREATE, "device"); |
7407 |
05 Oct 17 |
nicklas |
131 |
} |
7407 |
05 Oct 17 |
nicklas |
132 |
else |
7407 |
05 Oct 17 |
nicklas |
133 |
{ |
7407 |
05 Oct 17 |
nicklas |
134 |
dc.reattachItem(device, false); |
7407 |
05 Oct 17 |
nicklas |
135 |
message = "Device updated"; |
7407 |
05 Oct 17 |
nicklas |
136 |
} |
7407 |
05 Oct 17 |
nicklas |
137 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.USERDEVICE), device); |
7604 |
25 Feb 19 |
nicklas |
138 |
ExtensionsInvoker<OnSaveAction> invoker = EditUtil.useOnSaveExtensions(jspContext); |
7407 |
05 Oct 17 |
nicklas |
139 |
try |
7407 |
05 Oct 17 |
nicklas |
140 |
{ |
7407 |
05 Oct 17 |
nicklas |
141 |
device.setName(Values.getStringOrNull(request.getParameter("name"))); |
7407 |
05 Oct 17 |
nicklas |
142 |
device.setDescription(Values.getStringOrNull(request.getParameter("description"))); |
7407 |
05 Oct 17 |
nicklas |
143 |
|
7407 |
05 Oct 17 |
nicklas |
144 |
// OnSave extensions |
7407 |
05 Oct 17 |
nicklas |
145 |
invoker.render(OnSaveRenderer.ON_SAVE); |
7407 |
05 Oct 17 |
nicklas |
146 |
dc.commit(); |
7407 |
05 Oct 17 |
nicklas |
147 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
7407 |
05 Oct 17 |
nicklas |
148 |
} |
7407 |
05 Oct 17 |
nicklas |
149 |
catch (Exception ex) |
7407 |
05 Oct 17 |
nicklas |
150 |
{ |
7407 |
05 Oct 17 |
nicklas |
151 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
7407 |
05 Oct 17 |
nicklas |
152 |
throw ex; |
7407 |
05 Oct 17 |
nicklas |
153 |
} |
7407 |
05 Oct 17 |
nicklas |
154 |
finally |
7407 |
05 Oct 17 |
nicklas |
155 |
{ |
7407 |
05 Oct 17 |
nicklas |
156 |
cc.removeObject("item"); |
7407 |
05 Oct 17 |
nicklas |
157 |
} |
7407 |
05 Oct 17 |
nicklas |
158 |
} |
7407 |
05 Oct 17 |
nicklas |
159 |
else if ("DeleteItem".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
160 |
{ |
7407 |
05 Oct 17 |
nicklas |
161 |
// Delete a single item and then return to the view page |
7954 |
12 May 21 |
nicklas |
162 |
dc = sc.newDbControl(":Delete "+itemType); |
7407 |
05 Oct 17 |
nicklas |
163 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
164 |
RemovableUtil.delete(dc, itemType, Collections.singleton(cc.getId())); |
7407 |
05 Oct 17 |
nicklas |
165 |
dc.commit(); |
7407 |
05 Oct 17 |
nicklas |
166 |
redirect = listPage; |
7407 |
05 Oct 17 |
nicklas |
167 |
} |
7407 |
05 Oct 17 |
nicklas |
168 |
else if ("DeleteItems".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
169 |
{ |
7407 |
05 Oct 17 |
nicklas |
170 |
// Delete all selected items on the list page |
7954 |
12 May 21 |
nicklas |
171 |
dc = sc.newDbControl(":Delete "+itemType); |
7407 |
05 Oct 17 |
nicklas |
172 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
173 |
int numTotal = cc.getSelected().size(); |
7407 |
05 Oct 17 |
nicklas |
174 |
int numRemoved = RemovableUtil.delete(dc, itemType, cc.getSelected()); |
7407 |
05 Oct 17 |
nicklas |
175 |
dc.commit(); |
7407 |
05 Oct 17 |
nicklas |
176 |
if (numTotal != numRemoved) |
7407 |
05 Oct 17 |
nicklas |
177 |
{ |
7407 |
05 Oct 17 |
nicklas |
178 |
message = (numRemoved == 0 ? "No" : "Only "+numRemoved+" of "+numTotal) + " items could be deleted, because you have no DELETE permission"; |
7407 |
05 Oct 17 |
nicklas |
179 |
} |
7407 |
05 Oct 17 |
nicklas |
180 |
redirect = listPage; |
7407 |
05 Oct 17 |
nicklas |
181 |
} |
7407 |
05 Oct 17 |
nicklas |
182 |
else if ("ExportItems".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
183 |
{ |
7407 |
05 Oct 17 |
nicklas |
184 |
// Run an export plugin in a list context |
7407 |
05 Oct 17 |
nicklas |
185 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
186 |
dc = sc.newDbControl(":Export "+itemType); |
7407 |
05 Oct 17 |
nicklas |
187 |
final User user = cc.getInclude().contains(Include.OTHERS) ? |
7407 |
05 Oct 17 |
nicklas |
188 |
null : User.getById(dc, sc.getLoggedInUserId()); |
7407 |
05 Oct 17 |
nicklas |
189 |
final ItemQuery<UserDevice> query = UserDevice.getQuery(user); |
7914 |
23 Feb 21 |
nicklas |
190 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
191 |
cc.configureQuery(dc, query, jspContext, true); |
7407 |
05 Oct 17 |
nicklas |
192 |
cc.setQuery(query); |
7604 |
25 Feb 19 |
nicklas |
193 |
ExtensionsInvoker<ListColumnAction<UserDevice,?>> listInvoker = ListColumnUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
194 |
listInvoker.render(new ListColumnExportRenderer<UserDevice>(cc)); |
7407 |
05 Oct 17 |
nicklas |
195 |
dc.close(); |
7407 |
05 Oct 17 |
nicklas |
196 |
redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+devices"; |
7407 |
05 Oct 17 |
nicklas |
197 |
} |
7407 |
05 Oct 17 |
nicklas |
198 |
else if ("ExportItem".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
199 |
{ |
7407 |
05 Oct 17 |
nicklas |
200 |
// Run an export plugin in single-item context |
7407 |
05 Oct 17 |
nicklas |
201 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
202 |
redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+device"; |
7407 |
05 Oct 17 |
nicklas |
203 |
} |
7407 |
05 Oct 17 |
nicklas |
204 |
else if ("RunListPlugin".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
205 |
{ |
7407 |
05 Oct 17 |
nicklas |
206 |
// Run another plugin in a list context |
7407 |
05 Oct 17 |
nicklas |
207 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
208 |
dc = sc.newDbControl(":Run plugin "+itemType); |
7407 |
05 Oct 17 |
nicklas |
209 |
final User user = cc.getInclude().contains(Include.OTHERS) ? |
7407 |
05 Oct 17 |
nicklas |
210 |
null : User.getById(dc, sc.getLoggedInUserId()); |
7407 |
05 Oct 17 |
nicklas |
211 |
final ItemQuery<UserDevice> query = UserDevice.getQuery(user); |
7914 |
23 Feb 21 |
nicklas |
212 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7407 |
05 Oct 17 |
nicklas |
213 |
cc.configureQuery(dc, query, false); |
7407 |
05 Oct 17 |
nicklas |
214 |
dc.close(); |
7407 |
05 Oct 17 |
nicklas |
215 |
cc.setQuery(query); |
7407 |
05 Oct 17 |
nicklas |
216 |
redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=OTHER&title=Run+plugin"; |
7407 |
05 Oct 17 |
nicklas |
217 |
} |
7407 |
05 Oct 17 |
nicklas |
218 |
else if ("RunPlugin".equals(cmd)) |
7407 |
05 Oct 17 |
nicklas |
219 |
{ |
7407 |
05 Oct 17 |
nicklas |
220 |
// Run another plugin in single-item context |
7407 |
05 Oct 17 |
nicklas |
221 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7407 |
05 Oct 17 |
nicklas |
222 |
redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; |
7407 |
05 Oct 17 |
nicklas |
223 |
} |
7407 |
05 Oct 17 |
nicklas |
224 |
else |
7407 |
05 Oct 17 |
nicklas |
225 |
{ |
7407 |
05 Oct 17 |
nicklas |
226 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
7407 |
05 Oct 17 |
nicklas |
227 |
} |
7407 |
05 Oct 17 |
nicklas |
228 |
} |
7407 |
05 Oct 17 |
nicklas |
229 |
finally |
7407 |
05 Oct 17 |
nicklas |
230 |
{ |
7407 |
05 Oct 17 |
nicklas |
231 |
if (dc != null) dc.close(); |
7407 |
05 Oct 17 |
nicklas |
232 |
} |
7407 |
05 Oct 17 |
nicklas |
233 |
|
7407 |
05 Oct 17 |
nicklas |
234 |
if (forward != null) |
7407 |
05 Oct 17 |
nicklas |
235 |
{ |
7407 |
05 Oct 17 |
nicklas |
236 |
sc.setSessionSetting("alert-message", message); |
7407 |
05 Oct 17 |
nicklas |
237 |
pageContext.forward(forward); |
7407 |
05 Oct 17 |
nicklas |
238 |
} |
7407 |
05 Oct 17 |
nicklas |
239 |
else if (redirect != null) |
7407 |
05 Oct 17 |
nicklas |
240 |
{ |
7407 |
05 Oct 17 |
nicklas |
241 |
sc.setSessionSetting("alert-message", message); |
7407 |
05 Oct 17 |
nicklas |
242 |
response.sendRedirect(redirect); |
7407 |
05 Oct 17 |
nicklas |
243 |
} |
7407 |
05 Oct 17 |
nicklas |
244 |
else if (message == null) |
7407 |
05 Oct 17 |
nicklas |
245 |
{ |
7407 |
05 Oct 17 |
nicklas |
246 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0"); |
7407 |
05 Oct 17 |
nicklas |
247 |
} |
7407 |
05 Oct 17 |
nicklas |
248 |
else |
7407 |
05 Oct 17 |
nicklas |
249 |
{ |
7407 |
05 Oct 17 |
nicklas |
250 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message)); |
7407 |
05 Oct 17 |
nicklas |
251 |
} |
7407 |
05 Oct 17 |
nicklas |
252 |
%> |
7407 |
05 Oct 17 |
nicklas |
253 |
|