1862 |
30 Jan 06 |
nicklas |
1 |
<%-- $Id$ |
1862 |
30 Jan 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
1862 |
30 Jan 06 |
nicklas |
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/ |
1862 |
30 Jan 06 |
nicklas |
7 |
|
1862 |
30 Jan 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
1862 |
30 Jan 06 |
nicklas |
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 |
1862 |
30 Jan 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
1862 |
30 Jan 06 |
nicklas |
12 |
|
1862 |
30 Jan 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
1862 |
30 Jan 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1862 |
30 Jan 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1862 |
30 Jan 06 |
nicklas |
16 |
GNU General Public License for more details. |
1862 |
30 Jan 06 |
nicklas |
17 |
|
1862 |
30 Jan 06 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1862 |
30 Jan 06 |
nicklas |
20 |
------------------------------------------------------------------ |
1862 |
30 Jan 06 |
nicklas |
21 |
|
1862 |
30 Jan 06 |
nicklas |
22 |
@author Nicklas |
1862 |
30 Jan 06 |
nicklas |
23 |
@version 2.0 |
1862 |
30 Jan 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
1862 |
30 Jan 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
1862 |
30 Jan 06 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
1862 |
30 Jan 06 |
nicklas |
28 |
import="net.sf.basedb.core.Item" |
1862 |
30 Jan 06 |
nicklas |
29 |
import="net.sf.basedb.core.ItemContext" |
1862 |
30 Jan 06 |
nicklas |
30 |
import="net.sf.basedb.core.Plate" |
1862 |
30 Jan 06 |
nicklas |
31 |
import="net.sf.basedb.core.Well" |
1862 |
30 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemQuery" |
4305 |
21 May 08 |
nicklas |
33 |
import="net.sf.basedb.core.DataQuery" |
1862 |
30 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
1862 |
30 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.core.PermissionDeniedException" |
4305 |
21 May 08 |
nicklas |
36 |
import="net.sf.basedb.core.data.ReporterData" |
4866 |
31 Mar 09 |
martin |
37 |
import="net.sf.basedb.core.query.Hql" |
4866 |
31 Mar 09 |
martin |
38 |
import="net.sf.basedb.core.query.Orders" |
1862 |
30 Jan 06 |
nicklas |
39 |
import="net.sf.basedb.util.RemovableUtil" |
1862 |
30 Jan 06 |
nicklas |
40 |
import="net.sf.basedb.clients.web.Base" |
1862 |
30 Jan 06 |
nicklas |
41 |
import="net.sf.basedb.clients.web.WebException" |
1862 |
30 Jan 06 |
nicklas |
42 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
43 |
import="net.sf.basedb.util.Values" |
4866 |
31 Mar 09 |
martin |
44 |
import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
5498 |
17 Nov 10 |
nicklas |
45 |
import="net.sf.basedb.core.plugin.GuiContext" |
5498 |
17 Nov 10 |
nicklas |
46 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5498 |
17 Nov 10 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5498 |
17 Nov 10 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5498 |
17 Nov 10 |
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" |
5498 |
17 Nov 10 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" |
6039 |
29 Mar 12 |
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" |
6039 |
29 Mar 12 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
1862 |
30 Jan 06 |
nicklas |
55 |
import="java.util.List" |
1862 |
30 Jan 06 |
nicklas |
56 |
import="java.util.Collections" |
1862 |
30 Jan 06 |
nicklas |
57 |
%> |
1862 |
30 Jan 06 |
nicklas |
58 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1862 |
30 Jan 06 |
nicklas |
59 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
1862 |
30 Jan 06 |
nicklas |
60 |
<%! |
7982 |
14 Jun 21 |
nicklas |
61 |
private static final ItemContext defaultContext = Base.createDefaultContext("row", "row,column,reporter.name,reporter.externalId", null); |
1862 |
30 Jan 06 |
nicklas |
62 |
private static final Item itemType = Item.WELL; |
4866 |
31 Mar 09 |
martin |
63 |
|
4866 |
31 Mar 09 |
martin |
64 |
private static void registerExportFormatters(ItemContext cc) |
4866 |
31 Mar 09 |
martin |
65 |
{ |
4866 |
31 Mar 09 |
martin |
66 |
cc.setObject("export.formatter.row", new WellCoordinateFormatter(true)); |
4866 |
31 Mar 09 |
martin |
67 |
cc.setObject("export.formatter.column", new WellCoordinateFormatter(false)); |
4866 |
31 Mar 09 |
martin |
68 |
} |
1862 |
30 Jan 06 |
nicklas |
69 |
%> |
1862 |
30 Jan 06 |
nicklas |
70 |
<% |
1862 |
30 Jan 06 |
nicklas |
71 |
final int plateId = Values.getInt(request.getParameter("plate_id")); |
1862 |
30 Jan 06 |
nicklas |
72 |
|
1862 |
30 Jan 06 |
nicklas |
73 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1862 |
30 Jan 06 |
nicklas |
74 |
final String ID = sc.getId(); |
1862 |
30 Jan 06 |
nicklas |
75 |
final String cmd = request.getParameter("cmd"); |
1862 |
30 Jan 06 |
nicklas |
76 |
final String root = request.getContextPath()+"/"; |
1862 |
30 Jan 06 |
nicklas |
77 |
final String mode = request.getParameter("mode"); |
1862 |
30 Jan 06 |
nicklas |
78 |
final String callback = request.getParameter("callback"); |
1862 |
30 Jan 06 |
nicklas |
79 |
final String itemId = request.getParameter("item_id"); |
1862 |
30 Jan 06 |
nicklas |
80 |
final String listPage = "list_wells.jsp?ID="+ID |
1862 |
30 Jan 06 |
nicklas |
81 |
+"&plate_id="+plateId |
1862 |
30 Jan 06 |
nicklas |
82 |
+(mode == null ? "" : "&mode="+mode) |
1862 |
30 Jan 06 |
nicklas |
83 |
+(callback == null ? "" : "&callback="+callback) |
1862 |
30 Jan 06 |
nicklas |
84 |
+(itemId == null ? "" : "&item_id="+itemId); |
1862 |
30 Jan 06 |
nicklas |
85 |
final String viewPage = "view_well.jsp?ID="+ID+"&plate_id="+plateId; |
1862 |
30 Jan 06 |
nicklas |
86 |
final String editPage = "edit_well.jsp?ID="+ID+"&plate_id="+plateId; |
1862 |
30 Jan 06 |
nicklas |
87 |
|
1862 |
30 Jan 06 |
nicklas |
88 |
String forward = null; |
1862 |
30 Jan 06 |
nicklas |
89 |
String redirect = null; |
1862 |
30 Jan 06 |
nicklas |
90 |
String message = null; |
1862 |
30 Jan 06 |
nicklas |
91 |
DbControl dc = null; |
1862 |
30 Jan 06 |
nicklas |
92 |
|
1862 |
30 Jan 06 |
nicklas |
93 |
try |
1862 |
30 Jan 06 |
nicklas |
94 |
{ |
1862 |
30 Jan 06 |
nicklas |
95 |
if (cmd == null || "List".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
96 |
{ |
1862 |
30 Jan 06 |
nicklas |
97 |
// Display the list page without updatinging the current context |
2811 |
26 Oct 06 |
nicklas |
98 |
Base.getAndSetCurrentContext(sc, itemType, null, defaultContext, true); |
1862 |
30 Jan 06 |
nicklas |
99 |
redirect = listPage; |
1862 |
30 Jan 06 |
nicklas |
100 |
} |
1862 |
30 Jan 06 |
nicklas |
101 |
else if ("UpdateContext".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
102 |
{ |
1862 |
30 Jan 06 |
nicklas |
103 |
// Display the list page after updating the current context from the request parameters |
1862 |
30 Jan 06 |
nicklas |
104 |
Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
105 |
redirect = listPage; |
1862 |
30 Jan 06 |
nicklas |
106 |
} |
1862 |
30 Jan 06 |
nicklas |
107 |
else if ("LoadContext".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
108 |
{ |
1862 |
30 Jan 06 |
nicklas |
109 |
// Display the list page after loading a saved context |
1862 |
30 Jan 06 |
nicklas |
110 |
int contextId = Values.getInt(request.getParameter("context")); |
1862 |
30 Jan 06 |
nicklas |
111 |
Base.loadContext(sc, contextId, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
112 |
redirect = listPage; |
1862 |
30 Jan 06 |
nicklas |
113 |
} |
1862 |
30 Jan 06 |
nicklas |
114 |
else if ("ViewItem".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
115 |
{ |
1862 |
30 Jan 06 |
nicklas |
116 |
// Display the view page for a single item |
1862 |
30 Jan 06 |
nicklas |
117 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
118 |
forward = viewPage; |
1862 |
30 Jan 06 |
nicklas |
119 |
} |
1862 |
30 Jan 06 |
nicklas |
120 |
else if ("EditItem".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
121 |
{ |
1862 |
30 Jan 06 |
nicklas |
122 |
// Display the edit page for a single item (should be opened in a popup) |
1862 |
30 Jan 06 |
nicklas |
123 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
124 |
redirect = editPage; |
1862 |
30 Jan 06 |
nicklas |
125 |
} |
1862 |
30 Jan 06 |
nicklas |
126 |
else if ("UpdateItem".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
127 |
{ |
1862 |
30 Jan 06 |
nicklas |
128 |
// Update the properties on an item (will close the popup) |
1862 |
30 Jan 06 |
nicklas |
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 |
Well well = cc.getObject("item"); |
5060 |
19 Aug 09 |
nicklas |
132 |
dc.reattachItem(well, false); |
1862 |
30 Jan 06 |
nicklas |
133 |
message = "Well updated"; |
1862 |
30 Jan 06 |
nicklas |
134 |
|
5498 |
17 Nov 10 |
nicklas |
135 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.WELL), well); |
7604 |
25 Feb 19 |
nicklas |
136 |
ExtensionsInvoker<OnSaveAction> invoker = EditUtil.useOnSaveExtensions(jspContext); |
5498 |
17 Nov 10 |
nicklas |
137 |
try |
5498 |
17 Nov 10 |
nicklas |
138 |
{ |
5498 |
17 Nov 10 |
nicklas |
139 |
// Annotations tab |
5498 |
17 Nov 10 |
nicklas |
140 |
Base.updateAnnotations(dc, well, well, request); |
5498 |
17 Nov 10 |
nicklas |
141 |
|
5498 |
17 Nov 10 |
nicklas |
142 |
// OnSave extensions |
5498 |
17 Nov 10 |
nicklas |
143 |
invoker.render(OnSaveRenderer.ON_SAVE); |
5498 |
17 Nov 10 |
nicklas |
144 |
dc.commit(); |
5498 |
17 Nov 10 |
nicklas |
145 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
5498 |
17 Nov 10 |
nicklas |
146 |
} |
5498 |
17 Nov 10 |
nicklas |
147 |
catch (Exception ex) |
5498 |
17 Nov 10 |
nicklas |
148 |
{ |
5498 |
17 Nov 10 |
nicklas |
149 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
5498 |
17 Nov 10 |
nicklas |
150 |
throw ex; |
5498 |
17 Nov 10 |
nicklas |
151 |
} |
5498 |
17 Nov 10 |
nicklas |
152 |
finally |
5498 |
17 Nov 10 |
nicklas |
153 |
{ |
5498 |
17 Nov 10 |
nicklas |
154 |
cc.removeObject("item"); |
5498 |
17 Nov 10 |
nicklas |
155 |
} |
1862 |
30 Jan 06 |
nicklas |
156 |
} |
1862 |
30 Jan 06 |
nicklas |
157 |
else if ("ExportItems".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
158 |
{ |
1862 |
30 Jan 06 |
nicklas |
159 |
// Run an export plugin in a list context |
1862 |
30 Jan 06 |
nicklas |
160 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
161 |
dc = sc.newDbControl(":Export "+itemType); |
1862 |
30 Jan 06 |
nicklas |
162 |
final Plate plate = Plate.getById(dc, plateId); |
5590 |
16 Mar 11 |
nicklas |
163 |
final ItemQuery<Well> query = plate.getWells(); |
7914 |
23 Feb 21 |
nicklas |
164 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
165 |
cc.configureQuery(dc, query, jspContext, true); |
6039 |
29 Mar 12 |
nicklas |
166 |
cc.setQuery(query); |
4866 |
31 Mar 09 |
martin |
167 |
if (!"row".equals(cc.getSortProperty())) |
4866 |
31 Mar 09 |
martin |
168 |
{ |
4866 |
31 Mar 09 |
martin |
169 |
query.order(Orders.asc(Hql.property("row"))); |
4866 |
31 Mar 09 |
martin |
170 |
} |
4866 |
31 Mar 09 |
martin |
171 |
if (!"column".equals(cc.getSortProperty())) |
4866 |
31 Mar 09 |
martin |
172 |
{ |
4866 |
31 Mar 09 |
martin |
173 |
query.order(Orders.asc(Hql.property("column"))); |
4866 |
31 Mar 09 |
martin |
174 |
} |
4866 |
31 Mar 09 |
martin |
175 |
registerExportFormatters(cc); |
7604 |
25 Feb 19 |
nicklas |
176 |
ExtensionsInvoker<ListColumnAction<Well,?>> listInvoker = ListColumnUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
177 |
listInvoker.render(new ListColumnExportRenderer<Well>(cc)); |
6039 |
29 Mar 12 |
nicklas |
178 |
dc.close(); |
4866 |
31 Mar 09 |
martin |
179 |
redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+wells"; |
1862 |
30 Jan 06 |
nicklas |
180 |
} |
1862 |
30 Jan 06 |
nicklas |
181 |
else if ("ExportItem".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
182 |
{ |
1862 |
30 Jan 06 |
nicklas |
183 |
// Run an export plugin in single-item context |
1862 |
30 Jan 06 |
nicklas |
184 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4866 |
31 Mar 09 |
martin |
185 |
registerExportFormatters(cc); |
1862 |
30 Jan 06 |
nicklas |
186 |
redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+well"; |
1862 |
30 Jan 06 |
nicklas |
187 |
} |
1862 |
30 Jan 06 |
nicklas |
188 |
else if ("ImportItems".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
189 |
{ |
1862 |
30 Jan 06 |
nicklas |
190 |
// Run an import plugin in a list context |
1862 |
30 Jan 06 |
nicklas |
191 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
192 |
dc = sc.newDbControl(":Import "+itemType); |
1862 |
30 Jan 06 |
nicklas |
193 |
final Plate plate = Plate.getById(dc, plateId); |
5590 |
16 Mar 11 |
nicklas |
194 |
final ItemQuery<Well> query = plate.getWells(); |
7914 |
23 Feb 21 |
nicklas |
195 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
196 |
cc.configureQuery(dc, query, jspContext, true); |
1862 |
30 Jan 06 |
nicklas |
197 |
dc.close(); |
1862 |
30 Jan 06 |
nicklas |
198 |
cc.setQuery(query); |
1862 |
30 Jan 06 |
nicklas |
199 |
redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Import+wells"; |
1862 |
30 Jan 06 |
nicklas |
200 |
} |
1862 |
30 Jan 06 |
nicklas |
201 |
else if ("ImportItem".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
202 |
{ |
1862 |
30 Jan 06 |
nicklas |
203 |
// Run an import plugin in single-item context |
1862 |
30 Jan 06 |
nicklas |
204 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
205 |
redirect = "../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Import+well"; |
1862 |
30 Jan 06 |
nicklas |
206 |
} |
1862 |
30 Jan 06 |
nicklas |
207 |
else if ("RunListPlugin".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
208 |
{ |
1862 |
30 Jan 06 |
nicklas |
209 |
// Run another plugin in a list context |
1862 |
30 Jan 06 |
nicklas |
210 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
211 |
dc = sc.newDbControl(":Run plugin "+itemType); |
1862 |
30 Jan 06 |
nicklas |
212 |
final Plate plate = Plate.getById(dc, plateId); |
5590 |
16 Mar 11 |
nicklas |
213 |
final ItemQuery<Well> query = plate.getWells(); |
7914 |
23 Feb 21 |
nicklas |
214 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
215 |
cc.configureQuery(dc, query, jspContext, true); |
1862 |
30 Jan 06 |
nicklas |
216 |
dc.close(); |
1862 |
30 Jan 06 |
nicklas |
217 |
cc.setQuery(query); |
1862 |
30 Jan 06 |
nicklas |
218 |
redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=OTHER&title=Run+plugin"; |
1862 |
30 Jan 06 |
nicklas |
219 |
} |
1862 |
30 Jan 06 |
nicklas |
220 |
else if ("RunPlugin".equals(cmd)) |
1862 |
30 Jan 06 |
nicklas |
221 |
{ |
1862 |
30 Jan 06 |
nicklas |
222 |
// Run another plugin in single-item context |
1862 |
30 Jan 06 |
nicklas |
223 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
1862 |
30 Jan 06 |
nicklas |
224 |
redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; |
1862 |
30 Jan 06 |
nicklas |
225 |
} |
4305 |
21 May 08 |
nicklas |
226 |
else if ("CreateReporterList".equals(cmd)) |
4305 |
21 May 08 |
nicklas |
227 |
{ |
4305 |
21 May 08 |
nicklas |
228 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
229 |
dc = sc.newDbControl(":Create reporter list from "+itemType); |
4305 |
21 May 08 |
nicklas |
230 |
final Plate plate = Plate.getById(dc, plateId); |
4305 |
21 May 08 |
nicklas |
231 |
final DataQuery<ReporterData> query = plate.getReporters(); |
7914 |
23 Feb 21 |
nicklas |
232 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.list(itemType), null); |
7914 |
23 Feb 21 |
nicklas |
233 |
cc.configureQuery(dc, query, jspContext, true); |
5590 |
16 Mar 11 |
nicklas |
234 |
dc.close(); |
4305 |
21 May 08 |
nicklas |
235 |
cc.setQuery(query); |
4305 |
21 May 08 |
nicklas |
236 |
redirect = "../../../views/reporterlists/index.jsp?ID="+ID+ |
4305 |
21 May 08 |
nicklas |
237 |
"&cmd=NewItem&addReporters=1&formId=wells&fromContext=WELL"+ |
4305 |
21 May 08 |
nicklas |
238 |
"&name=" + HTML.urlEncode(plate.getName()); |
4305 |
21 May 08 |
nicklas |
239 |
} |
1862 |
30 Jan 06 |
nicklas |
240 |
else |
1862 |
30 Jan 06 |
nicklas |
241 |
{ |
1862 |
30 Jan 06 |
nicklas |
242 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
1862 |
30 Jan 06 |
nicklas |
243 |
} |
1862 |
30 Jan 06 |
nicklas |
244 |
|
1862 |
30 Jan 06 |
nicklas |
245 |
} |
1862 |
30 Jan 06 |
nicklas |
246 |
finally |
1862 |
30 Jan 06 |
nicklas |
247 |
{ |
1862 |
30 Jan 06 |
nicklas |
248 |
if (dc != null) dc.close(); |
1862 |
30 Jan 06 |
nicklas |
249 |
} |
1862 |
30 Jan 06 |
nicklas |
250 |
if (forward != null) |
1862 |
30 Jan 06 |
nicklas |
251 |
{ |
6192 |
31 Oct 12 |
nicklas |
252 |
sc.setSessionSetting("alert-message", message); |
1862 |
30 Jan 06 |
nicklas |
253 |
pageContext.forward(forward); |
1862 |
30 Jan 06 |
nicklas |
254 |
} |
1862 |
30 Jan 06 |
nicklas |
255 |
else if (redirect != null) |
1862 |
30 Jan 06 |
nicklas |
256 |
{ |
6192 |
31 Oct 12 |
nicklas |
257 |
sc.setSessionSetting("alert-message", message); |
1862 |
30 Jan 06 |
nicklas |
258 |
response.sendRedirect(redirect); |
1862 |
30 Jan 06 |
nicklas |
259 |
} |
1862 |
30 Jan 06 |
nicklas |
260 |
else if (message == null) |
1862 |
30 Jan 06 |
nicklas |
261 |
{ |
1862 |
30 Jan 06 |
nicklas |
262 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0"); |
1862 |
30 Jan 06 |
nicklas |
263 |
} |
1862 |
30 Jan 06 |
nicklas |
264 |
else |
1862 |
30 Jan 06 |
nicklas |
265 |
{ |
1862 |
30 Jan 06 |
nicklas |
266 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message)); |
1862 |
30 Jan 06 |
nicklas |
267 |
} |
1862 |
30 Jan 06 |
nicklas |
268 |
|
3675 |
16 Aug 07 |
jari |
269 |
%> |