2099 |
21 Mar 06 |
nicklas |
1 |
<%-- $Id$ |
2099 |
21 Mar 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
2099 |
21 Mar 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/ |
2099 |
21 Mar 06 |
nicklas |
7 |
|
2099 |
21 Mar 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
2099 |
21 Mar 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 |
2099 |
21 Mar 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
2099 |
21 Mar 06 |
nicklas |
12 |
|
2099 |
21 Mar 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
2099 |
21 Mar 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2099 |
21 Mar 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2099 |
21 Mar 06 |
nicklas |
16 |
GNU General Public License for more details. |
2099 |
21 Mar 06 |
nicklas |
17 |
|
2099 |
21 Mar 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/>. |
2099 |
21 Mar 06 |
nicklas |
20 |
------------------------------------------------------------------ |
2099 |
21 Mar 06 |
nicklas |
21 |
|
2099 |
21 Mar 06 |
nicklas |
22 |
@author Nicklas |
2099 |
21 Mar 06 |
nicklas |
23 |
@version 2.0 |
2099 |
21 Mar 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
2099 |
21 Mar 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
2099 |
21 Mar 06 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
2099 |
21 Mar 06 |
nicklas |
28 |
import="net.sf.basedb.core.Item" |
2099 |
21 Mar 06 |
nicklas |
29 |
import="net.sf.basedb.core.Include" |
2099 |
21 Mar 06 |
nicklas |
30 |
import="net.sf.basedb.core.Experiment" |
2099 |
21 Mar 06 |
nicklas |
31 |
import="net.sf.basedb.core.BioAssaySet" |
4978 |
23 Jun 09 |
nicklas |
32 |
import="net.sf.basedb.core.AnnotationType" |
2099 |
21 Mar 06 |
nicklas |
33 |
import="net.sf.basedb.core.BioAssay" |
2099 |
21 Mar 06 |
nicklas |
34 |
import="net.sf.basedb.core.Job" |
2099 |
21 Mar 06 |
nicklas |
35 |
import="net.sf.basedb.core.RawBioAssay" |
2099 |
21 Mar 06 |
nicklas |
36 |
import="net.sf.basedb.core.StringParameterType" |
2099 |
21 Mar 06 |
nicklas |
37 |
import="net.sf.basedb.core.IntegerParameterType" |
2099 |
21 Mar 06 |
nicklas |
38 |
import="net.sf.basedb.core.ItemParameterType" |
2099 |
21 Mar 06 |
nicklas |
39 |
import="net.sf.basedb.core.ItemQuery" |
2099 |
21 Mar 06 |
nicklas |
40 |
import="net.sf.basedb.core.ItemResultIterator" |
2099 |
21 Mar 06 |
nicklas |
41 |
import="net.sf.basedb.core.Permission" |
2099 |
21 Mar 06 |
nicklas |
42 |
import="net.sf.basedb.core.PluginDefinition" |
2099 |
21 Mar 06 |
nicklas |
43 |
import="net.sf.basedb.core.ItemContext" |
2099 |
21 Mar 06 |
nicklas |
44 |
import="net.sf.basedb.core.MultiPermissions" |
2099 |
21 Mar 06 |
nicklas |
45 |
import="net.sf.basedb.core.PermissionDeniedException" |
2099 |
21 Mar 06 |
nicklas |
46 |
import="net.sf.basedb.core.ItemAlreadyExistsException" |
5130 |
13 Oct 09 |
nicklas |
47 |
import="net.sf.basedb.core.snapshot.SnapshotManager" |
2099 |
21 Mar 06 |
nicklas |
48 |
import="net.sf.basedb.util.RemovableUtil" |
2099 |
21 Mar 06 |
nicklas |
49 |
import="net.sf.basedb.util.ShareableUtil" |
2099 |
21 Mar 06 |
nicklas |
50 |
import="net.sf.basedb.clients.web.Base" |
2099 |
21 Mar 06 |
nicklas |
51 |
import="net.sf.basedb.clients.web.WebException" |
2753 |
20 Oct 06 |
nicklas |
52 |
import="net.sf.basedb.util.Values" |
2099 |
21 Mar 06 |
nicklas |
53 |
import="net.sf.basedb.clients.web.util.HTML" |
4978 |
23 Jun 09 |
nicklas |
54 |
import="net.sf.basedb.clients.web.plugins.BioAssayExperimentalFactorLoader" |
5503 |
18 Nov 10 |
nicklas |
55 |
import="net.sf.basedb.core.plugin.GuiContext" |
5503 |
18 Nov 10 |
nicklas |
56 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5503 |
18 Nov 10 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5503 |
18 Nov 10 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5503 |
18 Nov 10 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
60 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveAction" |
5503 |
18 Nov 10 |
nicklas |
61 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" |
2099 |
21 Mar 06 |
nicklas |
62 |
import="java.util.Enumeration" |
2099 |
21 Mar 06 |
nicklas |
63 |
import="java.util.Set" |
2099 |
21 Mar 06 |
nicklas |
64 |
import="java.util.HashSet" |
2099 |
21 Mar 06 |
nicklas |
65 |
import="java.util.List" |
2099 |
21 Mar 06 |
nicklas |
66 |
import="java.util.LinkedList" |
2099 |
21 Mar 06 |
nicklas |
67 |
import="java.util.Collections" |
2099 |
21 Mar 06 |
nicklas |
68 |
import="java.util.Arrays" |
2099 |
21 Mar 06 |
nicklas |
69 |
%> |
2099 |
21 Mar 06 |
nicklas |
70 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4978 |
23 Jun 09 |
nicklas |
71 |
<%!private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,spots,tools"); |
2099 |
21 Mar 06 |
nicklas |
72 |
private static final Item itemType = Item.BIOASSAY; |
4978 |
23 Jun 09 |
nicklas |
73 |
|
4978 |
23 Jun 09 |
nicklas |
74 |
private static void registerExportFormatters(ItemContext cc, List<AnnotationType> experimentalFactors) |
5130 |
13 Oct 09 |
nicklas |
75 |
{ |
5130 |
13 Oct 09 |
nicklas |
76 |
SnapshotManager snapshotManager = new SnapshotManager(); |
4978 |
23 Jun 09 |
nicklas |
77 |
for (AnnotationType at : experimentalFactors) |
4978 |
23 Jun 09 |
nicklas |
78 |
{ |
5130 |
13 Oct 09 |
nicklas |
79 |
cc.setObject("export.dataloader.#" + at.getId(), new BioAssayExperimentalFactorLoader(snapshotManager)); |
4978 |
23 Jun 09 |
nicklas |
80 |
} |
4978 |
23 Jun 09 |
nicklas |
81 |
}%> |
2099 |
21 Mar 06 |
nicklas |
82 |
<% |
2099 |
21 Mar 06 |
nicklas |
83 |
final int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id")); |
2099 |
21 Mar 06 |
nicklas |
84 |
|
2099 |
21 Mar 06 |
nicklas |
85 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
2099 |
21 Mar 06 |
nicklas |
86 |
final String ID = sc.getId(); |
2099 |
21 Mar 06 |
nicklas |
87 |
final String cmd = request.getParameter("cmd"); |
2099 |
21 Mar 06 |
nicklas |
88 |
final String root = request.getContextPath()+"/"; |
2099 |
21 Mar 06 |
nicklas |
89 |
final String mode = request.getParameter("mode"); |
2099 |
21 Mar 06 |
nicklas |
90 |
final String callback = request.getParameter("callback"); |
2099 |
21 Mar 06 |
nicklas |
91 |
final String itemId = request.getParameter("item_id"); |
2099 |
21 Mar 06 |
nicklas |
92 |
final String listPage = "list_bioassays.jsp?ID="+ID+"&bioassayset_id="+bioAssaySetId |
2099 |
21 Mar 06 |
nicklas |
93 |
+(mode == null ? "" : "&mode="+mode) |
2099 |
21 Mar 06 |
nicklas |
94 |
+(callback == null ? "" : "&callback="+callback) |
2099 |
21 Mar 06 |
nicklas |
95 |
+(itemId == null ? "" : "&item_id="+itemId); |
2099 |
21 Mar 06 |
nicklas |
96 |
final String viewPage = "view_bioassay.jsp?ID="+ID+"&bioassayset_id="+bioAssaySetId; |
2099 |
21 Mar 06 |
nicklas |
97 |
final String editPage = "edit_bioassay.jsp?ID="+ID+"&bioassayset_id="+bioAssaySetId; |
2099 |
21 Mar 06 |
nicklas |
98 |
|
2099 |
21 Mar 06 |
nicklas |
99 |
String forward = null; |
2099 |
21 Mar 06 |
nicklas |
100 |
String redirect = null; |
2099 |
21 Mar 06 |
nicklas |
101 |
String message = null; |
2099 |
21 Mar 06 |
nicklas |
102 |
DbControl dc = null; |
2099 |
21 Mar 06 |
nicklas |
103 |
|
2099 |
21 Mar 06 |
nicklas |
104 |
try |
2099 |
21 Mar 06 |
nicklas |
105 |
{ |
2099 |
21 Mar 06 |
nicklas |
106 |
if (cmd == null || "List".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
107 |
{ |
2099 |
21 Mar 06 |
nicklas |
108 |
// Display the list page without updatinging the current context |
2811 |
26 Oct 06 |
nicklas |
109 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext, true); |
2099 |
21 Mar 06 |
nicklas |
110 |
redirect = listPage; |
2099 |
21 Mar 06 |
nicklas |
111 |
} |
2099 |
21 Mar 06 |
nicklas |
112 |
else if ("UpdateContext".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
113 |
{ |
2099 |
21 Mar 06 |
nicklas |
114 |
// Display the list page after updating the current context from the request parameters |
2099 |
21 Mar 06 |
nicklas |
115 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
116 |
redirect = listPage; |
2099 |
21 Mar 06 |
nicklas |
117 |
} |
2099 |
21 Mar 06 |
nicklas |
118 |
else if ("LoadContext".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
119 |
{ |
2099 |
21 Mar 06 |
nicklas |
120 |
// Display the list page after loading a saved context |
2099 |
21 Mar 06 |
nicklas |
121 |
int contextId = Values.getInt(request.getParameter("context")); |
2099 |
21 Mar 06 |
nicklas |
122 |
Base.loadContext(sc, contextId, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
123 |
redirect = listPage; |
2099 |
21 Mar 06 |
nicklas |
124 |
} |
2099 |
21 Mar 06 |
nicklas |
125 |
|
2099 |
21 Mar 06 |
nicklas |
126 |
else if ("ViewItem".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
127 |
{ |
2099 |
21 Mar 06 |
nicklas |
128 |
// Display the view page for a single item |
2099 |
21 Mar 06 |
nicklas |
129 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
130 |
forward = viewPage; |
2099 |
21 Mar 06 |
nicklas |
131 |
} |
2099 |
21 Mar 06 |
nicklas |
132 |
else if ("EditItem".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
133 |
{ |
2099 |
21 Mar 06 |
nicklas |
134 |
// Display the edit page for a single item (should be opened in a popup) |
2099 |
21 Mar 06 |
nicklas |
135 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
136 |
redirect = editPage; |
2099 |
21 Mar 06 |
nicklas |
137 |
} |
2099 |
21 Mar 06 |
nicklas |
138 |
else if ("UpdateItem".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
139 |
{ |
2099 |
21 Mar 06 |
nicklas |
140 |
// Update the properties on an item (will close the popup) |
2099 |
21 Mar 06 |
nicklas |
141 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext); |
7605 |
26 Feb 19 |
nicklas |
142 |
BioAssay ba = cc.getObject("item"); |
2099 |
21 Mar 06 |
nicklas |
143 |
if (ba != null) |
2099 |
21 Mar 06 |
nicklas |
144 |
{ |
7954 |
12 May 21 |
nicklas |
145 |
dc = sc.newDbControl(":Edit "+itemType); |
5060 |
19 Aug 09 |
nicklas |
146 |
dc.reattachItem(ba, false); |
2099 |
21 Mar 06 |
nicklas |
147 |
message = "Bioassay updated"; |
5503 |
18 Nov 10 |
nicklas |
148 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(Item.BIOASSAY), ba); |
7604 |
25 Feb 19 |
nicklas |
149 |
ExtensionsInvoker<OnSaveAction> invoker = EditUtil.useOnSaveExtensions(jspContext); |
5503 |
18 Nov 10 |
nicklas |
150 |
try |
5503 |
18 Nov 10 |
nicklas |
151 |
{ |
5503 |
18 Nov 10 |
nicklas |
152 |
ba.setName(Values.getStringOrNull(request.getParameter("name"))); |
5503 |
18 Nov 10 |
nicklas |
153 |
ba.setDescription(Values.getStringOrNull(request.getParameter("description"))); |
5503 |
18 Nov 10 |
nicklas |
154 |
|
5503 |
18 Nov 10 |
nicklas |
155 |
// Annotations tab |
5503 |
18 Nov 10 |
nicklas |
156 |
Base.updateAnnotations(dc, ba, ba, request); |
5503 |
18 Nov 10 |
nicklas |
157 |
|
5503 |
18 Nov 10 |
nicklas |
158 |
// OnSave extensions |
5503 |
18 Nov 10 |
nicklas |
159 |
invoker.render(OnSaveRenderer.ON_SAVE); |
5503 |
18 Nov 10 |
nicklas |
160 |
dc.commit(); |
5503 |
18 Nov 10 |
nicklas |
161 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
5503 |
18 Nov 10 |
nicklas |
162 |
} |
5503 |
18 Nov 10 |
nicklas |
163 |
catch (Exception ex) |
5503 |
18 Nov 10 |
nicklas |
164 |
{ |
5503 |
18 Nov 10 |
nicklas |
165 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
5503 |
18 Nov 10 |
nicklas |
166 |
throw ex; |
5503 |
18 Nov 10 |
nicklas |
167 |
} |
5503 |
18 Nov 10 |
nicklas |
168 |
finally |
5503 |
18 Nov 10 |
nicklas |
169 |
{ |
5503 |
18 Nov 10 |
nicklas |
170 |
cc.removeObject("item"); |
5503 |
18 Nov 10 |
nicklas |
171 |
} |
2099 |
21 Mar 06 |
nicklas |
172 |
} |
2099 |
21 Mar 06 |
nicklas |
173 |
} |
2099 |
21 Mar 06 |
nicklas |
174 |
else if ("ExportItems".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
175 |
{ |
2099 |
21 Mar 06 |
nicklas |
176 |
// Run an export plugin in a list context |
2099 |
21 Mar 06 |
nicklas |
177 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
178 |
dc = sc.newDbControl(":Export "+itemType); |
2099 |
21 Mar 06 |
nicklas |
179 |
final BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId); |
4978 |
23 Jun 09 |
nicklas |
180 |
final ItemQuery<AnnotationType> experimentalFactorQuery = bioAssaySet.getExperiment().getExperimentalFactors(); |
4978 |
23 Jun 09 |
nicklas |
181 |
experimentalFactorQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); |
4978 |
23 Jun 09 |
nicklas |
182 |
List<AnnotationType> experimentalFactors = experimentalFactorQuery.list(dc); |
4978 |
23 Jun 09 |
nicklas |
183 |
registerExportFormatters(cc, experimentalFactors); |
5590 |
16 Mar 11 |
nicklas |
184 |
final ItemQuery<BioAssay> query = bioAssaySet.getBioAssays(); |
5590 |
16 Mar 11 |
nicklas |
185 |
cc.configureQuery(dc, query, true); |
2099 |
21 Mar 06 |
nicklas |
186 |
dc.close(); |
2099 |
21 Mar 06 |
nicklas |
187 |
cc.setQuery(query); |
2099 |
21 Mar 06 |
nicklas |
188 |
redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+bioassays"; |
2099 |
21 Mar 06 |
nicklas |
189 |
} |
2099 |
21 Mar 06 |
nicklas |
190 |
else if ("ExportItem".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
191 |
{ |
2099 |
21 Mar 06 |
nicklas |
192 |
// Run an export plugin in single-item context |
2099 |
21 Mar 06 |
nicklas |
193 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
194 |
redirect = "../../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+bioassay"; |
2099 |
21 Mar 06 |
nicklas |
195 |
} |
2099 |
21 Mar 06 |
nicklas |
196 |
else if ("ImportItems".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
197 |
{ |
2099 |
21 Mar 06 |
nicklas |
198 |
// Run an import plugin in a list context |
2099 |
21 Mar 06 |
nicklas |
199 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
200 |
dc = sc.newDbControl(":Import "+itemType); |
2099 |
21 Mar 06 |
nicklas |
201 |
final BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId); |
5590 |
16 Mar 11 |
nicklas |
202 |
final ItemQuery<BioAssay> query = bioAssaySet.getBioAssays(); |
5590 |
16 Mar 11 |
nicklas |
203 |
cc.configureQuery(dc, query, true); |
2099 |
21 Mar 06 |
nicklas |
204 |
dc.close(); |
2099 |
21 Mar 06 |
nicklas |
205 |
cc.setQuery(query); |
2099 |
21 Mar 06 |
nicklas |
206 |
redirect = "../../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Import+bioassays"; |
2099 |
21 Mar 06 |
nicklas |
207 |
} |
2099 |
21 Mar 06 |
nicklas |
208 |
else if ("ImportItem".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
209 |
{ |
2099 |
21 Mar 06 |
nicklas |
210 |
// Run an import plugin in single-item context |
2099 |
21 Mar 06 |
nicklas |
211 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
212 |
redirect = "../../../common/import/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Import+bioassay"; |
2099 |
21 Mar 06 |
nicklas |
213 |
} |
2099 |
21 Mar 06 |
nicklas |
214 |
else if ("RunListPlugin".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
215 |
{ |
2099 |
21 Mar 06 |
nicklas |
216 |
// Run another plugin in a list context |
2099 |
21 Mar 06 |
nicklas |
217 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
7954 |
12 May 21 |
nicklas |
218 |
dc = sc.newDbControl(":Run plugin "+itemType); |
2099 |
21 Mar 06 |
nicklas |
219 |
final BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId); |
5590 |
16 Mar 11 |
nicklas |
220 |
final ItemQuery<BioAssay> query = bioAssaySet.getBioAssays(); |
5590 |
16 Mar 11 |
nicklas |
221 |
cc.configureQuery(dc, query, true); |
2099 |
21 Mar 06 |
nicklas |
222 |
dc.close(); |
2099 |
21 Mar 06 |
nicklas |
223 |
cc.setQuery(query); |
2099 |
21 Mar 06 |
nicklas |
224 |
redirect = "../../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=OTHER&title=Run+plugin"; |
2099 |
21 Mar 06 |
nicklas |
225 |
} |
2099 |
21 Mar 06 |
nicklas |
226 |
else if ("RunPlugin".equals(cmd)) |
2099 |
21 Mar 06 |
nicklas |
227 |
{ |
2099 |
21 Mar 06 |
nicklas |
228 |
// Run a plugin in single-item context |
2099 |
21 Mar 06 |
nicklas |
229 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2099 |
21 Mar 06 |
nicklas |
230 |
redirect = "../../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin"; |
2099 |
21 Mar 06 |
nicklas |
231 |
} |
2738 |
17 Oct 06 |
nicklas |
232 |
else if ("RunListAnalysisPlugin".equals(cmd)) |
2738 |
17 Oct 06 |
nicklas |
233 |
{ |
2738 |
17 Oct 06 |
nicklas |
234 |
// Run an analysis plugin in list context |
2738 |
17 Oct 06 |
nicklas |
235 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
2738 |
17 Oct 06 |
nicklas |
236 |
redirect = "../../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=ANALYZE&title=Run+analysis+plugin"; |
2738 |
17 Oct 06 |
nicklas |
237 |
} |
2738 |
17 Oct 06 |
nicklas |
238 |
else if ("NewFilteredBioAssaySet".equals(cmd)) |
2738 |
17 Oct 06 |
nicklas |
239 |
{ |
2738 |
17 Oct 06 |
nicklas |
240 |
// Display the edit page for for filtering a bioassay set (should be opened in a popup) |
2738 |
17 Oct 06 |
nicklas |
241 |
ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); |
4338 |
17 Jun 08 |
nicklas |
242 |
redirect = "../../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&main_type=ANALYZE&title=Filter+bioassay+set&plugin_type=net.sf.basedb.core.plugin.AnalysisFilterPlugin"; |
2738 |
17 Oct 06 |
nicklas |
243 |
} |
2099 |
21 Mar 06 |
nicklas |
244 |
else |
2099 |
21 Mar 06 |
nicklas |
245 |
{ |
2099 |
21 Mar 06 |
nicklas |
246 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
2099 |
21 Mar 06 |
nicklas |
247 |
} |
2099 |
21 Mar 06 |
nicklas |
248 |
} |
2099 |
21 Mar 06 |
nicklas |
249 |
finally |
2099 |
21 Mar 06 |
nicklas |
250 |
{ |
2099 |
21 Mar 06 |
nicklas |
251 |
if (dc != null) dc.close(); |
2099 |
21 Mar 06 |
nicklas |
252 |
} |
2099 |
21 Mar 06 |
nicklas |
253 |
|
2099 |
21 Mar 06 |
nicklas |
254 |
if (forward != null) |
2099 |
21 Mar 06 |
nicklas |
255 |
{ |
6192 |
31 Oct 12 |
nicklas |
256 |
sc.setSessionSetting("alert-message", message); |
2099 |
21 Mar 06 |
nicklas |
257 |
pageContext.forward(forward); |
2099 |
21 Mar 06 |
nicklas |
258 |
} |
2099 |
21 Mar 06 |
nicklas |
259 |
else if (redirect != null) |
2099 |
21 Mar 06 |
nicklas |
260 |
{ |
6192 |
31 Oct 12 |
nicklas |
261 |
sc.setSessionSetting("alert-message", message); |
2099 |
21 Mar 06 |
nicklas |
262 |
response.sendRedirect(redirect); |
2099 |
21 Mar 06 |
nicklas |
263 |
} |
2099 |
21 Mar 06 |
nicklas |
264 |
else if (message == null) |
2099 |
21 Mar 06 |
nicklas |
265 |
{ |
2099 |
21 Mar 06 |
nicklas |
266 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0"); |
2099 |
21 Mar 06 |
nicklas |
267 |
} |
2099 |
21 Mar 06 |
nicklas |
268 |
else |
2099 |
21 Mar 06 |
nicklas |
269 |
{ |
2099 |
21 Mar 06 |
nicklas |
270 |
response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message)); |
2099 |
21 Mar 06 |
nicklas |
271 |
} |
2099 |
21 Mar 06 |
nicklas |
272 |
%> |
2099 |
21 Mar 06 |
nicklas |
273 |
|