4198 |
28 Mar 08 |
nicklas |
1 |
<%-- $Id:tree.jsp 4187 2008-03-20 11:15:25Z nicklas $ |
4168 |
04 Mar 08 |
nicklas |
2 |
------------------------------------------------------------------ |
4168 |
04 Mar 08 |
nicklas |
Copyright (C) 2006 Nicklas Nordborg |
4168 |
04 Mar 08 |
nicklas |
4 |
|
4168 |
04 Mar 08 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
4168 |
04 Mar 08 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
4168 |
04 Mar 08 |
nicklas |
7 |
|
4168 |
04 Mar 08 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
4168 |
04 Mar 08 |
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 |
4168 |
04 Mar 08 |
nicklas |
11 |
of the License, or (at your option) any later version. |
4168 |
04 Mar 08 |
nicklas |
12 |
|
4168 |
04 Mar 08 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
4168 |
04 Mar 08 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4168 |
04 Mar 08 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4168 |
04 Mar 08 |
nicklas |
16 |
GNU General Public License for more details. |
4168 |
04 Mar 08 |
nicklas |
17 |
|
4168 |
04 Mar 08 |
nicklas |
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/>. |
4168 |
04 Mar 08 |
nicklas |
20 |
------------------------------------------------------------------ |
4168 |
04 Mar 08 |
nicklas |
21 |
|
4168 |
04 Mar 08 |
nicklas |
22 |
@author Nicklas |
4168 |
04 Mar 08 |
nicklas |
23 |
@version 2.0 |
4168 |
04 Mar 08 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
4168 |
04 Mar 08 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
4181 |
18 Mar 08 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
4168 |
04 Mar 08 |
nicklas |
28 |
import="net.sf.basedb.core.Item" |
4168 |
04 Mar 08 |
nicklas |
29 |
import="net.sf.basedb.core.Permission" |
4168 |
04 Mar 08 |
nicklas |
30 |
import="net.sf.basedb.clients.web.Base" |
4168 |
04 Mar 08 |
nicklas |
31 |
import="net.sf.basedb.clients.web.util.HTML" |
4168 |
04 Mar 08 |
nicklas |
32 |
import="net.sf.basedb.util.Values" |
5760 |
26 Sep 11 |
nicklas |
33 |
import="net.sf.basedb.util.extensions.Registry" |
4168 |
04 Mar 08 |
nicklas |
34 |
import="net.sf.basedb.util.extensions.ExtensionPoint" |
4168 |
04 Mar 08 |
nicklas |
35 |
import="net.sf.basedb.util.extensions.Extension" |
4198 |
28 Mar 08 |
nicklas |
36 |
import="net.sf.basedb.util.extensions.Action" |
5601 |
01 Apr 11 |
nicklas |
37 |
import="net.sf.basedb.util.extensions.manager.ExtensionsFile" |
5615 |
19 Apr 11 |
nicklas |
38 |
import="net.sf.basedb.util.extensions.manager.ExtensionKey" |
5615 |
19 Apr 11 |
nicklas |
39 |
import="net.sf.basedb.util.extensions.manager.ExtensionPointKey" |
5615 |
19 Apr 11 |
nicklas |
40 |
import="net.sf.basedb.util.extensions.xml.PluginInfo" |
4181 |
18 Mar 08 |
nicklas |
41 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4168 |
04 Mar 08 |
nicklas |
42 |
import="net.sf.basedb.core.plugin.About" |
4168 |
04 Mar 08 |
nicklas |
43 |
import="java.util.List" |
4168 |
04 Mar 08 |
nicklas |
44 |
import="java.util.Iterator" |
5760 |
26 Sep 11 |
nicklas |
45 |
import="java.util.Collections" |
7605 |
26 Feb 19 |
nicklas |
46 |
import="java.util.Comparator" |
6380 |
16 Dec 13 |
nicklas |
47 |
import="org.json.simple.JSONArray" |
6380 |
16 Dec 13 |
nicklas |
48 |
import="org.json.simple.JSONObject" |
4168 |
04 Mar 08 |
nicklas |
49 |
%> |
4168 |
04 Mar 08 |
nicklas |
50 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4198 |
28 Mar 08 |
nicklas |
51 |
<%! |
8000 |
10 Aug 21 |
nicklas |
52 |
JSONObject newJoustExtensionPoint(DbControl dc, JSONObject jsonParent, ExtensionsControl ec, ExtensionPoint<?> ep, ExtensionsFile ef, boolean showFile) |
4198 |
28 Mar 08 |
nicklas |
53 |
{ |
4198 |
28 Mar 08 |
nicklas |
54 |
String id = ep.getId(); |
8000 |
10 Aug 21 |
nicklas |
55 |
String name = HTML.encodeTags(ep.getName()); |
4198 |
28 Mar 08 |
nicklas |
56 |
if (name == null) name = id; |
8000 |
10 Aug 21 |
nicklas |
57 |
if (showFile && ef != null) |
8000 |
10 Aug 21 |
nicklas |
58 |
{ |
8000 |
10 Aug 21 |
nicklas |
59 |
name += " <span class=\"itemref\">[" + HTML.encodeTags(ef.getName()) + "]</span>"; |
8000 |
10 Aug 21 |
nicklas |
60 |
} |
4198 |
28 Mar 08 |
nicklas |
61 |
String icon = ec.isEnabled(ep) ? "ExtensionPoint" : "ExtensionPointDisabled"; |
5615 |
19 Apr 11 |
nicklas |
62 |
if ((ef != null && ef.hasError()) || ec.getLastExtensionPointError(id) != null) |
4618 |
30 Oct 08 |
nicklas |
63 |
{ |
4618 |
30 Oct 08 |
nicklas |
64 |
icon = "ExtensionPointError"; |
4618 |
30 Oct 08 |
nicklas |
65 |
} |
8000 |
10 Aug 21 |
nicklas |
66 |
JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id); |
6380 |
16 Dec 13 |
nicklas |
67 |
json.put("type", "extension-point"); |
6380 |
16 Dec 13 |
nicklas |
68 |
return json; |
4198 |
28 Mar 08 |
nicklas |
69 |
} |
6380 |
16 Dec 13 |
nicklas |
70 |
|
7604 |
25 Feb 19 |
nicklas |
71 |
JSONObject newJoustExtension(DbControl dc, JSONObject jsonParent, ExtensionsControl ec, Extension<?> ext, ExtensionsFile ef, boolean inGroup, boolean showFile) |
4198 |
28 Mar 08 |
nicklas |
72 |
{ |
4198 |
28 Mar 08 |
nicklas |
73 |
String id = ext.getId(); |
4198 |
28 Mar 08 |
nicklas |
74 |
About about = ext.getAbout(); |
6381 |
17 Dec 13 |
nicklas |
75 |
String name = HTML.encodeTags(about == null || about.getName() == null ? id : about.getName()); |
5519 |
23 Nov 10 |
nicklas |
76 |
if (inGroup) name = ext.getId().substring(ext.getId().indexOf(":")); |
5616 |
27 Apr 11 |
nicklas |
77 |
if (showFile) |
5616 |
27 Apr 11 |
nicklas |
78 |
{ |
6381 |
17 Dec 13 |
nicklas |
79 |
name += " <span class=\"itemref\">[" + HTML.encodeTags(ef.getName()) + "]</span>"; |
5616 |
27 Apr 11 |
nicklas |
80 |
} |
5616 |
27 Apr 11 |
nicklas |
81 |
else |
5616 |
27 Apr 11 |
nicklas |
82 |
{ |
6381 |
17 Dec 13 |
nicklas |
83 |
name += " <span class=\"itemref\">[" + HTML.encodeTags(ec.getExtensionPoint(ext.getExtends()).getName()) + "]</span>"; |
5616 |
27 Apr 11 |
nicklas |
84 |
} |
4198 |
28 Mar 08 |
nicklas |
85 |
String icon = ec.isEnabled(ext) ? "Extension" : "ExtensionDisabled"; |
5615 |
19 Apr 11 |
nicklas |
86 |
if ((ef != null && ef.hasError()) || ec.getLastExtensionError(id) != null) |
4618 |
30 Oct 08 |
nicklas |
87 |
{ |
4618 |
30 Oct 08 |
nicklas |
88 |
icon = "ExtensionError"; |
4618 |
30 Oct 08 |
nicklas |
89 |
} |
6409 |
31 Jan 14 |
nicklas |
90 |
else if (ec.checkUnsafeScriptableUsage(ext)) |
6409 |
31 Jan 14 |
nicklas |
91 |
{ |
6409 |
31 Jan 14 |
nicklas |
92 |
icon = "ExtensionWarning"; |
6409 |
31 Jan 14 |
nicklas |
93 |
} |
6380 |
16 Dec 13 |
nicklas |
94 |
|
6684 |
14 Jan 15 |
nicklas |
95 |
JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id); |
6380 |
16 Dec 13 |
nicklas |
96 |
json.put("type", "extension"); |
6380 |
16 Dec 13 |
nicklas |
97 |
return json; |
4198 |
28 Mar 08 |
nicklas |
98 |
} |
6380 |
16 Dec 13 |
nicklas |
99 |
|
6684 |
14 Jan 15 |
nicklas |
100 |
JSONObject newJoustFile(DbControl dc, JSONObject jsonParent, ExtensionsFile ef, ExtensionsControl ec) |
5519 |
23 Nov 10 |
nicklas |
101 |
{ |
8000 |
10 Aug 21 |
nicklas |
102 |
String id = ef.getName(); |
8000 |
10 Aug 21 |
nicklas |
103 |
About about = ef.getAbout(); |
8000 |
10 Aug 21 |
nicklas |
104 |
String name = HTML.encodeTags(ef.getName()); |
8000 |
10 Aug 21 |
nicklas |
105 |
if (about != null && about.getVersion() != null) name += " <span class=\"itemref\">[" + HTML.encodeTags(about.getVersion()) + "]</span>"; |
6380 |
16 Dec 13 |
nicklas |
106 |
String icon = ef.isJar() ? "JarFile" : "XmlFile"; |
6409 |
31 Jan 14 |
nicklas |
107 |
if (ef.hasError()) |
6409 |
31 Jan 14 |
nicklas |
108 |
{ |
6409 |
31 Jan 14 |
nicklas |
109 |
icon += "Error"; |
6409 |
31 Jan 14 |
nicklas |
110 |
} |
6409 |
31 Jan 14 |
nicklas |
111 |
else if (ec.checkUnsafeScriptableUsage(ef).size() > 0) |
6409 |
31 Jan 14 |
nicklas |
112 |
{ |
6409 |
31 Jan 14 |
nicklas |
113 |
icon += "Warning"; |
6409 |
31 Jan 14 |
nicklas |
114 |
} |
6380 |
16 Dec 13 |
nicklas |
115 |
if (ef.checkModified()) icon += "Modified"; |
6380 |
16 Dec 13 |
nicklas |
116 |
|
8000 |
10 Aug 21 |
nicklas |
117 |
JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id); |
8000 |
10 Aug 21 |
nicklas |
118 |
json.put("id", id); |
6380 |
16 Dec 13 |
nicklas |
119 |
json.put("type", "file"); |
6380 |
16 Dec 13 |
nicklas |
120 |
json.put("fileUri", ef.getURI().toString()); |
6380 |
16 Dec 13 |
nicklas |
121 |
return json; |
6380 |
16 Dec 13 |
nicklas |
122 |
} |
6380 |
16 Dec 13 |
nicklas |
123 |
|
7604 |
25 Feb 19 |
nicklas |
124 |
JSONObject newJoustExtensionGroup(DbControl dc, JSONObject jsonParent, ExtensionsControl ec, Extension<?> ext, String groupId) |
6380 |
16 Dec 13 |
nicklas |
125 |
{ |
5519 |
23 Nov 10 |
nicklas |
126 |
String id = ext.getId(); |
5519 |
23 Nov 10 |
nicklas |
127 |
About about = ext.getAbout(); |
5519 |
23 Nov 10 |
nicklas |
128 |
String name = about == null || about.getName() == null ? id : about.getName(); |
5519 |
23 Nov 10 |
nicklas |
129 |
String icon = "Folder"; |
6684 |
14 Jan 15 |
nicklas |
130 |
JSONObject json = newJoustEntry(dc, jsonParent, icon, HTML.encodeTags(name), groupId); |
6381 |
17 Dec 13 |
nicklas |
131 |
json.put("type", "group"); |
6380 |
16 Dec 13 |
nicklas |
132 |
return json; |
5519 |
23 Nov 10 |
nicklas |
133 |
} |
6380 |
16 Dec 13 |
nicklas |
134 |
|
6684 |
14 Jan 15 |
nicklas |
135 |
JSONObject newJoustPlugin(DbControl dc, JSONObject jsonParent, ExtensionsControl ex, PluginInfo info, ExtensionsFile ef) |
5615 |
19 Apr 11 |
nicklas |
136 |
{ |
5615 |
19 Apr 11 |
nicklas |
137 |
String id = info.getClassName(); |
5615 |
19 Apr 11 |
nicklas |
138 |
About about = info.getAbout(); |
6381 |
17 Dec 13 |
nicklas |
139 |
String name = HTML.encodeTags(about == null || about.getName() == null ? id : about.getName()); |
5821 |
24 Oct 11 |
nicklas |
140 |
if (info.getType() != null) |
5821 |
24 Oct 11 |
nicklas |
141 |
{ |
5821 |
24 Oct 11 |
nicklas |
142 |
name += " <span class=\"itemref\">[" + info.getType().toString() + "]</span>"; |
5821 |
24 Oct 11 |
nicklas |
143 |
} |
5615 |
19 Apr 11 |
nicklas |
144 |
String icon = info.isDisabled() ? "PluginDisabled" : "Plugin"; |
5615 |
19 Apr 11 |
nicklas |
145 |
if ((ef != null && ef.hasError()) || !info.isInstalled()) |
5615 |
19 Apr 11 |
nicklas |
146 |
{ |
5615 |
19 Apr 11 |
nicklas |
147 |
icon = "PluginError"; |
5615 |
19 Apr 11 |
nicklas |
148 |
} |
5615 |
19 Apr 11 |
nicklas |
149 |
|
6684 |
14 Jan 15 |
nicklas |
150 |
JSONObject json = newJoustEntry(dc, jsonParent, icon, name, id); |
6380 |
16 Dec 13 |
nicklas |
151 |
json.put("type", "plugin"); |
6380 |
16 Dec 13 |
nicklas |
152 |
json.put("className", info.getClassName()); |
6380 |
16 Dec 13 |
nicklas |
153 |
return json; |
5615 |
19 Apr 11 |
nicklas |
154 |
} |
6380 |
16 Dec 13 |
nicklas |
155 |
|
6684 |
14 Jan 15 |
nicklas |
156 |
JSONObject newJoustEntry(DbControl dc, JSONObject jsonParent, String icon, String text, String id) |
6380 |
16 Dec 13 |
nicklas |
157 |
{ |
6380 |
16 Dec 13 |
nicklas |
158 |
JSONObject jsonJoust = new JSONObject(); |
6380 |
16 Dec 13 |
nicklas |
159 |
jsonJoust.put("icon", icon); |
6380 |
16 Dec 13 |
nicklas |
160 |
jsonJoust.put("text", text); |
6684 |
14 Jan 15 |
nicklas |
161 |
jsonJoust.put("id", "joust-"+dc.uniqueRandom()); |
6380 |
16 Dec 13 |
nicklas |
162 |
jsonJoust.put("externalId", id); |
6380 |
16 Dec 13 |
nicklas |
163 |
if (jsonParent != null) |
6380 |
16 Dec 13 |
nicklas |
164 |
{ |
6380 |
16 Dec 13 |
nicklas |
165 |
JSONArray jsonChildren = (JSONArray)jsonParent.get("children"); |
6380 |
16 Dec 13 |
nicklas |
166 |
if (jsonChildren == null) |
6380 |
16 Dec 13 |
nicklas |
167 |
{ |
6380 |
16 Dec 13 |
nicklas |
168 |
jsonChildren = new JSONArray(); |
6380 |
16 Dec 13 |
nicklas |
169 |
jsonParent.put("children", jsonChildren); |
6380 |
16 Dec 13 |
nicklas |
170 |
} |
6380 |
16 Dec 13 |
nicklas |
171 |
jsonChildren.add(jsonJoust); |
6380 |
16 Dec 13 |
nicklas |
172 |
} |
6380 |
16 Dec 13 |
nicklas |
173 |
return jsonJoust; |
6380 |
16 Dec 13 |
nicklas |
174 |
} |
7605 |
26 Feb 19 |
nicklas |
175 |
@SuppressWarnings({"rawtypes", "unchecked"}) |
7605 |
26 Feb 19 |
nicklas |
176 |
void sort(List list, Comparator cmp) |
7605 |
26 Feb 19 |
nicklas |
177 |
{ |
7605 |
26 Feb 19 |
nicklas |
178 |
Collections.sort(list, cmp); |
7605 |
26 Feb 19 |
nicklas |
179 |
} |
4198 |
28 Mar 08 |
nicklas |
180 |
%> |
4168 |
04 Mar 08 |
nicklas |
181 |
<% |
4168 |
04 Mar 08 |
nicklas |
182 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4168 |
04 Mar 08 |
nicklas |
183 |
final String ID = sc.getId(); |
4168 |
04 Mar 08 |
nicklas |
184 |
final float scale = Base.getScale(sc); |
4181 |
18 Mar 08 |
nicklas |
185 |
DbControl dc = null; |
6363 |
29 Nov 13 |
nicklas |
186 |
|
6684 |
14 Jan 15 |
nicklas |
187 |
try |
6380 |
16 Dec 13 |
nicklas |
188 |
{ |
7954 |
12 May 21 |
nicklas |
189 |
dc = sc.newDbControl(":Extension tree"); |
6684 |
14 Jan 15 |
nicklas |
190 |
// Build the Joust menu tree |
6684 |
14 Jan 15 |
nicklas |
191 |
JSONArray jsonJoust = new JSONArray(); |
6380 |
16 Dec 13 |
nicklas |
192 |
|
6684 |
14 Jan 15 |
nicklas |
193 |
// Two ROOT items: |
6684 |
14 Jan 15 |
nicklas |
194 |
JSONObject jsonByExtPoint = newJoustEntry(dc, null, "Root", "By extension point", "root.by-extension-point"); |
6684 |
14 Jan 15 |
nicklas |
195 |
jsonByExtPoint.put("isOpen", 1); |
6684 |
14 Jan 15 |
nicklas |
196 |
JSONObject jsonByFile = newJoustEntry(dc, null, "Root", "By file", "root.by-file"); |
6684 |
14 Jan 15 |
nicklas |
197 |
jsonByFile.put("isOpen", 1); |
6684 |
14 Jan 15 |
nicklas |
198 |
|
6684 |
14 Jan 15 |
nicklas |
199 |
// Group some extension points inside sub-folders |
6684 |
14 Jan 15 |
nicklas |
200 |
JSONObject jsonToolbars = newJoustEntry(dc, jsonByExtPoint, "Folder", "Toolbars", "by-extension-point.toolbars"); |
6684 |
14 Jan 15 |
nicklas |
201 |
JSONObject jsonEditDialogs = newJoustEntry(dc, jsonByExtPoint, "Folder", "Edit dialogs", "by-extension-point.edit-dialogs"); |
6684 |
14 Jan 15 |
nicklas |
202 |
JSONObject jsonListColumns = newJoustEntry(dc, jsonByExtPoint, "Folder", "List columns", "by-extension-point.list-columns"); |
6684 |
14 Jan 15 |
nicklas |
203 |
|
6684 |
14 Jan 15 |
nicklas |
204 |
jsonJoust.add(jsonByExtPoint); |
6684 |
14 Jan 15 |
nicklas |
205 |
jsonJoust.add(jsonByFile); |
6684 |
14 Jan 15 |
nicklas |
206 |
|
6684 |
14 Jan 15 |
nicklas |
207 |
ExtensionsControl ec = ExtensionsControl.get(dc); |
6684 |
14 Jan 15 |
nicklas |
208 |
List<ExtensionPoint<?>> extensionPoints = ec.getExtensionPoints(); |
7605 |
26 Feb 19 |
nicklas |
209 |
sort(extensionPoints, Registry.EXTENSIONPOINT_COMPARATOR); |
7604 |
25 Feb 19 |
nicklas |
210 |
for (ExtensionPoint<?> ep : extensionPoints) |
4168 |
04 Mar 08 |
nicklas |
211 |
{ |
6684 |
14 Jan 15 |
nicklas |
212 |
String id = ep.getId(); |
6684 |
14 Jan 15 |
nicklas |
213 |
JSONObject jsonParent = jsonByExtPoint; |
6684 |
14 Jan 15 |
nicklas |
214 |
if (id.startsWith("net.sf.basedb.clients.web.toolbar.")) jsonParent = jsonToolbars; |
6684 |
14 Jan 15 |
nicklas |
215 |
if (id.startsWith("net.sf.basedb.clients.web.tabcontrol.edit.")) jsonParent = jsonEditDialogs; |
6684 |
14 Jan 15 |
nicklas |
216 |
if (id.startsWith("net.sf.basedb.clients.web.onsave.")) jsonParent = jsonEditDialogs; |
6684 |
14 Jan 15 |
nicklas |
217 |
if (id.startsWith("net.sf.basedb.clients.web.listcolumn.")) jsonParent = jsonListColumns; |
6684 |
14 Jan 15 |
nicklas |
218 |
|
8000 |
10 Aug 21 |
nicklas |
219 |
JSONObject jsonEp = newJoustExtensionPoint(dc, jsonParent, ec, ep, ec.getFileByObjectKey(new ExtensionPointKey(ep)), true); |
6684 |
14 Jan 15 |
nicklas |
220 |
|
6684 |
14 Jan 15 |
nicklas |
221 |
List<Extension<?>> extensions = ec.getExtensions(ep.getId()); |
6684 |
14 Jan 15 |
nicklas |
222 |
Collections.sort(extensions, Registry.EXTENSION_COMPARATOR); |
7604 |
25 Feb 19 |
nicklas |
223 |
for (Extension<?> ext : extensions) |
6684 |
14 Jan 15 |
nicklas |
224 |
{ |
6684 |
14 Jan 15 |
nicklas |
225 |
newJoustExtension(dc, jsonEp, ec, ext, ec.getFileByObjectKey(new ExtensionKey(ext)), false, true); |
6684 |
14 Jan 15 |
nicklas |
226 |
} |
4168 |
04 Mar 08 |
nicklas |
227 |
} |
4168 |
04 Mar 08 |
nicklas |
228 |
|
6684 |
14 Jan 15 |
nicklas |
229 |
for (ExtensionsFile ef : ec.getFiles()) |
4168 |
04 Mar 08 |
nicklas |
230 |
{ |
6684 |
14 Jan 15 |
nicklas |
231 |
if (!ef.isInstalled()) continue; |
6684 |
14 Jan 15 |
nicklas |
232 |
|
6684 |
14 Jan 15 |
nicklas |
233 |
JSONObject jsonFile = newJoustFile(dc, jsonByFile, ef, ec); |
4198 |
28 Mar 08 |
nicklas |
234 |
|
7604 |
25 Feb 19 |
nicklas |
235 |
@SuppressWarnings("rawtypes") |
6684 |
14 Jan 15 |
nicklas |
236 |
List<ExtensionPoint> eps = ef.getObjectsOfClass(ExtensionPoint.class); |
7605 |
26 Feb 19 |
nicklas |
237 |
sort(eps, Registry.EXTENSIONPOINT_COMPARATOR); |
7604 |
25 Feb 19 |
nicklas |
238 |
for (ExtensionPoint<?> ep : eps) |
4198 |
28 Mar 08 |
nicklas |
239 |
{ |
8000 |
10 Aug 21 |
nicklas |
240 |
newJoustExtensionPoint(dc, jsonFile, ec, ep, ef, false); |
6684 |
14 Jan 15 |
nicklas |
241 |
} |
6684 |
14 Jan 15 |
nicklas |
242 |
|
7604 |
25 Feb 19 |
nicklas |
243 |
@SuppressWarnings("rawtypes") |
6684 |
14 Jan 15 |
nicklas |
244 |
List<Extension> exts = ef.getObjectsOfClass(Extension.class); |
7605 |
26 Feb 19 |
nicklas |
245 |
sort(exts, Registry.EXTENSION_COMPARATOR); |
6684 |
14 Jan 15 |
nicklas |
246 |
String currentGroupId = null; |
6684 |
14 Jan 15 |
nicklas |
247 |
JSONObject jsonGroup = null; |
6684 |
14 Jan 15 |
nicklas |
248 |
|
7604 |
25 Feb 19 |
nicklas |
249 |
for (Extension<?> ext : exts) |
6684 |
14 Jan 15 |
nicklas |
250 |
{ |
6684 |
14 Jan 15 |
nicklas |
251 |
int groupIndex = ext.getId().indexOf(":"); |
6684 |
14 Jan 15 |
nicklas |
252 |
// ID:s containing ':' should be grouped |
6684 |
14 Jan 15 |
nicklas |
253 |
if (groupIndex > 0) |
4198 |
28 Mar 08 |
nicklas |
254 |
{ |
6684 |
14 Jan 15 |
nicklas |
255 |
String groupId = ext.getId().substring(0, groupIndex); |
6684 |
14 Jan 15 |
nicklas |
256 |
if (!groupId.equals(currentGroupId)) |
6684 |
14 Jan 15 |
nicklas |
257 |
{ |
6684 |
14 Jan 15 |
nicklas |
258 |
currentGroupId = groupId; |
6684 |
14 Jan 15 |
nicklas |
259 |
jsonGroup = newJoustExtensionGroup(dc, jsonFile, ec, ext, currentGroupId); |
6684 |
14 Jan 15 |
nicklas |
260 |
} |
4198 |
28 Mar 08 |
nicklas |
261 |
} |
6684 |
14 Jan 15 |
nicklas |
262 |
else |
6684 |
14 Jan 15 |
nicklas |
263 |
{ |
6684 |
14 Jan 15 |
nicklas |
264 |
currentGroupId = null; |
6684 |
14 Jan 15 |
nicklas |
265 |
jsonGroup = null; |
6684 |
14 Jan 15 |
nicklas |
266 |
} |
6684 |
14 Jan 15 |
nicklas |
267 |
newJoustExtension(dc, jsonGroup != null ? jsonGroup : jsonFile, ec, ext, ef, jsonGroup != null, false); |
4198 |
28 Mar 08 |
nicklas |
268 |
} |
6684 |
14 Jan 15 |
nicklas |
269 |
List<PluginInfo> plugins = ef.getObjectsOfClass(PluginInfo.class); |
7605 |
26 Feb 19 |
nicklas |
270 |
sort(plugins, PluginInfo.NAME_COMPARATOR); |
6684 |
14 Jan 15 |
nicklas |
271 |
for (PluginInfo info : plugins) |
4198 |
28 Mar 08 |
nicklas |
272 |
{ |
6684 |
14 Jan 15 |
nicklas |
273 |
newJoustPlugin(dc, jsonFile, ec, info, ef); |
4198 |
28 Mar 08 |
nicklas |
274 |
} |
4198 |
28 Mar 08 |
nicklas |
275 |
} |
6380 |
16 Dec 13 |
nicklas |
276 |
%> |
6380 |
16 Dec 13 |
nicklas |
277 |
<base:page title="" type="iframe"> |
6386 |
18 Dec 13 |
nicklas |
278 |
<base:head scripts="joust-2.js,dragdrop.js,~tree.js" styles="joust-2.css"> |
5616 |
27 Apr 11 |
nicklas |
279 |
<style> |
5918 |
21 Dec 11 |
nicklas |
280 |
.itemref |
5918 |
21 Dec 11 |
nicklas |
281 |
{ |
5918 |
21 Dec 11 |
nicklas |
282 |
font-size: 0.85em; |
5918 |
21 Dec 11 |
nicklas |
283 |
color: #666666; |
5616 |
27 Apr 11 |
nicklas |
284 |
} |
5918 |
21 Dec 11 |
nicklas |
285 |
.selected .itemref |
5918 |
21 Dec 11 |
nicklas |
286 |
{ |
5918 |
21 Dec 11 |
nicklas |
287 |
color: #E8E8E8; |
5918 |
21 Dec 11 |
nicklas |
288 |
} |
5616 |
27 Apr 11 |
nicklas |
289 |
</style> |
4168 |
04 Mar 08 |
nicklas |
290 |
</base:head> |
6380 |
16 Dec 13 |
nicklas |
291 |
<base:body> |
6380 |
16 Dec 13 |
nicklas |
292 |
<div id="main" class="absolutefull auto-init" data-auto-init="drag-support"> |
6380 |
16 Dec 13 |
nicklas |
293 |
<div id="joust" class="joust absolutefull" |
6380 |
16 Dec 13 |
nicklas |
294 |
data-joust-tree="<%=HTML.encodeTags(jsonJoust.toJSONString()) %>" |
6380 |
16 Dec 13 |
nicklas |
295 |
style="overflow: auto;"> |
4168 |
04 Mar 08 |
nicklas |
296 |
</div> |
4168 |
04 Mar 08 |
nicklas |
297 |
</div> |
4168 |
04 Mar 08 |
nicklas |
298 |
</base:body> |
4168 |
04 Mar 08 |
nicklas |
299 |
</base:page> |
4168 |
04 Mar 08 |
nicklas |
300 |
<% |
4168 |
04 Mar 08 |
nicklas |
301 |
} |
4168 |
04 Mar 08 |
nicklas |
302 |
finally |
4168 |
04 Mar 08 |
nicklas |
303 |
{ |
4181 |
18 Mar 08 |
nicklas |
304 |
if (dc != null) dc.close(); |
4168 |
04 Mar 08 |
nicklas |
305 |
} |
4168 |
04 Mar 08 |
nicklas |
306 |
%> |