7768 |
07 Feb 20 |
nicklas |
1 |
<%-- $Id $ |
7768 |
07 Feb 20 |
nicklas |
2 |
------------------------------------------------------------------ |
7768 |
07 Feb 20 |
nicklas |
Copyright (C) 2015 Nicklas Nordborg |
7768 |
07 Feb 20 |
nicklas |
4 |
|
7768 |
07 Feb 20 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7768 |
07 Feb 20 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7768 |
07 Feb 20 |
nicklas |
7 |
|
7768 |
07 Feb 20 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7768 |
07 Feb 20 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7768 |
07 Feb 20 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7768 |
07 Feb 20 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7768 |
07 Feb 20 |
nicklas |
12 |
|
7768 |
07 Feb 20 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7768 |
07 Feb 20 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7768 |
07 Feb 20 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7768 |
07 Feb 20 |
nicklas |
16 |
GNU General Public License for more details. |
7768 |
07 Feb 20 |
nicklas |
17 |
|
7768 |
07 Feb 20 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7768 |
07 Feb 20 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7768 |
07 Feb 20 |
nicklas |
20 |
------------------------------------------------------------------ |
7768 |
07 Feb 20 |
nicklas |
21 |
|
7768 |
07 Feb 20 |
nicklas |
22 |
--%> |
7768 |
07 Feb 20 |
nicklas |
23 |
<%@ page pageEncoding="UTF-8" session="false" contentType="application/json" |
7768 |
07 Feb 20 |
nicklas |
24 |
import="net.sf.basedb.core.SessionControl" |
7768 |
07 Feb 20 |
nicklas |
25 |
import="net.sf.basedb.core.DbControl" |
7768 |
07 Feb 20 |
nicklas |
26 |
import="net.sf.basedb.core.AnnotationType" |
7768 |
07 Feb 20 |
nicklas |
27 |
import="net.sf.basedb.core.Annotation" |
7794 |
03 Mar 20 |
nicklas |
28 |
import="net.sf.basedb.core.BasicItem" |
7768 |
07 Feb 20 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
7768 |
07 Feb 20 |
nicklas |
30 |
import="net.sf.basedb.core.Type" |
7768 |
07 Feb 20 |
nicklas |
31 |
import="net.sf.basedb.core.ItemQuery" |
7852 |
16 Oct 20 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
7768 |
07 Feb 20 |
nicklas |
33 |
import="net.sf.basedb.core.ItemSubtype" |
7843 |
02 Sep 20 |
nicklas |
34 |
import="net.sf.basedb.core.RawDataTypes" |
7843 |
02 Sep 20 |
nicklas |
35 |
import="net.sf.basedb.core.RawDataType" |
7768 |
07 Feb 20 |
nicklas |
36 |
import="net.sf.basedb.core.plugin.GuiContext" |
8083 |
20 Oct 22 |
nicklas |
37 |
import="net.sf.basedb.core.SyncFilter.SourceItemTransform" |
7768 |
07 Feb 20 |
nicklas |
38 |
import="net.sf.basedb.util.Values" |
7794 |
03 Mar 20 |
nicklas |
39 |
import="net.sf.basedb.util.formatter.Formatter" |
8083 |
20 Oct 22 |
nicklas |
40 |
import="net.sf.basedb.util.formatter.ToStringFormatter" |
7768 |
07 Feb 20 |
nicklas |
41 |
import="net.sf.basedb.util.error.ThrowableUtil" |
8083 |
20 Oct 22 |
nicklas |
42 |
import="net.sf.basedb.util.extensions.ActionIterator" |
7768 |
07 Feb 20 |
nicklas |
43 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
8083 |
20 Oct 22 |
nicklas |
44 |
import="net.sf.basedb.util.listable.ListableUtil" |
8083 |
20 Oct 22 |
nicklas |
45 |
import="net.sf.basedb.util.listable.SourceItemTransformerFactory" |
7773 |
17 Feb 20 |
nicklas |
46 |
import="net.sf.basedb.core.query.Restrictions" |
7773 |
17 Feb 20 |
nicklas |
47 |
import="net.sf.basedb.core.query.Expressions" |
7773 |
17 Feb 20 |
nicklas |
48 |
import="net.sf.basedb.core.query.Hql" |
7768 |
07 Feb 20 |
nicklas |
49 |
import="net.sf.basedb.clients.web.AnnotationUtil" |
7768 |
07 Feb 20 |
nicklas |
50 |
import="net.sf.basedb.clients.web.Base" |
7768 |
07 Feb 20 |
nicklas |
51 |
import="net.sf.basedb.clients.web.WebException" |
8083 |
20 Oct 22 |
nicklas |
52 |
import="net.sf.basedb.clients.web.util.HTML" |
7768 |
07 Feb 20 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
7768 |
07 Feb 20 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
7768 |
07 Feb 20 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
7768 |
07 Feb 20 |
nicklas |
56 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
8083 |
20 Oct 22 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.list.RelatedItemExtensionColumn" |
8083 |
20 Oct 22 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.list.RelatedItemColumn.Specification" |
7768 |
07 Feb 20 |
nicklas |
59 |
import="org.json.simple.JSONObject" |
7768 |
07 Feb 20 |
nicklas |
60 |
import="org.json.simple.JSONArray" |
7768 |
07 Feb 20 |
nicklas |
61 |
import="java.util.Arrays" |
7768 |
07 Feb 20 |
nicklas |
62 |
import="java.util.List" |
7840 |
31 Aug 20 |
nicklas |
63 |
import="java.util.ArrayList" |
7768 |
07 Feb 20 |
nicklas |
64 |
import="java.util.HashSet" |
7768 |
07 Feb 20 |
nicklas |
65 |
%> |
7768 |
07 Feb 20 |
nicklas |
66 |
<% |
7768 |
07 Feb 20 |
nicklas |
67 |
response.setHeader("Cache-Control", "no-cache, max-age=0"); |
7768 |
07 Feb 20 |
nicklas |
68 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
7768 |
07 Feb 20 |
nicklas |
69 |
final String ID = sc.getId(); |
7768 |
07 Feb 20 |
nicklas |
70 |
final String cmd = request.getParameter("cmd"); |
7768 |
07 Feb 20 |
nicklas |
71 |
final String root = request.getContextPath()+"/"; |
7768 |
07 Feb 20 |
nicklas |
72 |
final Item itemType = Item.valueOf(request.getParameter("itemType")); |
7768 |
07 Feb 20 |
nicklas |
73 |
DbControl dc = null; |
7768 |
07 Feb 20 |
nicklas |
74 |
out.clear(); |
7768 |
07 Feb 20 |
nicklas |
75 |
JSONObject json = new JSONObject(); |
7768 |
07 Feb 20 |
nicklas |
76 |
json.put("status", "ok"); |
7768 |
07 Feb 20 |
nicklas |
77 |
try |
7768 |
07 Feb 20 |
nicklas |
78 |
{ |
7768 |
07 Feb 20 |
nicklas |
79 |
if ("GetSubtypesAndAnnotationTypes".equals(cmd)) |
7768 |
07 Feb 20 |
nicklas |
80 |
{ |
7954 |
12 May 21 |
nicklas |
81 |
dc = sc.newDbControl(":Get subtypes and annotation types"); |
8083 |
20 Oct 22 |
nicklas |
82 |
|
8083 |
20 Oct 22 |
nicklas |
83 |
Item sourceItemType = Item.valueOf(request.getParameter("sourceItemType")); |
8083 |
20 Oct 22 |
nicklas |
84 |
String direction = Values.getString(request.getParameter("direction"), "PARENT"); |
7768 |
07 Feb 20 |
nicklas |
85 |
|
8083 |
20 Oct 22 |
nicklas |
86 |
JSONArray jsonAllowedChildTypes = new JSONArray(); |
8083 |
20 Oct 22 |
nicklas |
87 |
json.put("childTypes", jsonAllowedChildTypes); |
8083 |
20 Oct 22 |
nicklas |
88 |
if ("PARENT".equals(direction)) |
8083 |
20 Oct 22 |
nicklas |
89 |
{ |
8083 |
20 Oct 22 |
nicklas |
90 |
SourceItemTransformerFactory factory = ListableUtil.getTransformerFactory(itemType); |
8083 |
20 Oct 22 |
nicklas |
91 |
List<Item> allowedChildItems = factory.getSupportedSourceItems(SourceItemTransform.CHILD_TO_PARENT); |
8083 |
20 Oct 22 |
nicklas |
92 |
for (Item childType : allowedChildItems) |
8083 |
20 Oct 22 |
nicklas |
93 |
{ |
8083 |
20 Oct 22 |
nicklas |
94 |
JSONObject jsonCt = new JSONObject(); |
8083 |
20 Oct 22 |
nicklas |
95 |
jsonCt.put("id", childType.name()); |
8083 |
20 Oct 22 |
nicklas |
96 |
jsonCt.put("name", childType.toString()); |
8083 |
20 Oct 22 |
nicklas |
97 |
jsonAllowedChildTypes.add(jsonCt); |
8083 |
20 Oct 22 |
nicklas |
98 |
} |
8083 |
20 Oct 22 |
nicklas |
99 |
} |
8083 |
20 Oct 22 |
nicklas |
100 |
|
7768 |
07 Feb 20 |
nicklas |
101 |
JSONArray jsonSubtypes = new JSONArray(); |
7843 |
02 Sep 20 |
nicklas |
102 |
json.put("subtypes", jsonSubtypes); |
7843 |
02 Sep 20 |
nicklas |
103 |
|
7843 |
02 Sep 20 |
nicklas |
104 |
if (itemType == Item.RAWBIOASSAY) |
7768 |
07 Feb 20 |
nicklas |
105 |
{ |
7843 |
02 Sep 20 |
nicklas |
106 |
for (RawDataType rdt : RawDataTypes.getRawDataTypes()) |
7843 |
02 Sep 20 |
nicklas |
107 |
{ |
7843 |
02 Sep 20 |
nicklas |
108 |
JSONObject jsonSt = new JSONObject(); |
7843 |
02 Sep 20 |
nicklas |
109 |
jsonSt.put("id", rdt.getId()); |
7843 |
02 Sep 20 |
nicklas |
110 |
jsonSt.put("name", rdt.getName()); |
7843 |
02 Sep 20 |
nicklas |
111 |
jsonSubtypes.add(jsonSt); |
7843 |
02 Sep 20 |
nicklas |
112 |
} |
7768 |
07 Feb 20 |
nicklas |
113 |
} |
7843 |
02 Sep 20 |
nicklas |
114 |
else |
7843 |
02 Sep 20 |
nicklas |
115 |
{ |
7843 |
02 Sep 20 |
nicklas |
116 |
ItemQuery<ItemSubtype> subtypeQuery = Base.getSubtypesQuery(itemType); |
7843 |
02 Sep 20 |
nicklas |
117 |
for (ItemSubtype st : subtypeQuery.list(dc)) |
7843 |
02 Sep 20 |
nicklas |
118 |
{ |
7843 |
02 Sep 20 |
nicklas |
119 |
JSONObject jsonSt = new JSONObject(); |
7843 |
02 Sep 20 |
nicklas |
120 |
jsonSt.put("id", st.getId()); |
7843 |
02 Sep 20 |
nicklas |
121 |
jsonSt.put("name", st.getName()); |
7843 |
02 Sep 20 |
nicklas |
122 |
jsonSubtypes.add(jsonSt); |
7843 |
02 Sep 20 |
nicklas |
123 |
} |
7843 |
02 Sep 20 |
nicklas |
124 |
} |
7768 |
07 Feb 20 |
nicklas |
125 |
|
7768 |
07 Feb 20 |
nicklas |
126 |
ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
7768 |
07 Feb 20 |
nicklas |
127 |
JSONArray jsonAnnotationTypes = new JSONArray(); |
7768 |
07 Feb 20 |
nicklas |
128 |
for (AnnotationType at : annotationTypeQuery.list(dc)) |
7768 |
07 Feb 20 |
nicklas |
129 |
{ |
7768 |
07 Feb 20 |
nicklas |
130 |
JSONObject jsonAt = new JSONObject(); |
7768 |
07 Feb 20 |
nicklas |
131 |
jsonAt.put("id", at.getId()); |
7768 |
07 Feb 20 |
nicklas |
132 |
jsonAt.put("name", at.getName()); |
7768 |
07 Feb 20 |
nicklas |
133 |
jsonAnnotationTypes.add(jsonAt); |
7768 |
07 Feb 20 |
nicklas |
134 |
} |
7768 |
07 Feb 20 |
nicklas |
135 |
json.put("annotationTypes", jsonAnnotationTypes); |
7768 |
07 Feb 20 |
nicklas |
136 |
|
8083 |
20 Oct 22 |
nicklas |
137 |
Specification spec = Specification.parse(sourceItemType, "/"+direction+"/"+itemType.name()+"/*/*"); |
8083 |
20 Oct 22 |
nicklas |
138 |
GuiContext guiContext = GuiContext.list(itemType, RelatedItemExtensionColumn.SUBCONTEXT); |
8083 |
20 Oct 22 |
nicklas |
139 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, spec); |
8083 |
20 Oct 22 |
nicklas |
140 |
ExtensionsInvoker<ListColumnAction<BasicItem,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
8083 |
20 Oct 22 |
nicklas |
141 |
ActionIterator<ListColumnAction<BasicItem,?>> it = columnsInvoker.iterate(); |
8083 |
20 Oct 22 |
nicklas |
142 |
JSONArray jsonExtensions = new JSONArray(); |
8083 |
20 Oct 22 |
nicklas |
143 |
while (it.hasNext()) |
8083 |
20 Oct 22 |
nicklas |
144 |
{ |
8083 |
20 Oct 22 |
nicklas |
145 |
ListColumnAction<BasicItem,?> col = it.next(); |
8083 |
20 Oct 22 |
nicklas |
146 |
JSONObject jsonXt = new JSONObject(); |
8083 |
20 Oct 22 |
nicklas |
147 |
jsonXt.put("id", it.getExtension().getId()); |
8083 |
20 Oct 22 |
nicklas |
148 |
jsonXt.put("columnId", col.getId()); |
8083 |
20 Oct 22 |
nicklas |
149 |
jsonXt.put("name", HTML.stripMarkup(col.getTitle())); |
8083 |
20 Oct 22 |
nicklas |
150 |
jsonXt.put("nameHTML", col.getTitle()); |
8083 |
20 Oct 22 |
nicklas |
151 |
jsonXt.put("tooltip", col.getTooltip()); |
8083 |
20 Oct 22 |
nicklas |
152 |
jsonExtensions.add(jsonXt); |
8083 |
20 Oct 22 |
nicklas |
153 |
} |
8083 |
20 Oct 22 |
nicklas |
154 |
json.put("extensionColumns", jsonExtensions); |
7768 |
07 Feb 20 |
nicklas |
155 |
} |
7773 |
17 Feb 20 |
nicklas |
156 |
else if ("GetAnnotationTypesForCategory".equals(cmd)) |
7773 |
17 Feb 20 |
nicklas |
157 |
{ |
7954 |
12 May 21 |
nicklas |
158 |
dc = sc.newDbControl(":Get annotation types"); |
7773 |
17 Feb 20 |
nicklas |
159 |
String category = Values.getStringOrNull(request.getParameter("category")); |
7773 |
17 Feb 20 |
nicklas |
160 |
JSONArray jsonAnnotationTypes = new JSONArray(); |
7773 |
17 Feb 20 |
nicklas |
161 |
if (category != null) |
7773 |
17 Feb 20 |
nicklas |
162 |
{ |
7773 |
17 Feb 20 |
nicklas |
163 |
ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
7773 |
17 Feb 20 |
nicklas |
164 |
annotationTypeQuery.join(Hql.innerJoin("categories", "c")); |
7773 |
17 Feb 20 |
nicklas |
165 |
annotationTypeQuery.restrict(Restrictions.eq(Hql.property("c", "name"), Expressions.string(category))); |
7773 |
17 Feb 20 |
nicklas |
166 |
for (AnnotationType at : annotationTypeQuery.list(dc)) |
7773 |
17 Feb 20 |
nicklas |
167 |
{ |
7773 |
17 Feb 20 |
nicklas |
168 |
JSONObject jsonAt = new JSONObject(); |
7773 |
17 Feb 20 |
nicklas |
169 |
jsonAt.put("id", at.getId()); |
7773 |
17 Feb 20 |
nicklas |
170 |
jsonAt.put("name", at.getName()); |
7773 |
17 Feb 20 |
nicklas |
171 |
jsonAnnotationTypes.add(jsonAt); |
7773 |
17 Feb 20 |
nicklas |
172 |
} |
7773 |
17 Feb 20 |
nicklas |
173 |
} |
8083 |
20 Oct 22 |
nicklas |
174 |
|
7773 |
17 Feb 20 |
nicklas |
175 |
json.put("annotationTypesCategory", jsonAnnotationTypes); |
7773 |
17 Feb 20 |
nicklas |
176 |
} |
7840 |
31 Aug 20 |
nicklas |
177 |
else if ("GetLazyItemColumns".equals(cmd)) |
7768 |
07 Feb 20 |
nicklas |
178 |
{ |
8083 |
20 Oct 22 |
nicklas |
179 |
String subContext = Values.getString(request.getParameter("subcontext")); |
7768 |
07 Feb 20 |
nicklas |
180 |
GuiContext guiContext = GuiContext.list(itemType, subContext); |
8083 |
20 Oct 22 |
nicklas |
181 |
ItemContext cc = sc.getCurrentContext(itemType, subContext); |
7768 |
07 Feb 20 |
nicklas |
182 |
Integer[] items = Values.getInt(request.getParameter("items").split(",")); |
8083 |
20 Oct 22 |
nicklas |
183 |
int remaining = Values.getInt(request.getParameter("remaining"), -1); |
7954 |
12 May 21 |
nicklas |
184 |
dc = sc.newDbControl(":Get lazy columns"); |
7768 |
07 Feb 20 |
nicklas |
185 |
|
7768 |
07 Feb 20 |
nicklas |
186 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
8083 |
20 Oct 22 |
nicklas |
187 |
jspContext.loadAttributes(cc, "lazy-related-items-attributes"); |
8083 |
20 Oct 22 |
nicklas |
188 |
if (remaining == 0) cc.removeObject("lazy-related-items-attributes"); |
8083 |
20 Oct 22 |
nicklas |
189 |
|
7768 |
07 Feb 20 |
nicklas |
190 |
jspContext.setAttribute("lazy-loading", false); |
7794 |
03 Mar 20 |
nicklas |
191 |
ExtensionsInvoker<ListColumnAction<BasicItem, ?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
7840 |
31 Aug 20 |
nicklas |
192 |
List<ListColumnAction<BasicItem, ?>> columnActions = new ArrayList<>(); |
7840 |
31 Aug 20 |
nicklas |
193 |
columnsInvoker.forEach(columnActions::add); |
7768 |
07 Feb 20 |
nicklas |
194 |
|
7768 |
07 Feb 20 |
nicklas |
195 |
JSONArray jsonLazy = new JSONArray(); |
7768 |
07 Feb 20 |
nicklas |
196 |
int index = 0; |
7768 |
07 Feb 20 |
nicklas |
197 |
for (Integer id : items) |
7768 |
07 Feb 20 |
nicklas |
198 |
{ |
7794 |
03 Mar 20 |
nicklas |
199 |
BasicItem item = itemType.getById(dc, id); |
7768 |
07 Feb 20 |
nicklas |
200 |
JSONObject jsonItem = new JSONObject(); |
7768 |
07 Feb 20 |
nicklas |
201 |
JSONArray jsonCols = new JSONArray(); |
7768 |
07 Feb 20 |
nicklas |
202 |
jsonItem.put("id", id); |
7768 |
07 Feb 20 |
nicklas |
203 |
jsonItem.put("data", jsonCols); |
7840 |
31 Aug 20 |
nicklas |
204 |
|
7840 |
31 Aug 20 |
nicklas |
205 |
for (ListColumnAction<BasicItem, ?> col : columnActions) |
7768 |
07 Feb 20 |
nicklas |
206 |
{ |
7768 |
07 Feb 20 |
nicklas |
207 |
if (col.getId().startsWith("/")) |
7768 |
07 Feb 20 |
nicklas |
208 |
{ |
7794 |
03 Mar 20 |
nicklas |
209 |
@SuppressWarnings("unchecked") |
7794 |
03 Mar 20 |
nicklas |
210 |
Formatter<Object> f = (Formatter<Object>)col.getFormatter(); |
8083 |
20 Oct 22 |
nicklas |
211 |
if (f == null) f = new ToStringFormatter<>(); |
7794 |
03 Mar 20 |
nicklas |
212 |
jsonCols.add(f.format(col.getValue(dc, item))); |
7768 |
07 Feb 20 |
nicklas |
213 |
} |
7768 |
07 Feb 20 |
nicklas |
214 |
} |
7768 |
07 Feb 20 |
nicklas |
215 |
jsonLazy.add(jsonItem); |
7768 |
07 Feb 20 |
nicklas |
216 |
} |
7768 |
07 Feb 20 |
nicklas |
217 |
json.put("items", jsonLazy); |
7768 |
07 Feb 20 |
nicklas |
218 |
} |
7852 |
16 Oct 20 |
nicklas |
219 |
else if ("AddRecentlyUsedLinkTargetType".equals(cmd)) |
7852 |
16 Oct 20 |
nicklas |
220 |
{ |
7852 |
16 Oct 20 |
nicklas |
221 |
ItemContext cc = Base.getAndSetCurrentContext(sc, Item.ANYTOANY, null, null); |
7852 |
16 Oct 20 |
nicklas |
222 |
cc.setRecent("toTypes", itemType.name(), Base.getMaxRecent(sc)); |
7852 |
16 Oct 20 |
nicklas |
223 |
} |
7768 |
07 Feb 20 |
nicklas |
224 |
else |
7768 |
07 Feb 20 |
nicklas |
225 |
{ |
7768 |
07 Feb 20 |
nicklas |
226 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
7768 |
07 Feb 20 |
nicklas |
227 |
} |
7768 |
07 Feb 20 |
nicklas |
228 |
} |
7768 |
07 Feb 20 |
nicklas |
229 |
catch (Throwable t) |
7768 |
07 Feb 20 |
nicklas |
230 |
{ |
7768 |
07 Feb 20 |
nicklas |
231 |
t.printStackTrace(); |
7768 |
07 Feb 20 |
nicklas |
232 |
json.clear(); |
7768 |
07 Feb 20 |
nicklas |
233 |
json.put("status", "error"); |
7768 |
07 Feb 20 |
nicklas |
234 |
json.put("message", t.getMessage()); |
7768 |
07 Feb 20 |
nicklas |
235 |
json.put("stacktrace", ThrowableUtil.stackTraceToString(t)); |
7768 |
07 Feb 20 |
nicklas |
236 |
} |
7768 |
07 Feb 20 |
nicklas |
237 |
finally |
7768 |
07 Feb 20 |
nicklas |
238 |
{ |
7768 |
07 Feb 20 |
nicklas |
239 |
json.writeJSONString(out); |
7768 |
07 Feb 20 |
nicklas |
240 |
out.flush(); |
7768 |
07 Feb 20 |
nicklas |
241 |
if (dc != null) dc.close(); |
7768 |
07 Feb 20 |
nicklas |
242 |
} |
7768 |
07 Feb 20 |
nicklas |
243 |
%> |