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