1342 |
15 Sep 05 |
nicklas |
1 |
<%-- $Id$ |
1342 |
15 Sep 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Johan Enell, Nicklas Nordborg |
1342 |
15 Sep 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
1342 |
15 Sep 05 |
nicklas |
9 |
|
1342 |
15 Sep 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
1342 |
15 Sep 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
1342 |
15 Sep 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
1342 |
15 Sep 05 |
nicklas |
14 |
|
1342 |
15 Sep 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
1342 |
15 Sep 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1342 |
15 Sep 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1342 |
15 Sep 05 |
nicklas |
18 |
GNU General Public License for more details. |
1342 |
15 Sep 05 |
nicklas |
19 |
|
1342 |
15 Sep 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1342 |
15 Sep 05 |
nicklas |
22 |
------------------------------------------------------------------ |
1342 |
15 Sep 05 |
nicklas |
23 |
|
1993 |
15 Feb 06 |
nicklas |
24 |
|
1342 |
15 Sep 05 |
nicklas |
25 |
@author Nicklas |
1342 |
15 Sep 05 |
nicklas |
26 |
@version 2.0 |
1342 |
15 Sep 05 |
nicklas |
27 |
--%> |
5426 |
24 Sep 10 |
nicklas |
28 |
<%@ page pageEncoding="UTF-8" session="false" |
1342 |
15 Sep 05 |
nicklas |
29 |
import="net.sf.basedb.core.SessionControl" |
1342 |
15 Sep 05 |
nicklas |
30 |
import="net.sf.basedb.core.DbControl" |
1342 |
15 Sep 05 |
nicklas |
31 |
import="net.sf.basedb.core.Item" |
1993 |
15 Feb 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
2631 |
08 Sep 06 |
nicklas |
33 |
import="net.sf.basedb.core.Include" |
1342 |
15 Sep 05 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
1342 |
15 Sep 05 |
nicklas |
35 |
import="net.sf.basedb.core.PluginDefinition" |
1993 |
15 Feb 06 |
nicklas |
36 |
import="net.sf.basedb.core.ItemQuery" |
1993 |
15 Feb 06 |
nicklas |
37 |
import="net.sf.basedb.core.ItemResultList" |
2631 |
08 Sep 06 |
nicklas |
38 |
import="net.sf.basedb.core.JobAgent" |
2631 |
08 Sep 06 |
nicklas |
39 |
import="net.sf.basedb.core.JobAgentSettings" |
2671 |
27 Sep 06 |
martin |
40 |
import="net.sf.basedb.core.BaseException" |
1993 |
15 Feb 06 |
nicklas |
41 |
import="net.sf.basedb.core.PermissionDeniedException" |
2671 |
27 Sep 06 |
martin |
42 |
import="net.sf.basedb.core.RoleKey" |
2671 |
27 Sep 06 |
martin |
43 |
import="net.sf.basedb.core.SystemItems" |
2802 |
25 Oct 06 |
nicklas |
44 |
import="net.sf.basedb.core.plugin.Plugin" |
2802 |
25 Oct 06 |
nicklas |
45 |
import="net.sf.basedb.core.plugin.Permissions" |
2631 |
08 Sep 06 |
nicklas |
46 |
import="net.sf.basedb.core.query.Restrictions" |
1993 |
15 Feb 06 |
nicklas |
47 |
import="net.sf.basedb.core.query.Orders" |
1993 |
15 Feb 06 |
nicklas |
48 |
import="net.sf.basedb.core.query.Hql" |
1342 |
15 Sep 05 |
nicklas |
49 |
import="net.sf.basedb.clients.web.Base" |
1342 |
15 Sep 05 |
nicklas |
50 |
import="net.sf.basedb.clients.web.util.HTML" |
2671 |
27 Sep 06 |
martin |
51 |
import="net.sf.basedb.clients.web.PermissionUtil" |
2753 |
20 Oct 06 |
nicklas |
52 |
import="net.sf.basedb.util.Values" |
5508 |
19 Nov 10 |
nicklas |
53 |
import="net.sf.basedb.core.plugin.GuiContext" |
5508 |
19 Nov 10 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5508 |
19 Nov 10 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5508 |
19 Nov 10 |
nicklas |
56 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
5508 |
19 Nov 10 |
nicklas |
58 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
6305 |
09 Aug 13 |
nicklas |
59 |
import="net.sf.basedb.util.json.NameableConverter" |
6305 |
09 Aug 13 |
nicklas |
60 |
import="org.json.simple.JSONArray" |
6305 |
09 Aug 13 |
nicklas |
61 |
import="org.json.simple.JSONObject" |
2671 |
27 Sep 06 |
martin |
62 |
import="java.util.EnumSet" |
2671 |
27 Sep 06 |
martin |
63 |
import="java.util.Set" |
2671 |
27 Sep 06 |
martin |
64 |
import="java.util.Map" |
2671 |
27 Sep 06 |
martin |
65 |
import="java.util.List" |
2802 |
25 Oct 06 |
nicklas |
66 |
import="java.util.Collection" |
1342 |
15 Sep 05 |
nicklas |
67 |
%> |
1342 |
15 Sep 05 |
nicklas |
68 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1342 |
15 Sep 05 |
nicklas |
69 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6147 |
21 Sep 12 |
nicklas |
70 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
2671 |
27 Sep 06 |
martin |
71 |
<%! |
2671 |
27 Sep 06 |
martin |
72 |
private static final int DENY_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.DENIED)); |
2671 |
27 Sep 06 |
martin |
73 |
private static final int CREATE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.CREATE)); |
2671 |
27 Sep 06 |
martin |
74 |
private static final int READ_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.READ)); |
2671 |
27 Sep 06 |
martin |
75 |
private static final int USE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.USE)); |
7220 |
04 Nov 16 |
nicklas |
76 |
private static final int RESTRICTED_WRITE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.RESTRICTED_WRITE)); |
2671 |
27 Sep 06 |
martin |
77 |
private static final int WRITE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.WRITE)); |
2671 |
27 Sep 06 |
martin |
78 |
private static final int DELETE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.DELETE)); |
2671 |
27 Sep 06 |
martin |
79 |
private static final int SET_OWNER_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.SET_OWNER)); |
2671 |
27 Sep 06 |
martin |
80 |
private static final int SET_PERMISSION_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.SET_PERMISSION)); |
2671 |
27 Sep 06 |
martin |
81 |
|
2671 |
27 Sep 06 |
martin |
82 |
private String getOption(DbControl dc, PluginDefinition plugin, Item itemType) |
2671 |
27 Sep 06 |
martin |
83 |
throws BaseException |
2671 |
27 Sep 06 |
martin |
84 |
{ |
2671 |
27 Sep 06 |
martin |
85 |
int keyId = SystemItems.getRoleKeyId(itemType); |
2671 |
27 Sep 06 |
martin |
86 |
if (keyId == 0) return ""; |
2671 |
27 Sep 06 |
martin |
87 |
|
2671 |
27 Sep 06 |
martin |
88 |
RoleKey key = RoleKey.getById(dc, keyId); |
2671 |
27 Sep 06 |
martin |
89 |
StringBuilder sb = new StringBuilder(); |
2671 |
27 Sep 06 |
martin |
90 |
sb.append("<option value=\"").append(key.getItemType().name()).append("\">"); |
2671 |
27 Sep 06 |
martin |
91 |
sb.append(HTML.encodeTags(key.getName())); |
2722 |
11 Oct 06 |
nicklas |
92 |
sb.append(" []"); |
2671 |
27 Sep 06 |
martin |
93 |
return sb.toString(); |
2671 |
27 Sep 06 |
martin |
94 |
} |
2802 |
25 Oct 06 |
nicklas |
95 |
private void appendPermissionLetter(StringBuilder sb, Permission p, String letter, |
2802 |
25 Oct 06 |
nicklas |
96 |
Set<Permission> defined, Set<Permission> always, Set<Permission> maybe) |
2802 |
25 Oct 06 |
nicklas |
97 |
{ |
3588 |
23 Jul 07 |
nicklas |
98 |
if (defined != null && defined.contains(p)) |
2802 |
25 Oct 06 |
nicklas |
99 |
{ |
2802 |
25 Oct 06 |
nicklas |
100 |
if (always != null && always.contains(p)) |
2802 |
25 Oct 06 |
nicklas |
101 |
{ |
2802 |
25 Oct 06 |
nicklas |
102 |
sb.append(letter.toUpperCase()); |
2802 |
25 Oct 06 |
nicklas |
103 |
} |
2802 |
25 Oct 06 |
nicklas |
104 |
else if (maybe != null && maybe.contains(p)) |
2802 |
25 Oct 06 |
nicklas |
105 |
{ |
2802 |
25 Oct 06 |
nicklas |
106 |
sb.append(letter.toLowerCase()); |
2802 |
25 Oct 06 |
nicklas |
107 |
} |
2802 |
25 Oct 06 |
nicklas |
108 |
else |
2802 |
25 Oct 06 |
nicklas |
109 |
{ |
2802 |
25 Oct 06 |
nicklas |
110 |
sb.append("-"); |
2802 |
25 Oct 06 |
nicklas |
111 |
} |
2802 |
25 Oct 06 |
nicklas |
112 |
} |
2802 |
25 Oct 06 |
nicklas |
113 |
} |
2671 |
27 Sep 06 |
martin |
114 |
%> |
1342 |
15 Sep 05 |
nicklas |
115 |
<% |
1993 |
15 Feb 06 |
nicklas |
116 |
final Item itemType = Item.PLUGINDEFINITION; |
1342 |
15 Sep 05 |
nicklas |
117 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1993 |
15 Feb 06 |
nicklas |
118 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1993 |
15 Feb 06 |
nicklas |
119 |
final int itemId = cc.getId(); |
1342 |
15 Sep 05 |
nicklas |
120 |
final String ID = sc.getId(); |
1342 |
15 Sep 05 |
nicklas |
121 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
122 |
final DbControl dc = sc.newDbControl(":Edit "+itemType); |
1342 |
15 Sep 05 |
nicklas |
123 |
try |
1342 |
15 Sep 05 |
nicklas |
124 |
{ |
1342 |
15 Sep 05 |
nicklas |
125 |
String title = null; |
1993 |
15 Feb 06 |
nicklas |
126 |
PluginDefinition plugin = null; |
2629 |
08 Sep 06 |
nicklas |
127 |
boolean isTrusted = true; |
2854 |
02 Nov 06 |
nicklas |
128 |
Boolean allowImmediateExecution = null; |
2722 |
11 Oct 06 |
nicklas |
129 |
boolean usePermissions = false; |
2802 |
25 Oct 06 |
nicklas |
130 |
Collection<Permissions> requestedPermissions = null; |
3501 |
15 Jun 07 |
enell |
131 |
String warning = null; |
2631 |
08 Sep 06 |
nicklas |
132 |
|
2631 |
08 Sep 06 |
nicklas |
133 |
final int selectedAgentId = Values.getInt(request.getParameter("jobagent_id"), -1); |
1993 |
15 Feb 06 |
nicklas |
134 |
|
2631 |
08 Sep 06 |
nicklas |
135 |
// Query to retrieve job agents |
2631 |
08 Sep 06 |
nicklas |
136 |
ItemQuery<JobAgent> agentQuery = null; |
2671 |
27 Sep 06 |
martin |
137 |
|
2671 |
27 Sep 06 |
martin |
138 |
// Query to retrieve role keys |
2671 |
27 Sep 06 |
martin |
139 |
final ItemQuery<RoleKey> roleKeyQuery = RoleKey.getQuery(); |
2671 |
27 Sep 06 |
martin |
140 |
roleKeyQuery.order(Orders.asc(Hql.property("name"))); |
2631 |
08 Sep 06 |
nicklas |
141 |
|
1993 |
15 Feb 06 |
nicklas |
142 |
if (itemId == 0) |
1993 |
15 Feb 06 |
nicklas |
143 |
{ |
1993 |
15 Feb 06 |
nicklas |
144 |
title = "Create plugin"; |
1993 |
15 Feb 06 |
nicklas |
145 |
cc.removeObject("item"); |
2629 |
08 Sep 06 |
nicklas |
146 |
String tt = cc.getPropertyValue("trusted"); |
2854 |
02 Nov 06 |
nicklas |
147 |
String up = cc.getPropertyValue("usePermissions"); |
2854 |
02 Nov 06 |
nicklas |
148 |
String aie = cc.getPropertyValue("allowImmediateExection"); |
2629 |
08 Sep 06 |
nicklas |
149 |
isTrusted = tt == null ? isTrusted : Values.getBoolean(tt); |
2671 |
27 Sep 06 |
martin |
150 |
usePermissions = up == null ? usePermissions : Values.getBoolean(up); |
2854 |
02 Nov 06 |
nicklas |
151 |
allowImmediateExecution = aie == null ? null : Values.getBoolean(aie); |
1993 |
15 Feb 06 |
nicklas |
152 |
} |
1993 |
15 Feb 06 |
nicklas |
153 |
else |
1993 |
15 Feb 06 |
nicklas |
154 |
{ |
1993 |
15 Feb 06 |
nicklas |
155 |
plugin = PluginDefinition.getById(dc, itemId); |
6305 |
09 Aug 13 |
nicklas |
156 |
plugin.checkPermission(Permission.WRITE); |
1993 |
15 Feb 06 |
nicklas |
157 |
cc.setObject("item", plugin); |
1993 |
15 Feb 06 |
nicklas |
158 |
title = "Edit plugin -- " + HTML.encodeTags(plugin.getName()); |
2629 |
08 Sep 06 |
nicklas |
159 |
isTrusted = plugin.isTrusted(); |
2671 |
27 Sep 06 |
martin |
160 |
usePermissions = plugin.getUsePermissions(); |
2854 |
02 Nov 06 |
nicklas |
161 |
allowImmediateExecution = plugin.getAllowImmediateExecution(); |
2631 |
08 Sep 06 |
nicklas |
162 |
|
2631 |
08 Sep 06 |
nicklas |
163 |
agentQuery = JobAgent.getQuery(); |
3890 |
30 Oct 07 |
nicklas |
164 |
agentQuery.include(Include.ALL); |
2631 |
08 Sep 06 |
nicklas |
165 |
agentQuery.order(Orders.asc(Hql.property("name"))); |
2631 |
08 Sep 06 |
nicklas |
166 |
agentQuery.join(Hql.innerJoin("plugins", "p")); |
2631 |
08 Sep 06 |
nicklas |
167 |
agentQuery.restrict(Restrictions.eq(Hql.property("p", "pluginDefinition"), Hql.entity(plugin))); |
2802 |
25 Oct 06 |
nicklas |
168 |
|
3501 |
15 Jun 07 |
enell |
169 |
try |
3501 |
15 Jun 07 |
enell |
170 |
{ |
5595 |
17 Mar 11 |
nicklas |
171 |
Plugin thePlugin = plugin.newInstance(Plugin.class, sc, null, null); |
3501 |
15 Jun 07 |
enell |
172 |
requestedPermissions = thePlugin.getPermissions(); |
3501 |
15 Jun 07 |
enell |
173 |
} |
3501 |
15 Jun 07 |
enell |
174 |
catch (BaseException ex) |
3501 |
15 Jun 07 |
enell |
175 |
{ |
3501 |
15 Jun 07 |
enell |
176 |
warning = ex.getMessage(); |
3501 |
15 Jun 07 |
enell |
177 |
} |
1993 |
15 Feb 06 |
nicklas |
178 |
} |
1993 |
15 Feb 06 |
nicklas |
179 |
|
6305 |
09 Aug 13 |
nicklas |
180 |
// Load job agent settings as JSON objects |
6305 |
09 Aug 13 |
nicklas |
181 |
JSONArray jsonSettings = new JSONArray(); |
6305 |
09 Aug 13 |
nicklas |
182 |
JSONObject jsonAgents = new JSONObject(); |
6305 |
09 Aug 13 |
nicklas |
183 |
jsonAgents.put("itemType", "JOBAGENT"); |
6305 |
09 Aug 13 |
nicklas |
184 |
if (agentQuery != null) |
6305 |
09 Aug 13 |
nicklas |
185 |
{ |
6305 |
09 Aug 13 |
nicklas |
186 |
JSONArray jsonLinked = new JSONArray(); |
7604 |
25 Feb 19 |
nicklas |
187 |
NameableConverter<JobAgent> converter = new NameableConverter<>(); |
6305 |
09 Aug 13 |
nicklas |
188 |
for (JobAgent agent : agentQuery.list(dc)) |
1353 |
20 Sep 05 |
nicklas |
189 |
{ |
6305 |
09 Aug 13 |
nicklas |
190 |
JobAgentSettings settings = agent.getSettings(plugin, false); |
6305 |
09 Aug 13 |
nicklas |
191 |
Boolean trusted = null; |
6305 |
09 Aug 13 |
nicklas |
192 |
Long maxMemory = null; |
6305 |
09 Aug 13 |
nicklas |
193 |
int priorityBoost = 0; |
6305 |
09 Aug 13 |
nicklas |
194 |
if (settings != null) |
1353 |
20 Sep 05 |
nicklas |
195 |
{ |
6305 |
09 Aug 13 |
nicklas |
196 |
trusted = settings.isTrusted(); |
6305 |
09 Aug 13 |
nicklas |
197 |
maxMemory = settings.getMaxMemory(); |
6305 |
09 Aug 13 |
nicklas |
198 |
priorityBoost = settings.getPriorityBoost(); |
6305 |
09 Aug 13 |
nicklas |
199 |
jsonLinked.add(converter.convert(agent)); |
2631 |
08 Sep 06 |
nicklas |
200 |
|
1353 |
20 Sep 05 |
nicklas |
201 |
} |
6305 |
09 Aug 13 |
nicklas |
202 |
JSONObject jsonSetting = new JSONObject(); |
6305 |
09 Aug 13 |
nicklas |
203 |
jsonSetting.put("agentId", agent.getId()); |
6305 |
09 Aug 13 |
nicklas |
204 |
if (trusted != null) |
2631 |
08 Sep 06 |
nicklas |
205 |
{ |
6305 |
09 Aug 13 |
nicklas |
206 |
jsonSetting.put("trusted", trusted ? 1 : 0); |
2631 |
08 Sep 06 |
nicklas |
207 |
} |
6305 |
09 Aug 13 |
nicklas |
208 |
else |
3871 |
22 Oct 07 |
nicklas |
209 |
{ |
6305 |
09 Aug 13 |
nicklas |
210 |
jsonSetting.put("trusted", ""); |
3871 |
22 Oct 07 |
nicklas |
211 |
} |
6305 |
09 Aug 13 |
nicklas |
212 |
if (maxMemory != null) |
1993 |
15 Feb 06 |
nicklas |
213 |
{ |
6305 |
09 Aug 13 |
nicklas |
214 |
jsonSetting.put("maxMemory", Values.formatBytes(maxMemory)); |
1993 |
15 Feb 06 |
nicklas |
215 |
} |
6305 |
09 Aug 13 |
nicklas |
216 |
jsonSetting.put("priorityBoost", priorityBoost); |
6305 |
09 Aug 13 |
nicklas |
217 |
jsonSettings.add(jsonSetting); |
6305 |
09 Aug 13 |
nicklas |
218 |
} |
6305 |
09 Aug 13 |
nicklas |
219 |
jsonAgents.put("items", jsonLinked); |
6305 |
09 Aug 13 |
nicklas |
220 |
} |
2631 |
08 Sep 06 |
nicklas |
221 |
|
6305 |
09 Aug 13 |
nicklas |
222 |
// Convert permissions requested by the plugin to a JSON object |
6305 |
09 Aug 13 |
nicklas |
223 |
JSONArray jsonRequestedPermissions = new JSONArray(); |
6305 |
09 Aug 13 |
nicklas |
224 |
if (requestedPermissions != null) |
6305 |
09 Aug 13 |
nicklas |
225 |
{ |
6305 |
09 Aug 13 |
nicklas |
226 |
for (Permissions pp : requestedPermissions) |
2631 |
08 Sep 06 |
nicklas |
227 |
{ |
6305 |
09 Aug 13 |
nicklas |
228 |
Item ppType = pp.getItemType(); |
6305 |
09 Aug 13 |
nicklas |
229 |
if (ppType.getDefinedPermissions() != null) |
2631 |
08 Sep 06 |
nicklas |
230 |
{ |
6305 |
09 Aug 13 |
nicklas |
231 |
Set<Permission> always = Permission.expand(pp.getAlwaysGranted()); |
6305 |
09 Aug 13 |
nicklas |
232 |
Set<Permission> maybe = Permission.expand(pp.getMaybeGranted()); |
6305 |
09 Aug 13 |
nicklas |
233 |
JSONObject jsonRequested = new JSONObject(); |
6305 |
09 Aug 13 |
nicklas |
234 |
jsonRequested.put("itemType", ppType.name()); |
6305 |
09 Aug 13 |
nicklas |
235 |
jsonRequested.put("granted", always == null ? 0 : PermissionUtil.getPermissionCode(always)); |
6305 |
09 Aug 13 |
nicklas |
236 |
jsonRequested.put("denied", maybe == null ? 255 : 255 & ~PermissionUtil.getPermissionCode(maybe)); |
6305 |
09 Aug 13 |
nicklas |
237 |
jsonRequestedPermissions.add(jsonRequested); |
2631 |
08 Sep 06 |
nicklas |
238 |
} |
2631 |
08 Sep 06 |
nicklas |
239 |
} |
6305 |
09 Aug 13 |
nicklas |
240 |
} |
6305 |
09 Aug 13 |
nicklas |
241 |
|
6305 |
09 Aug 13 |
nicklas |
242 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), plugin); |
7604 |
25 Feb 19 |
nicklas |
243 |
ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext); |
6305 |
09 Aug 13 |
nicklas |
244 |
%> |
6305 |
09 Aug 13 |
nicklas |
245 |
<base:page type="popup" title="<%=title%>" id="edit-page"> |
6305 |
09 Aug 13 |
nicklas |
246 |
<base:head scripts="tabcontrol-2.js,linkitems-2.js,~plugins.js" styles="tabcontrol.css"> |
6305 |
09 Aug 13 |
nicklas |
247 |
<ext:scripts context="<%=jspContext%>" /> |
6305 |
09 Aug 13 |
nicklas |
248 |
<ext:stylesheets context="<%=jspContext%>" /> |
1342 |
15 Sep 05 |
nicklas |
249 |
</base:head> |
6305 |
09 Aug 13 |
nicklas |
250 |
<base:body> |
5922 |
11 Jan 12 |
nicklas |
251 |
<h1><%=title%> <base:help tabcontrol="settings" /></h1> |
6162 |
10 Oct 12 |
nicklas |
252 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="plugin"> |
1993 |
15 Feb 06 |
nicklas |
253 |
<input type="hidden" name="cmd" value="UpdateItem"> |
1993 |
15 Feb 06 |
nicklas |
254 |
|
6305 |
09 Aug 13 |
nicklas |
255 |
<div id="page-data" class="datacontainer" |
6305 |
09 Aug 13 |
nicklas |
256 |
data-agent-settings="<%=HTML.encodeTags(jsonSettings.toJSONString()) %>" |
6305 |
09 Aug 13 |
nicklas |
257 |
data-select-agent="<%=selectedAgentId%>" |
6305 |
09 Aug 13 |
nicklas |
258 |
data-create="<%=CREATE_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
259 |
data-read="<%=READ_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
260 |
data-use="<%=USE_CODE%>" |
7220 |
04 Nov 16 |
nicklas |
261 |
data-restricted-write="<%=RESTRICTED_WRITE_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
262 |
data-write="<%=WRITE_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
263 |
data-delete="<%=DELETE_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
264 |
data-set-owner="<%=SET_OWNER_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
265 |
data-set-permission="<%=SET_PERMISSION_CODE%>" |
6305 |
09 Aug 13 |
nicklas |
266 |
data-requested-permissions="<%=HTML.encodeTags(jsonRequestedPermissions.toJSONString())%>" |
6305 |
09 Aug 13 |
nicklas |
267 |
></div> |
6305 |
09 Aug 13 |
nicklas |
268 |
|
5922 |
11 Jan 12 |
nicklas |
269 |
<t:tabcontrol id="settings" |
5922 |
11 Jan 12 |
nicklas |
270 |
subclass="content dialogtabcontrol" |
3979 |
19 Nov 07 |
nicklas |
271 |
position="bottom" remember="<%=plugin != null%>" |
6254 |
22 Mar 13 |
nicklas |
272 |
active="<%=selectedAgentId == -1 ? null : "agents" %>" |
5508 |
19 Nov 10 |
nicklas |
273 |
extensions="<%=invoker%>"> |
6305 |
09 Aug 13 |
nicklas |
274 |
<t:tab id="info" title="Plugin" helpid="plugindefinition.edit"> |
5922 |
11 Jan 12 |
nicklas |
275 |
<table class="fullform input100"> |
1342 |
15 Sep 05 |
nicklas |
276 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
277 |
<th>Name</th> |
1993 |
15 Feb 06 |
nicklas |
278 |
<td><%=HTML.encodeTags(plugin == null ? Values.getString(cc.getPropertyValue("name"), "New plugin") : plugin.getName())%></td> |
5922 |
11 Jan 12 |
nicklas |
279 |
<td></td> |
1993 |
15 Feb 06 |
nicklas |
280 |
</tr> |
1993 |
15 Feb 06 |
nicklas |
281 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
282 |
<th>Class</th> |
6305 |
09 Aug 13 |
nicklas |
283 |
<td><input class="text required auto-init" |
6305 |
09 Aug 13 |
nicklas |
284 |
data-auto-init="<%=plugin == null ? "focus-select" : "focus" %>" |
6305 |
09 Aug 13 |
nicklas |
285 |
type="text" name="className" |
1993 |
15 Feb 06 |
nicklas |
286 |
value="<%=HTML.encodeTags(plugin == null ? cc.getPropertyValue("className") : plugin.getClassName())%>" |
5922 |
11 Jan 12 |
nicklas |
287 |
maxlength="<%=PluginDefinition.MAX_CLASSNAME_LENGTH%>"></td> |
5922 |
11 Jan 12 |
nicklas |
288 |
<td></td> |
1353 |
20 Sep 05 |
nicklas |
289 |
</tr> |
1353 |
20 Sep 05 |
nicklas |
290 |
|
1353 |
20 Sep 05 |
nicklas |
291 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
292 |
<th>JAR file</th> |
6217 |
14 Dec 12 |
nicklas |
293 |
<td><input class="text" type="text" name="jarFile" |
5595 |
17 Mar 11 |
nicklas |
294 |
value="<%=HTML.encodeTags(plugin == null ? cc.getPropertyValue("jarFile") : plugin.getJarFile())%>" |
5922 |
11 Jan 12 |
nicklas |
295 |
maxlength="<%=PluginDefinition.MAX_JARFILE_LENGTH%>"> |
3501 |
15 Jun 07 |
enell |
296 |
</td> |
5922 |
11 Jan 12 |
nicklas |
297 |
<td></td> |
1353 |
20 Sep 05 |
nicklas |
298 |
</tr> |
2629 |
08 Sep 06 |
nicklas |
299 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
300 |
<th>Max memory</th> |
6217 |
14 Dec 12 |
nicklas |
301 |
<td><input class="text" type="text" name="maxMemory" style="width: 15em;" |
2629 |
08 Sep 06 |
nicklas |
302 |
value="<%=Values.formatBytes(plugin == null ? Values.parseBytes(cc.getPropertyValue("maxMemory"), null) : plugin.getMaxMemory())%>" |
5922 |
11 Jan 12 |
nicklas |
303 |
maxlength="16"> (Use KB, MB or GB to specify units)</td> |
5922 |
11 Jan 12 |
nicklas |
304 |
<td></td> |
2629 |
08 Sep 06 |
nicklas |
305 |
</tr> |
2629 |
08 Sep 06 |
nicklas |
306 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
307 |
<th>Trusted</th> |
2629 |
08 Sep 06 |
nicklas |
308 |
<td> |
5812 |
17 Oct 11 |
nicklas |
309 |
<input type="radio" name="trusted" id="trustedNo" value="0" |
5812 |
17 Oct 11 |
nicklas |
310 |
<%=!isTrusted ? "checked" : ""%>><label for="trustedNo">no</label> |
5812 |
17 Oct 11 |
nicklas |
311 |
<input type="radio" name="trusted" id="trustedYes" value="1" |
5812 |
17 Oct 11 |
nicklas |
312 |
<%=isTrusted ? "checked" : ""%>><label for="trustedYes">yes</label> |
2629 |
08 Sep 06 |
nicklas |
313 |
</td> |
5922 |
11 Jan 12 |
nicklas |
314 |
<td></td> |
2671 |
27 Sep 06 |
martin |
315 |
</tr> |
2854 |
02 Nov 06 |
nicklas |
316 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
317 |
<th>Allow immediate<br>exection</th> |
2854 |
02 Nov 06 |
nicklas |
318 |
<td> |
5812 |
17 Oct 11 |
nicklas |
319 |
<input type="radio" name="allow_immediate_execution" id="immediateNo" value="0" |
5812 |
17 Oct 11 |
nicklas |
320 |
<%=Boolean.FALSE.equals(allowImmediateExecution) ? "checked" : ""%>><label for="immediateNo">no</label> |
5812 |
17 Oct 11 |
nicklas |
321 |
<input type="radio" name="allow_immediate_execution" id="immediateYes" value="1" |
5812 |
17 Oct 11 |
nicklas |
322 |
<%=Boolean.TRUE.equals(allowImmediateExecution) ? "checked" : ""%>><label for="immediateYes">yes</label> |
2854 |
02 Nov 06 |
nicklas |
323 |
<% |
2854 |
02 Nov 06 |
nicklas |
324 |
if (allowImmediateExecution == null) |
2854 |
02 Nov 06 |
nicklas |
325 |
{ |
2854 |
02 Nov 06 |
nicklas |
326 |
%> |
5812 |
17 Oct 11 |
nicklas |
327 |
<input type="radio" name="allow_immediate_execution" id="immediateAuto" value="" |
5812 |
17 Oct 11 |
nicklas |
328 |
checked><label for="immediateAuto">auto</label> |
2854 |
02 Nov 06 |
nicklas |
329 |
<% |
2854 |
02 Nov 06 |
nicklas |
330 |
} |
2854 |
02 Nov 06 |
nicklas |
331 |
%> |
2854 |
02 Nov 06 |
nicklas |
332 |
</td> |
5922 |
11 Jan 12 |
nicklas |
333 |
<td></td> |
5922 |
11 Jan 12 |
nicklas |
334 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
335 |
<tr class="dynamic"> |
5922 |
11 Jan 12 |
nicklas |
336 |
<th></th> |
2722 |
11 Oct 06 |
nicklas |
337 |
<td> |
2802 |
25 Oct 06 |
nicklas |
338 |
<% |
5922 |
11 Jan 12 |
nicklas |
339 |
if (warning != null) |
2802 |
25 Oct 06 |
nicklas |
340 |
{ |
2802 |
25 Oct 06 |
nicklas |
341 |
%> |
5922 |
11 Jan 12 |
nicklas |
342 |
<div class="messagecontainer error"><%=warning%></div> |
2802 |
25 Oct 06 |
nicklas |
343 |
<% |
2802 |
25 Oct 06 |
nicklas |
344 |
} |
2802 |
25 Oct 06 |
nicklas |
345 |
%> |
2722 |
11 Oct 06 |
nicklas |
346 |
</td> |
5922 |
11 Jan 12 |
nicklas |
347 |
<td></td> |
2722 |
11 Oct 06 |
nicklas |
348 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
349 |
</table> |
5922 |
11 Jan 12 |
nicklas |
350 |
</t:tab> |
5922 |
11 Jan 12 |
nicklas |
351 |
|
5922 |
11 Jan 12 |
nicklas |
352 |
<t:tab id="permissions" title="Permissions" |
5922 |
11 Jan 12 |
nicklas |
353 |
tooltip="Set permissions for this plugindefintion" helpid="plugindefinition.edit.permissions"> |
5922 |
11 Jan 12 |
nicklas |
354 |
<table class="fullform input100"> |
5922 |
11 Jan 12 |
nicklas |
355 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
356 |
<th>Use permissions</th> |
5922 |
11 Jan 12 |
nicklas |
357 |
<td> |
5922 |
11 Jan 12 |
nicklas |
358 |
<input type="radio" name="use_permissions" id="permissionsYes" value="1" |
6305 |
09 Aug 13 |
nicklas |
359 |
<%=usePermissions ? "checked" : ""%>><label for="permissionsYes">yes</label> |
5922 |
11 Jan 12 |
nicklas |
360 |
<input type="radio" name="use_permissions" id="permissionsNo" value="0" |
6305 |
09 Aug 13 |
nicklas |
361 |
<%=!usePermissions ? "checked" : ""%>><label for="permissionsNo">no</label> |
5922 |
11 Jan 12 |
nicklas |
362 |
<% |
5922 |
11 Jan 12 |
nicklas |
363 |
if (plugin == null) |
5922 |
11 Jan 12 |
nicklas |
364 |
{ |
5922 |
11 Jan 12 |
nicklas |
365 |
%> |
5922 |
11 Jan 12 |
nicklas |
366 |
<input type="radio" name="use_permissions" id="permissionsAuto" value="2" |
6305 |
09 Aug 13 |
nicklas |
367 |
><label for="permissionsAuto">if requested by plugin</label> |
5922 |
11 Jan 12 |
nicklas |
368 |
<% |
5922 |
11 Jan 12 |
nicklas |
369 |
} |
3588 |
23 Jul 07 |
nicklas |
370 |
%> |
5922 |
11 Jan 12 |
nicklas |
371 |
</td> |
5922 |
11 Jan 12 |
nicklas |
372 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
373 |
<tr class="dynamic"> |
5922 |
11 Jan 12 |
nicklas |
374 |
<th>Item types</th> |
5922 |
11 Jan 12 |
nicklas |
375 |
<td> |
5922 |
11 Jan 12 |
nicklas |
376 |
<div class="selectionlist"> |
5922 |
11 Jan 12 |
nicklas |
377 |
<table> |
5922 |
11 Jan 12 |
nicklas |
378 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
379 |
<td> |
6305 |
09 Aug 13 |
nicklas |
380 |
<select name="itemTypes" size="20" id="itemTypes" multiple> |
5922 |
11 Jan 12 |
nicklas |
381 |
<% |
5922 |
11 Jan 12 |
nicklas |
382 |
Map<String, List<Item>> permissionGroups = PermissionUtil.getPermissionGroups(); |
5922 |
11 Jan 12 |
nicklas |
383 |
for (Map.Entry<String, List<Item>> entry : permissionGroups.entrySet()) |
5922 |
11 Jan 12 |
nicklas |
384 |
{ |
5922 |
11 Jan 12 |
nicklas |
385 |
String name = entry.getKey(); |
5922 |
11 Jan 12 |
nicklas |
386 |
List<Item> items = entry.getValue(); |
5922 |
11 Jan 12 |
nicklas |
387 |
%> |
5922 |
11 Jan 12 |
nicklas |
388 |
<option class="selectoptionheader" value="">-- <%=name%> |
5922 |
11 Jan 12 |
nicklas |
389 |
<% |
5922 |
11 Jan 12 |
nicklas |
390 |
for (Item item : items) |
5922 |
11 Jan 12 |
nicklas |
391 |
{ |
5922 |
11 Jan 12 |
nicklas |
392 |
%> |
5922 |
11 Jan 12 |
nicklas |
393 |
<%=getOption(dc, plugin, item)%> |
5922 |
11 Jan 12 |
nicklas |
394 |
<% |
5922 |
11 Jan 12 |
nicklas |
395 |
} |
5922 |
11 Jan 12 |
nicklas |
396 |
} |
5922 |
11 Jan 12 |
nicklas |
397 |
%> |
5922 |
11 Jan 12 |
nicklas |
398 |
</select> |
5922 |
11 Jan 12 |
nicklas |
399 |
<b>Capital letters</b> = Permission is always granted<br> |
5922 |
11 Jan 12 |
nicklas |
400 |
<b>Small letters</b> = Permission is only granted if logged in user |
5922 |
11 Jan 12 |
nicklas |
401 |
has that permission |
5922 |
11 Jan 12 |
nicklas |
402 |
</td> |
5922 |
11 Jan 12 |
nicklas |
403 |
<td style="vertical-align: top;"> |
5922 |
11 Jan 12 |
nicklas |
404 |
<table style="width: 20em;"> |
5922 |
11 Jan 12 |
nicklas |
405 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
406 |
<td> |
5922 |
11 Jan 12 |
nicklas |
407 |
<b>Always grant</b><br> |
6305 |
09 Aug 13 |
nicklas |
408 |
<input type="checkbox" name="grant_create" id="grant_create"><label for="grant_create">Create</label><br> |
6305 |
09 Aug 13 |
nicklas |
409 |
<input type="checkbox" name="grant_read" id="grant_read"><label for="grant_read">Read</label><br> |
6305 |
09 Aug 13 |
nicklas |
410 |
<input type="checkbox" name="grant_use" id="grant_use"><label for="grant_use">Use</label><br> |
7220 |
04 Nov 16 |
nicklas |
411 |
<input type="checkbox" name="grant_restricted_write" id="grant_restricted_write"><label for="grant_restricted_write">Annotate</label><br> |
6305 |
09 Aug 13 |
nicklas |
412 |
<input type="checkbox" name="grant_write" id="grant_write"><label for="grant_write">Write</label><br> |
6305 |
09 Aug 13 |
nicklas |
413 |
<input type="checkbox" name="grant_delete" id="grant_delete"><label for="grant_delete">Delete</label><br> |
6305 |
09 Aug 13 |
nicklas |
414 |
<input type="checkbox" name="grant_set_owner" id="grant_set_owner"><label for="grant_set_owner">Set owner</label><br> |
6305 |
09 Aug 13 |
nicklas |
415 |
<input type="checkbox" name="grant_set_permission" id="grant_set_permission"><label for="grant_set_permission">Set permission</label> |
5922 |
11 Jan 12 |
nicklas |
416 |
</td> |
5922 |
11 Jan 12 |
nicklas |
417 |
<td> |
5922 |
11 Jan 12 |
nicklas |
418 |
<b>Always deny</b><br> |
6305 |
09 Aug 13 |
nicklas |
419 |
<input type="checkbox" name="deny_create" id="deny_create"><label for="deny_create">Create</label><br> |
6305 |
09 Aug 13 |
nicklas |
420 |
<input type="checkbox" name="deny_read" id="deny_read"><label for="deny_read">Read</label><br> |
6305 |
09 Aug 13 |
nicklas |
421 |
<input type="checkbox" name="deny_use" id="deny_use"><label for="deny_use">Use</label><br> |
7220 |
04 Nov 16 |
nicklas |
422 |
<input type="checkbox" name="deny_restricted_write" id="deny_restricted_write"><label for="deny_restricted_write">Annotate</label><br> |
6305 |
09 Aug 13 |
nicklas |
423 |
<input type="checkbox" name="deny_write" id="deny_write"><label for="deny_write">Write</label><br> |
6305 |
09 Aug 13 |
nicklas |
424 |
<input type="checkbox" name="deny_delete" id="deny_delete"><label for="deny_delete">Delete</label><br> |
6305 |
09 Aug 13 |
nicklas |
425 |
<input type="checkbox" name="deny_set_owner" id="deny_set_owner"><label for="deny_set_owner">Set owner</label><br> |
6305 |
09 Aug 13 |
nicklas |
426 |
<input type="checkbox" name="deny_set_permission" id="deny_set_permission"><label for="deny_set_permission">Set permission</label> |
5922 |
11 Jan 12 |
nicklas |
427 |
</td> |
5922 |
11 Jan 12 |
nicklas |
428 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
429 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
430 |
<td colspan="2"> |
5922 |
11 Jan 12 |
nicklas |
431 |
<div class="messagecontainer help" style="margin: 0.5em 0px 0px 0px; height: 12em; overflow: auto;"> |
5922 |
11 Jan 12 |
nicklas |
432 |
<b>Requested by plugin</b><br> |
5922 |
11 Jan 12 |
nicklas |
433 |
<% |
5922 |
11 Jan 12 |
nicklas |
434 |
if (requestedPermissions != null && requestedPermissions.size() > 0) |
5922 |
11 Jan 12 |
nicklas |
435 |
{ |
5922 |
11 Jan 12 |
nicklas |
436 |
%> |
5922 |
11 Jan 12 |
nicklas |
437 |
<table> |
5922 |
11 Jan 12 |
nicklas |
438 |
<% |
5922 |
11 Jan 12 |
nicklas |
439 |
for (Permissions pp : requestedPermissions) |
5922 |
11 Jan 12 |
nicklas |
440 |
{ |
5922 |
11 Jan 12 |
nicklas |
441 |
Item ppType = pp.getItemType(); |
5922 |
11 Jan 12 |
nicklas |
442 |
Set<Permission> always = Permission.expand(pp.getAlwaysGranted()); |
5922 |
11 Jan 12 |
nicklas |
443 |
Set<Permission> maybe = Permission.expand(pp.getMaybeGranted()); |
5922 |
11 Jan 12 |
nicklas |
444 |
Set<Permission> defined = ppType.getDefinedPermissions(); |
5922 |
11 Jan 12 |
nicklas |
445 |
if (defined != null) |
5922 |
11 Jan 12 |
nicklas |
446 |
{ |
5922 |
11 Jan 12 |
nicklas |
447 |
StringBuilder sb = new StringBuilder(); |
5922 |
11 Jan 12 |
nicklas |
448 |
sb.append("["); |
5922 |
11 Jan 12 |
nicklas |
449 |
appendPermissionLetter(sb, Permission.CREATE, "C", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
450 |
appendPermissionLetter(sb, Permission.READ, "R", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
451 |
appendPermissionLetter(sb, Permission.USE, "U", defined, always, maybe); |
7220 |
04 Nov 16 |
nicklas |
452 |
appendPermissionLetter(sb, Permission.RESTRICTED_WRITE, "A", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
453 |
appendPermissionLetter(sb, Permission.WRITE, "W", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
454 |
appendPermissionLetter(sb, Permission.DELETE, "D", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
455 |
appendPermissionLetter(sb, Permission.SET_OWNER, "O", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
456 |
appendPermissionLetter(sb, Permission.SET_PERMISSION, "P", defined, always, maybe); |
5922 |
11 Jan 12 |
nicklas |
457 |
sb.append("]"); |
5922 |
11 Jan 12 |
nicklas |
458 |
%> |
5922 |
11 Jan 12 |
nicklas |
459 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
460 |
<td><%=ppType%> </td> |
5922 |
11 Jan 12 |
nicklas |
461 |
<td><%=sb.toString()%></td> |
5922 |
11 Jan 12 |
nicklas |
462 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
463 |
<% |
5922 |
11 Jan 12 |
nicklas |
464 |
} |
5922 |
11 Jan 12 |
nicklas |
465 |
} |
5922 |
11 Jan 12 |
nicklas |
466 |
%> |
5922 |
11 Jan 12 |
nicklas |
467 |
</table> |
5922 |
11 Jan 12 |
nicklas |
468 |
<% |
5922 |
11 Jan 12 |
nicklas |
469 |
} |
5922 |
11 Jan 12 |
nicklas |
470 |
else |
5922 |
11 Jan 12 |
nicklas |
471 |
{ |
5922 |
11 Jan 12 |
nicklas |
472 |
%> |
5922 |
11 Jan 12 |
nicklas |
473 |
This plug-in doesn't request any permissions. |
5922 |
11 Jan 12 |
nicklas |
474 |
<% |
5922 |
11 Jan 12 |
nicklas |
475 |
} |
5922 |
11 Jan 12 |
nicklas |
476 |
%> |
5922 |
11 Jan 12 |
nicklas |
477 |
</div> |
5922 |
11 Jan 12 |
nicklas |
478 |
<base:buttongroup> |
6305 |
09 Aug 13 |
nicklas |
479 |
<base:button title="Use requested permissions" id="btnSetRequestedPermissions" |
5922 |
11 Jan 12 |
nicklas |
480 |
tooltip="Use the permissions requested by the plugin." |
5922 |
11 Jan 12 |
nicklas |
481 |
visible="<%=requestedPermissions != null && requestedPermissions.size() > 0%>"/> |
5922 |
11 Jan 12 |
nicklas |
482 |
</base:buttongroup> |
5922 |
11 Jan 12 |
nicklas |
483 |
</td> |
5922 |
11 Jan 12 |
nicklas |
484 |
</tr> |
6147 |
21 Sep 12 |
nicklas |
485 |
</table> |
6147 |
21 Sep 12 |
nicklas |
486 |
</td> |
6147 |
21 Sep 12 |
nicklas |
487 |
</tr> |
6147 |
21 Sep 12 |
nicklas |
488 |
</table> |
6147 |
21 Sep 12 |
nicklas |
489 |
</div> |
2802 |
25 Oct 06 |
nicklas |
490 |
</td> |
2802 |
25 Oct 06 |
nicklas |
491 |
</tr> |
2802 |
25 Oct 06 |
nicklas |
492 |
</table> |
2671 |
27 Sep 06 |
martin |
493 |
</t:tab> |
2631 |
08 Sep 06 |
nicklas |
494 |
<t:tab id="agents" title="Job agents" helpid="plugindefinition.jobagents"> |
5922 |
11 Jan 12 |
nicklas |
495 |
<table class="fullform input100"> |
5922 |
11 Jan 12 |
nicklas |
496 |
<tr> |
6147 |
21 Sep 12 |
nicklas |
497 |
<th><label for="use_internal_jobqueue">Use internal job queue</label></th> |
5922 |
11 Jan 12 |
nicklas |
498 |
<td> |
5922 |
11 Jan 12 |
nicklas |
499 |
<input type="checkbox" name="use_internal_jobqueue" id="use_internal_jobqueue" value="1" |
5922 |
11 Jan 12 |
nicklas |
500 |
<%=plugin == null || plugin.getUseInternalJobQueue() ? "checked" : "" %>> |
5922 |
11 Jan 12 |
nicklas |
501 |
</td> |
3871 |
22 Oct 07 |
nicklas |
502 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
503 |
<tr class="big"> |
5922 |
11 Jan 12 |
nicklas |
504 |
<th>Job agents</th> |
5922 |
11 Jan 12 |
nicklas |
505 |
<td> |
5922 |
11 Jan 12 |
nicklas |
506 |
<div class="selectionlist"> |
5922 |
11 Jan 12 |
nicklas |
507 |
<table> |
5922 |
11 Jan 12 |
nicklas |
508 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
509 |
<td> |
6305 |
09 Aug 13 |
nicklas |
510 |
<select name="agents" id="agents" |
6305 |
09 Aug 13 |
nicklas |
511 |
class="auto-init" data-auto-init="link-container" |
6305 |
09 Aug 13 |
nicklas |
512 |
data-initial-items="[<%=HTML.encodeTags(jsonAgents.toJSONString()) %>]" |
6621 |
24 Nov 14 |
nicklas |
513 |
size="12" multiple> |
5922 |
11 Jan 12 |
nicklas |
514 |
</select> |
5922 |
11 Jan 12 |
nicklas |
515 |
</td> |
5922 |
11 Jan 12 |
nicklas |
516 |
<td style="vertical-align: top;"> |
5922 |
11 Jan 12 |
nicklas |
517 |
<base:buttongroup vertical="true"> |
5922 |
11 Jan 12 |
nicklas |
518 |
<base:button |
6305 |
09 Aug 13 |
nicklas |
519 |
id="btnAddAgents" |
6305 |
09 Aug 13 |
nicklas |
520 |
subclass="leftaligned auto-init" |
6305 |
09 Aug 13 |
nicklas |
521 |
data-auto-init="add-link" |
6305 |
09 Aug 13 |
nicklas |
522 |
data-list-id="agents" |
6305 |
09 Aug 13 |
nicklas |
523 |
data-item-type="JOBAGENT" |
5922 |
11 Jan 12 |
nicklas |
524 |
title="Add job agents…" |
5922 |
11 Jan 12 |
nicklas |
525 |
tooltip="Add job agents to this plugin" |
5922 |
11 Jan 12 |
nicklas |
526 |
/> |
5922 |
11 Jan 12 |
nicklas |
527 |
<base:button |
6305 |
09 Aug 13 |
nicklas |
528 |
id="btnRemoveAgents" |
6305 |
09 Aug 13 |
nicklas |
529 |
subclass="leftaligned auto-init" |
6305 |
09 Aug 13 |
nicklas |
530 |
data-auto-init="remove-link" |
6305 |
09 Aug 13 |
nicklas |
531 |
data-list-id="agents" |
5922 |
11 Jan 12 |
nicklas |
532 |
style="width: 14em;" |
5922 |
11 Jan 12 |
nicklas |
533 |
title="Remove" |
5922 |
11 Jan 12 |
nicklas |
534 |
tooltip="Remove the selected job agents" |
5922 |
11 Jan 12 |
nicklas |
535 |
/> |
5922 |
11 Jan 12 |
nicklas |
536 |
</base:buttongroup> |
5922 |
11 Jan 12 |
nicklas |
537 |
</td> |
5922 |
11 Jan 12 |
nicklas |
538 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
539 |
</table> |
5922 |
11 Jan 12 |
nicklas |
540 |
</div> |
5922 |
11 Jan 12 |
nicklas |
541 |
</td> |
5922 |
11 Jan 12 |
nicklas |
542 |
</tr> |
6621 |
24 Nov 14 |
nicklas |
543 |
<tbody class="sectionheader"> |
6621 |
24 Nov 14 |
nicklas |
544 |
<tr class="sectionheader"> |
6621 |
24 Nov 14 |
nicklas |
545 |
<th colspan="2">Settings for the selected job agent</th> |
6621 |
24 Nov 14 |
nicklas |
546 |
</tr> |
6621 |
24 Nov 14 |
nicklas |
547 |
</tbody> |
5922 |
11 Jan 12 |
nicklas |
548 |
<tbody id="agentsettings" style="display: none;"> |
2631 |
08 Sep 06 |
nicklas |
549 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
550 |
<th class="subprompt">Max memory</th> |
2631 |
08 Sep 06 |
nicklas |
551 |
<td> |
6305 |
09 Aug 13 |
nicklas |
552 |
<input type="text" name="agentMaxMemory" id="agentMaxMemory" class="text" style="width: 15em;" |
6305 |
09 Aug 13 |
nicklas |
553 |
maxlength="16"> |
2631 |
08 Sep 06 |
nicklas |
554 |
(Use KB, MB or GB to specify memory) |
2631 |
08 Sep 06 |
nicklas |
555 |
</td> |
2631 |
08 Sep 06 |
nicklas |
556 |
</tr> |
2631 |
08 Sep 06 |
nicklas |
557 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
558 |
<th class="subprompt"></th> |
2631 |
08 Sep 06 |
nicklas |
559 |
<td> |
6305 |
09 Aug 13 |
nicklas |
560 |
<input type="checkbox" name="useDefaultMaxMemory" id="useDefaultMaxMemory"> |
5922 |
11 Jan 12 |
nicklas |
561 |
<label for="useDefaultMaxMemory">Use default</label> (<span id="defaultMaxMemory"></span>) |
2631 |
08 Sep 06 |
nicklas |
562 |
</td> |
2631 |
08 Sep 06 |
nicklas |
563 |
</tr> |
2631 |
08 Sep 06 |
nicklas |
564 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
565 |
<th class="subprompt">Trusted</th> |
2631 |
08 Sep 06 |
nicklas |
566 |
<td> |
5812 |
17 Oct 11 |
nicklas |
567 |
<input type="radio" name="agentTrusted" id="agentTrustedDefault" value="" |
6305 |
09 Aug 13 |
nicklas |
568 |
><label for="agentTrustedDefault">default (<span id="defaultTrusted"></span>)</label> |
5812 |
17 Oct 11 |
nicklas |
569 |
<input type="radio" name="agentTrusted" id="agentTrustedYes" value="1" |
6305 |
09 Aug 13 |
nicklas |
570 |
><label for="agentTrustedYes">yes</label> |
5812 |
17 Oct 11 |
nicklas |
571 |
<input type="radio" name="agentTrusted" id="agentTrustedNo" value="0" |
6305 |
09 Aug 13 |
nicklas |
572 |
><label for="agentTrustedNo">no</label> |
2631 |
08 Sep 06 |
nicklas |
573 |
</td> |
2631 |
08 Sep 06 |
nicklas |
574 |
</tr> |
2631 |
08 Sep 06 |
nicklas |
575 |
<tr> |
5922 |
11 Jan 12 |
nicklas |
576 |
<th class="subprompt">Priority boost</th> |
2631 |
08 Sep 06 |
nicklas |
577 |
<td> |
6305 |
09 Aug 13 |
nicklas |
578 |
<input type="text" name="agentPriorityBoost" id="agentPriorityBoost" |
6305 |
09 Aug 13 |
nicklas |
579 |
class="text" style="width: 15em;" |
6305 |
09 Aug 13 |
nicklas |
580 |
maxlength="10"> |
2631 |
08 Sep 06 |
nicklas |
581 |
</td> |
2631 |
08 Sep 06 |
nicklas |
582 |
</tr> |
5922 |
11 Jan 12 |
nicklas |
583 |
</tbody> |
5922 |
11 Jan 12 |
nicklas |
584 |
<tr class="dynamic"> |
5922 |
11 Jan 12 |
nicklas |
585 |
<th></th> |
5922 |
11 Jan 12 |
nicklas |
586 |
<td></td> |
2631 |
08 Sep 06 |
nicklas |
587 |
</tr> |
1342 |
15 Sep 05 |
nicklas |
588 |
</table> |
1342 |
15 Sep 05 |
nicklas |
589 |
</t:tab> |
2631 |
08 Sep 06 |
nicklas |
590 |
|
3979 |
19 Nov 07 |
nicklas |
591 |
<t:tab id="annotations" title="Annotations" |
3979 |
19 Nov 07 |
nicklas |
592 |
helpid="annotations.edit" tooltip="Enter values for annotations" |
6254 |
22 Mar 13 |
nicklas |
593 |
visible="<%=plugin != null && !plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin")%>" |
6305 |
09 Aug 13 |
nicklas |
594 |
> |
6254 |
22 Mar 13 |
nicklas |
595 |
<jsp:include page="../../common/annotations/annotate_frameset.jsp"> |
6254 |
22 Mar 13 |
nicklas |
596 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6254 |
22 Mar 13 |
nicklas |
597 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6254 |
22 Mar 13 |
nicklas |
598 |
<jsp:param name="ID" value="<%=ID%>" /> |
6254 |
22 Mar 13 |
nicklas |
599 |
</jsp:include> |
6254 |
22 Mar 13 |
nicklas |
600 |
</t:tab> |
1342 |
15 Sep 05 |
nicklas |
601 |
</t:tabcontrol> |
2671 |
27 Sep 06 |
martin |
602 |
<% |
2671 |
27 Sep 06 |
martin |
603 |
ItemResultList<RoleKey> roleKeys = roleKeyQuery.list(dc); |
2671 |
27 Sep 06 |
martin |
604 |
for (RoleKey key : roleKeys) |
2671 |
27 Sep 06 |
martin |
605 |
{ |
2722 |
11 Oct 06 |
nicklas |
606 |
int grantedCode = plugin == null ? 0 : PermissionUtil.getPermissionCode(plugin.getGranted(key)); |
2722 |
11 Oct 06 |
nicklas |
607 |
int deniedCode = plugin == null ? 255 : PermissionUtil.getPermissionCode(plugin.getDenied(key)); |
2671 |
27 Sep 06 |
martin |
608 |
int definedCode = key.getItemType().getDefinedPermissions() == null ? 0 : PermissionUtil.getPermissionCode(key.getItemType().getDefinedPermissions()); |
2671 |
27 Sep 06 |
martin |
609 |
String name = key.getItemType().name(); |
2671 |
27 Sep 06 |
martin |
610 |
%> |
2722 |
11 Oct 06 |
nicklas |
611 |
<input type="hidden" name="<%=name%>_granted" value="<%=grantedCode%>"> |
2722 |
11 Oct 06 |
nicklas |
612 |
<input type="hidden" name="<%=name%>_denied" value="<%=deniedCode%>"> |
2671 |
27 Sep 06 |
martin |
613 |
<input type="hidden" name="<%=name%>_defined" value="<%=definedCode%>"> |
2671 |
27 Sep 06 |
martin |
614 |
<% |
2671 |
27 Sep 06 |
martin |
615 |
} |
2671 |
27 Sep 06 |
martin |
616 |
%> |
1342 |
15 Sep 05 |
nicklas |
617 |
</form> |
5922 |
11 Jan 12 |
nicklas |
618 |
|
5922 |
11 Jan 12 |
nicklas |
619 |
<div class="legend"> |
5946 |
03 Feb 12 |
nicklas |
620 |
<base:icon image="required.png" />= required information |
5922 |
11 Jan 12 |
nicklas |
621 |
</div> |
5922 |
11 Jan 12 |
nicklas |
622 |
|
5922 |
11 Jan 12 |
nicklas |
623 |
<base:buttongroup subclass="dialogbuttons"> |
6305 |
09 Aug 13 |
nicklas |
624 |
<base:button id="btnSave" title="Save" /> |
6305 |
09 Aug 13 |
nicklas |
625 |
<base:button id="close" title="Cancel" /> |
5922 |
11 Jan 12 |
nicklas |
626 |
</base:buttongroup> |
5922 |
11 Jan 12 |
nicklas |
627 |
|
1342 |
15 Sep 05 |
nicklas |
628 |
</base:body> |
1342 |
15 Sep 05 |
nicklas |
629 |
</base:page> |
1342 |
15 Sep 05 |
nicklas |
630 |
<% |
1342 |
15 Sep 05 |
nicklas |
631 |
} |
1342 |
15 Sep 05 |
nicklas |
632 |
finally |
1342 |
15 Sep 05 |
nicklas |
633 |
{ |
1342 |
15 Sep 05 |
nicklas |
634 |
if (dc != null) dc.close(); |
1342 |
15 Sep 05 |
nicklas |
635 |
} |
1342 |
15 Sep 05 |
nicklas |
636 |
%> |