4704 |
11 Dec 08 |
martin |
1 |
<%-- $Id$ |
4704 |
11 Dec 08 |
martin |
2 |
------------------------------------------------------------------ |
4704 |
11 Dec 08 |
martin |
3 |
|
4704 |
11 Dec 08 |
martin |
Copyright (C) 2008 Martin Svensson |
4704 |
11 Dec 08 |
martin |
5 |
|
4704 |
11 Dec 08 |
martin |
6 |
This file is part of BASE - BioArray Software Environment. |
4704 |
11 Dec 08 |
martin |
7 |
Available at http://base.thep.lu.se/ |
4704 |
11 Dec 08 |
martin |
8 |
|
4704 |
11 Dec 08 |
martin |
9 |
BASE is free software; you can redistribute it and/or |
4704 |
11 Dec 08 |
martin |
10 |
modify it under the terms of the GNU General Public License |
4704 |
11 Dec 08 |
martin |
11 |
as published by the Free Software Foundation; either version 3 |
4704 |
11 Dec 08 |
martin |
12 |
of the License, or (at your option) any later version. |
4704 |
11 Dec 08 |
martin |
13 |
|
4704 |
11 Dec 08 |
martin |
14 |
BASE is distributed in the hope that it will be useful, |
4704 |
11 Dec 08 |
martin |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4704 |
11 Dec 08 |
martin |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4704 |
11 Dec 08 |
martin |
17 |
GNU General Public License for more details. |
4704 |
11 Dec 08 |
martin |
18 |
|
4704 |
11 Dec 08 |
martin |
19 |
You should have received a copy of the GNU General Public License |
4704 |
11 Dec 08 |
martin |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4704 |
11 Dec 08 |
martin |
21 |
------------------------------------------------------------------ |
4704 |
11 Dec 08 |
martin |
22 |
|
4704 |
11 Dec 08 |
martin |
23 |
@author Martin |
4704 |
11 Dec 08 |
martin |
24 |
@version 2.10 |
4704 |
11 Dec 08 |
martin |
25 |
--%> |
5426 |
24 Sep 10 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
4704 |
11 Dec 08 |
martin |
27 |
import="net.sf.basedb.core.SessionControl" |
4704 |
11 Dec 08 |
martin |
28 |
import="net.sf.basedb.core.DbControl" |
4704 |
11 Dec 08 |
martin |
29 |
import="net.sf.basedb.core.Item" |
4704 |
11 Dec 08 |
martin |
30 |
import="net.sf.basedb.core.ItemContext" |
4704 |
11 Dec 08 |
martin |
31 |
import="net.sf.basedb.core.BioPlate" |
4704 |
11 Dec 08 |
martin |
32 |
import="net.sf.basedb.core.BioWell" |
4704 |
11 Dec 08 |
martin |
33 |
import="net.sf.basedb.core.ItemQuery" |
4704 |
11 Dec 08 |
martin |
34 |
import="net.sf.basedb.core.DataQuery" |
4731 |
20 Jan 09 |
martin |
35 |
import="net.sf.basedb.core.MeasuredBioMaterial" |
4704 |
11 Dec 08 |
martin |
36 |
import="net.sf.basedb.core.Permission" |
4704 |
11 Dec 08 |
martin |
37 |
import="net.sf.basedb.core.PermissionDeniedException" |
4704 |
11 Dec 08 |
martin |
38 |
import="net.sf.basedb.core.data.ReporterData" |
4856 |
27 Mar 09 |
nicklas |
39 |
import="net.sf.basedb.core.query.Orders" |
4856 |
27 Mar 09 |
nicklas |
40 |
import="net.sf.basedb.core.query.Hql" |
4704 |
11 Dec 08 |
martin |
41 |
import="net.sf.basedb.util.RemovableUtil" |
4704 |
11 Dec 08 |
martin |
42 |
import="net.sf.basedb.clients.web.Base" |
4704 |
11 Dec 08 |
martin |
43 |
import="net.sf.basedb.clients.web.WebException" |
4704 |
11 Dec 08 |
martin |
44 |
import="net.sf.basedb.clients.web.util.HTML" |
4704 |
11 Dec 08 |
martin |
45 |
import="net.sf.basedb.util.Values" |
4856 |
27 Mar 09 |
nicklas |
46 |
import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
5492 |
16 Nov 10 |
nicklas |
47 |
import="net.sf.basedb.core.plugin.GuiContext" |
5492 |
16 Nov 10 |
nicklas |
48 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5492 |
16 Nov 10 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5492 |
16 Nov 10 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5492 |
16 Nov 10 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveAction" |
5492 |
16 Nov 10 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" |
6038 |
29 Mar 12 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnExportRenderer" |
7604 |
25 Feb 19 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
6038 |
29 Mar 12 |
nicklas |
56 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
4704 |
11 Dec 08 |
martin |
57 |
import="java.util.List" |
4704 |
11 Dec 08 |
martin |
58 |
import="java.util.Collections" |
4704 |
11 Dec 08 |
martin |
59 |
%> |
4704 |
11 Dec 08 |
martin |
60 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4704 |
11 Dec 08 |
martin |
61 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
4704 |
11 Dec 08 |
martin |
62 |
<%! |
7982 |
14 Jun 21 |
nicklas |
63 |
private static final ItemContext defaultContext = Base.createDefaultContext("row", "row,column,bioMaterial.name", null); |
4704 |
11 Dec 08 |
martin |
64 |
private static final Item itemType = Item.BIOWELL; |
4856 |
27 Mar 09 |
nicklas |
65 |
|
4856 |
27 Mar 09 |
nicklas |
66 |
private static void registerExportFormatters(ItemContext cc) |
4856 |
27 Mar 09 |
nicklas |
67 |
{ |
4856 |
27 Mar 09 |
nicklas |
68 |
cc.setObject("export.formatter.row", new WellCoordinateFormatter(true)); |
4856 |
27 Mar 09 |
nicklas |
69 |
cc.setObject("export.formatter.column", new WellCoordinateFormatter(false)); |
4856 |
27 Mar 09 |
nicklas |
70 |
} |
4704 |
11 Dec 08 |
martin |
71 |
%> |
4704 |
11 Dec 08 |
martin |
72 |
<% |
4704 |
11 Dec 08 |
martin |
73 |
final int bioplateId = Values.getInt(request.getParameter("bioplate_id")); |
4704 |
11 Dec 08 |
martin |
74 |
|
4704 |
11 Dec 08 |
martin |
75 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4704 |
11 Dec 08 |
martin |
76 |
final String ID = sc.getId(); |
4704 |
11 Dec 08 |
martin |
77 |
final String cmd = request.getParameter("cmd"); |
4704 |
11 Dec 08 |
martin |
78 |
final String root = request.getContextPath()+"/"; |
4704 |
11 Dec 08 |
martin |
79 |
final String mode = request.getParameter("mode"); |
4704 |
11 Dec 08 |
martin |
80 |
final String callback = request.getParameter("callback"); |
4704 |
11 Dec 08 |
martin |
81 |
final String itemId = request.getParameter("item_id"); |
4704 |
11 Dec 08 |
martin |
82 |
final String listPage = "list_biowells.jsp?ID="+ID |
4704 |
11 Dec 08 |
martin |
83 |
+"&bioplate_id="+bioplateId |
4704 |
11 Dec 08 |
martin |
84 |
+(mode == null ? "" : "&mode="+mode) |
4704 |
11 Dec 08 |
martin |
85 |
+(callback == null ? "" : "&callback="+callback) |
4704 |
11 Dec 08 |
martin |
86 |
+(itemId == null ? "" : "&item_id="+itemId); |
4704 |
11 Dec 08 |
martin |
87 |
final String viewPage = "view_biowell.jsp?ID="+ID+"&bioplate_id="+bioplateId; |
4704 |
11 Dec 08 |
martin |
88 |
final String editPage = "edit_biowell.jsp?ID="+ID+"&bioplate_id="+bioplateId; |
4704 |
11 Dec 08 |
martin |
89 |
|
4704 |
11 Dec 08 |
martin |
90 |
String forward = null; |
4704 |
11 Dec 08 |
martin |
91 |
String redirect = null; |
4704 |
11 Dec 08 |
martin |
92 |
String message = null; |
4704 |
11 Dec 08 |
martin |
93 |
DbControl dc = null; |
4704 |
11 Dec 08 |
martin |
94 |
|
4704 |
11 Dec 08 |
martin |
95 |
try |
4704 |
11 Dec 08 |
martin |
96 |
{ |
4704 |
11 Dec 08 |
martin |
97 |
if (cmd == null || "List".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
98 |
{ |
4704 |
11 Dec 08 |
martin |
99 |
// Display the list page without updatinging the current context |
4704 |
11 Dec 08 |
martin |
100 |
Base.getAndSetCurrentContext(sc, itemType, null, defaultContext, true); |
4704 |
11 Dec 08 |
martin |
101 |
redirect = listPage; |
4704 |
11 Dec 08 |
martin |
102 |
} |
4704 |
11 Dec 08 |
martin |
103 |
else if ("UpdateContext".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
104 |
{ |
4704 |
11 Dec 08 |
martin |
105 |
// Display the list page after updating the current context from the request parameters |
4704 |
11 Dec 08 |
martin |
106 |
Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4704 |
11 Dec 08 |
martin |
107 |
redirect = listPage; |
4704 |
11 Dec 08 |
martin |
108 |
} |
4704 |
11 Dec 08 |
martin |
109 |
else if ("LoadContext".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
110 |
{ |
4704 |
11 Dec 08 |
martin |
111 |
// Display the list page after loading a saved context |
4704 |
11 Dec 08 |
martin |
112 |
int contextId = Values.getInt(request.getParameter("context")); |
4704 |
11 Dec 08 |
martin |
113 |
Base.loadContext(sc, contextId, defaultContext); |
4704 |
11 Dec 08 |
martin |
114 |
redirect = listPage; |
4704 |
11 Dec 08 |
martin |
115 |
} |
4704 |
11 Dec 08 |
martin |
116 |
else if ("ViewItem".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
117 |
{ |
4704 |
11 Dec 08 |
martin |
118 |
// Display the view page for a single item |
4704 |
11 Dec 08 |
martin |
119 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4704 |
11 Dec 08 |
martin |
120 |
forward = viewPage; |
4704 |
11 Dec 08 |
martin |
121 |
} |
4704 |
11 Dec 08 |
martin |
122 |
else if ("EditItem".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
123 |
{ |
4704 |
11 Dec 08 |
martin |
124 |
// Display the edit page for a single item (should be opened in a popup) |
4704 |
11 Dec 08 |
martin |
125 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4704 |
11 Dec 08 |
martin |
126 |
redirect = editPage; |
4704 |
11 Dec 08 |
martin |
127 |
} |
4704 |
11 Dec 08 |
martin |
128 |
else if ("UpdateItem".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
129 |
{ |
4704 |
11 Dec 08 |
martin |
130 |
// Update the properties on an item (will close the popup) |
4704 |
11 Dec 08 |
martin |
131 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext); |
4731 |
20 Jan 09 |
martin |
132 |
final int maxRecent = Base.getMaxRecent(sc); |
5348 |
20 May 10 |
nicklas |
133 |
message = "Well updated"; |
5492 |
16 Nov 10 |
nicklas |
134 |
|
7954 |
12 May 21 |
nicklas |
135 |
dc = sc.newDbControl(":Edit "+itemType); |
7605 |
26 Feb 19 |
nicklas |
136 |
BioWell biowell = cc.getObject("item"); |
5492 |
16 Nov 10 |
nicklas |
137 |
dc.reattachItem(biowell, false); |
5492 |
16 Nov 10 |
nicklas |
138 |
|
5492 |
16 Nov 10 |
nicklas |
139 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.BIOWELL), biowell); |
7604 |
25 Feb 19 |
nicklas |
140 |
ExtensionsInvoker<OnSaveAction> invoker = EditUtil.useOnSaveExtensions(jspContext); |
5492 |
16 Nov 10 |
nicklas |
141 |
try |
5459 |
29 Oct 10 |
nicklas |
142 |
{ |
5492 |
16 Nov 10 |
nicklas |
143 |
int biomaterialId = Values.getInt(request.getParameter("biomaterial_id")); |
5492 |
16 Nov 10 |
nicklas |
144 |
if (biomaterialId >= 0) |
4731 |
20 Jan 09 |
martin |
145 |
{ |
5492 |
16 Nov 10 |
nicklas |
146 |
MeasuredBioMaterial oldMbm = biowell.getBioMaterial(); |
5492 |
16 Nov 10 |
nicklas |
147 |
if (oldMbm != null) |
5459 |
29 Oct 10 |
nicklas |
148 |
{ |
5492 |
16 Nov 10 |
nicklas |
149 |
dc.reattachItem(oldMbm, false); |
5492 |
16 Nov 10 |
nicklas |
150 |
if (oldMbm.isLockedInWell()) |
5492 |
16 Nov 10 |
nicklas |
151 |
{ |
5492 |
16 Nov 10 |
nicklas |
152 |
throw new PermissionDeniedException("The current biomaterial can't be removed from this well."); |
5492 |
16 Nov 10 |
nicklas |
153 |
} |
5492 |
16 Nov 10 |
nicklas |
154 |
oldMbm.setBioWell(null); |
5459 |
29 Oct 10 |
nicklas |
155 |
} |
5492 |
16 Nov 10 |
nicklas |
156 |
if (biomaterialId > 0) |
5459 |
29 Oct 10 |
nicklas |
157 |
{ |
5492 |
16 Nov 10 |
nicklas |
158 |
Item biomaterialType = Item.valueOf(request.getParameter("biomaterial_type")); |
5492 |
16 Nov 10 |
nicklas |
159 |
MeasuredBioMaterial newMbm = (MeasuredBioMaterial)biomaterialType.getById(dc, biomaterialId); |
5492 |
16 Nov 10 |
nicklas |
160 |
if (newMbm.isLockedInWell()) |
5492 |
16 Nov 10 |
nicklas |
161 |
{ |
5492 |
16 Nov 10 |
nicklas |
162 |
throw new PermissionDeniedException("The biomaterial '" + newMbm.getName() + "' is locked in a well."); |
5492 |
16 Nov 10 |
nicklas |
163 |
} |
5492 |
16 Nov 10 |
nicklas |
164 |
newMbm.setBioWell(biowell); |
5459 |
29 Oct 10 |
nicklas |
165 |
} |
4731 |
20 Jan 09 |
martin |
166 |
} |
5492 |
16 Nov 10 |
nicklas |
167 |
|
5492 |
16 Nov 10 |
nicklas |
168 |
// OnSave extensions |
5492 |
16 Nov 10 |
nicklas |
169 |
invoker.render(OnSaveRenderer.ON_SAVE); |
5459 |
29 Oct 10 |
nicklas |
170 |
dc.commit(); |
5492 |
16 Nov 10 |
nicklas |
171 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
5492 |
16 Nov 10 |
nicklas |
172 |
} |
5492 |
16 Nov 10 |
nicklas |
173 |
catch (Exception ex) |
5492 |
16 Nov 10 |
nicklas |
174 |
{ |
5492 |
16 Nov 10 |
nicklas |
175 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
5492 |
16 Nov 10 |
nicklas |
176 |
throw ex; |
5492 |
16 Nov 10 |
nicklas |
177 |
} |
5492 |
16 Nov 10 |
nicklas |
178 |
finally |
5492 |
16 Nov 10 |
nicklas |
179 |
{ |
5492 |
16 Nov 10 |
nicklas |
180 |
cc.removeObject("item"); |
5492 |
16 Nov 10 |
nicklas |
181 |
} |
4704 |
11 Dec 08 |
martin |
182 |
} |
4704 |
11 Dec 08 |
martin |
183 |
else if ("ExportItems".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
184 |
{ |
4704 |
11 Dec 08 |
martin |
185 |
// Run an export plugin in a list context |
4704 |
11 Dec 08 |
martin |
186 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
187 |
dc = sc.newDbControl(":Export "+itemType); |
4704 |
11 Dec 08 |
martin |
188 |
final BioPlate bioplate = BioPlate.getById(dc, bioplateId); |
4704 |
11 Dec 08 |
martin |
189 |
final ItemQuery<BioWell> query = bioplate.getBioWells(); |
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); |
6590 |
05 Nov 14 |
nicklas |
192 |
query.join(Hql.leftJoin(null, "bioMaterial", "mbm", null, true)); |
6590 |
05 Nov 14 |
nicklas |
193 |
query.join(Hql.leftJoin("mbm", "creationEvent", "evt", null, true)); |
6590 |
05 Nov 14 |
nicklas |
194 |
query.join(Hql.leftJoin("mbm", "owner", "usr", null, false)); |
6590 |
05 Nov 14 |
nicklas |
195 |
query.join(Hql.leftJoin("evt", "protocol", "pcl", null, false)); |
4856 |
27 Mar 09 |
nicklas |
196 |
if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row"))); |
4856 |
27 Mar 09 |
nicklas |
197 |
if (!"column".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("column"))); |
4704 |
11 Dec 08 |
martin |
198 |
cc.setQuery(query); |
4856 |
27 Mar 09 |
nicklas |
199 |
registerExportFormatters(cc); |
7604 |
25 Feb 19 |
nicklas |
200 |
ExtensionsInvoker<ListColumnAction<BioWell,?>> listInvoker = ListColumnUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
201 |
listInvoker.render(new ListColumnExportRenderer<BioWell>(cc)); |
4864 |
30 Mar 09 |
nicklas |
202 |
redirect = root + "/common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+biowells"; |
4704 |
11 Dec 08 |
martin |
203 |
} |
4704 |
11 Dec 08 |
martin |
204 |
else if ("ExportItem".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
205 |
{ |
4704 |
11 Dec 08 |
martin |
206 |
// Run an export plugin in single-item context |
4704 |
11 Dec 08 |
martin |
207 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4856 |
27 Mar 09 |
nicklas |
208 |
registerExportFormatters(cc); |
4864 |
30 Mar 09 |
nicklas |
209 |
redirect = root + "/common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+biowell"; |
4704 |
11 Dec 08 |
martin |
210 |
} |
4704 |
11 Dec 08 |
martin |
211 |
else if ("ImportItems".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
212 |
{ |
4704 |
11 Dec 08 |
martin |
213 |
// Run an import plugin in a list context |
4704 |
11 Dec 08 |
martin |
214 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
215 |
dc = sc.newDbControl(":Import "+itemType); |
4704 |
11 Dec 08 |
martin |
216 |
final BioPlate bioplate = BioPlate.getById(dc, bioplateId); |
5590 |
16 Mar 11 |
nicklas |
217 |
final ItemQuery<BioWell> query = bioplate.getBioWells(); |
7914 |
23 Feb 21 |
nicklas |
218 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
219 |
cc.configureQuery(dc, query, jspContext, true); |
4704 |
11 Dec 08 |
martin |
220 |
dc.close(); |
4704 |
11 Dec 08 |
martin |
221 |
cc.setQuery(query); |
4864 |
30 Mar 09 |
nicklas |
222 |
redirect = root + "/common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Import+biowells"; |
4704 |
11 Dec 08 |
martin |
223 |
} |
4704 |
11 Dec 08 |
martin |
224 |
else if ("ImportItem".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
225 |
{ |
4704 |
11 Dec 08 |
martin |
226 |
// Run an import plugin in single-item context |
4704 |
11 Dec 08 |
martin |
227 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4864 |
30 Mar 09 |
nicklas |
228 |
redirect = root + "/common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Import+biowell"; |
4704 |
11 Dec 08 |
martin |
229 |
} |
4704 |
11 Dec 08 |
martin |
230 |
else if ("RunListPlugin".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
231 |
{ |
4704 |
11 Dec 08 |
martin |
232 |
// Run another plugin in a list context |
4704 |
11 Dec 08 |
martin |
233 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
234 |
dc = sc.newDbControl(":Run plugin "+itemType); |
4704 |
11 Dec 08 |
martin |
235 |
final BioPlate bioplate = BioPlate.getById(dc, bioplateId); |
5590 |
16 Mar 11 |
nicklas |
236 |
final ItemQuery<BioWell> query = bioplate.getBioWells(); |
7914 |
23 Feb 21 |
nicklas |
237 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
238 |
cc.configureQuery(dc, query, jspContext, true); |
4704 |
11 Dec 08 |
martin |
239 |
dc.close(); |
4704 |
11 Dec 08 |
martin |
240 |
cc.setQuery(query); |
4864 |
30 Mar 09 |
nicklas |
241 |
redirect = root + "/common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=OTHER&title=Run+plugin"; |
4704 |
11 Dec 08 |
martin |
242 |
} |
4704 |
11 Dec 08 |
martin |
243 |
else if ("RunPlugin".equals(cmd)) |
4704 |
11 Dec 08 |
martin |
244 |
{ |
4704 |
11 Dec 08 |
martin |
245 |
// Run another plugin in single-item context |
4704 |
11 Dec 08 |
martin |
246 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4864 |
30 Mar 09 |
nicklas |
247 |
redirect = root + "/common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; |
4704 |
11 Dec 08 |
martin |
248 |
} |
4704 |
11 Dec 08 |
martin |
249 |
else |
4704 |
11 Dec 08 |
martin |
250 |
{ |
4704 |
11 Dec 08 |
martin |
251 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
4704 |
11 Dec 08 |
martin |
252 |
} |
4704 |
11 Dec 08 |
martin |
253 |
|
4704 |
11 Dec 08 |
martin |
254 |
} |
4704 |
11 Dec 08 |
martin |
255 |
finally |
4704 |
11 Dec 08 |
martin |
256 |
{ |
4704 |
11 Dec 08 |
martin |
257 |
if (dc != null) dc.close(); |
4704 |
11 Dec 08 |
martin |
258 |
} |
4704 |
11 Dec 08 |
martin |
259 |
if (forward != null) |
4704 |
11 Dec 08 |
martin |
260 |
{ |
6192 |
31 Oct 12 |
nicklas |
261 |
sc.setSessionSetting("alert-message", message); |
4704 |
11 Dec 08 |
martin |
262 |
pageContext.forward(forward); |
4704 |
11 Dec 08 |
martin |
263 |
} |
4704 |
11 Dec 08 |
martin |
264 |
else if (redirect != null) |
4704 |
11 Dec 08 |
martin |
265 |
{ |
6192 |
31 Oct 12 |
nicklas |
266 |
sc.setSessionSetting("alert-message", message); |
4704 |
11 Dec 08 |
martin |
267 |
response.sendRedirect(redirect); |
4704 |
11 Dec 08 |
martin |
268 |
} |
4704 |
11 Dec 08 |
martin |
269 |
else if (message == null) |
4704 |
11 Dec 08 |
martin |
270 |
{ |
4704 |
11 Dec 08 |
martin |
271 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0"); |
4704 |
11 Dec 08 |
martin |
272 |
} |
4704 |
11 Dec 08 |
martin |
273 |
else |
4704 |
11 Dec 08 |
martin |
274 |
{ |
4704 |
11 Dec 08 |
martin |
275 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message)); |
4704 |
11 Dec 08 |
martin |
276 |
} |
4704 |
11 Dec 08 |
martin |
277 |
%> |