1619 |
16 Nov 05 |
nicklas |
1 |
<%-- $Id$ |
1619 |
16 Nov 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, Gregory Vincic |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
1619 |
16 Nov 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/ |
1619 |
16 Nov 05 |
nicklas |
9 |
|
1619 |
16 Nov 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
1619 |
16 Nov 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 |
1619 |
16 Nov 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
1619 |
16 Nov 05 |
nicklas |
14 |
|
1619 |
16 Nov 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
1619 |
16 Nov 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1619 |
16 Nov 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1619 |
16 Nov 05 |
nicklas |
18 |
GNU General Public License for more details. |
1619 |
16 Nov 05 |
nicklas |
19 |
|
1619 |
16 Nov 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1619 |
16 Nov 05 |
nicklas |
22 |
------------------------------------------------------------------ |
1619 |
16 Nov 05 |
nicklas |
23 |
|
1619 |
16 Nov 05 |
nicklas |
24 |
@author Nicklas |
1619 |
16 Nov 05 |
nicklas |
25 |
@version 2.0 |
1619 |
16 Nov 05 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
1619 |
16 Nov 05 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
1619 |
16 Nov 05 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
1881 |
01 Feb 06 |
nicklas |
30 |
import="net.sf.basedb.core.SystemItems" |
1619 |
16 Nov 05 |
nicklas |
31 |
import="net.sf.basedb.core.Item" |
1881 |
01 Feb 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
1881 |
01 Feb 06 |
nicklas |
33 |
import="net.sf.basedb.core.Permission" |
1619 |
16 Nov 05 |
nicklas |
34 |
import="net.sf.basedb.core.Job" |
4311 |
23 May 08 |
nicklas |
35 |
import="net.sf.basedb.core.JobAgent" |
7307 |
07 Mar 17 |
nicklas |
36 |
import="net.sf.basedb.core.Project" |
7307 |
07 Mar 17 |
nicklas |
37 |
import="net.sf.basedb.core.BasicItem" |
2216 |
05 May 06 |
nicklas |
38 |
import="net.sf.basedb.core.Nameable" |
2216 |
05 May 06 |
nicklas |
39 |
import="net.sf.basedb.core.File" |
4424 |
28 Aug 08 |
nicklas |
40 |
import="net.sf.basedb.core.Path" |
1881 |
01 Feb 06 |
nicklas |
41 |
import="net.sf.basedb.core.User" |
5073 |
21 Aug 09 |
nicklas |
42 |
import="net.sf.basedb.core.ChangeHistory" |
5073 |
21 Aug 09 |
nicklas |
43 |
import="net.sf.basedb.core.ItemResultIterator" |
1881 |
01 Feb 06 |
nicklas |
44 |
import="net.sf.basedb.core.ItemQuery" |
5404 |
10 Sep 10 |
martin |
45 |
import="net.sf.basedb.core.ItemResultList" |
1881 |
01 Feb 06 |
nicklas |
46 |
import="net.sf.basedb.core.PermissionDeniedException" |
1881 |
01 Feb 06 |
nicklas |
47 |
import="net.sf.basedb.core.PluginDefinition" |
2709 |
05 Oct 06 |
nicklas |
48 |
import="net.sf.basedb.core.PluginConfiguration" |
5404 |
10 Sep 10 |
martin |
49 |
import="net.sf.basedb.core.PluginType" |
2348 |
01 Jun 06 |
nicklas |
50 |
import="net.sf.basedb.core.ParameterInfo" |
5073 |
21 Aug 09 |
nicklas |
51 |
import="net.sf.basedb.core.query.Orders" |
5073 |
21 Aug 09 |
nicklas |
52 |
import="net.sf.basedb.core.query.Hql" |
1881 |
01 Feb 06 |
nicklas |
53 |
import="net.sf.basedb.core.plugin.GuiContext" |
5404 |
10 Sep 10 |
martin |
54 |
import="net.sf.basedb.core.plugin.NonRestartable" |
1881 |
01 Feb 06 |
nicklas |
55 |
import="net.sf.basedb.core.plugin.Plugin" |
4093 |
18 Jan 08 |
enell |
56 |
import="net.sf.basedb.core.signal.SignalTransporter" |
4093 |
18 Jan 08 |
enell |
57 |
import="net.sf.basedb.core.signal.Signal" |
4424 |
28 Aug 08 |
nicklas |
58 |
import="net.sf.basedb.plugins.util.Parameters" |
1619 |
16 Nov 05 |
nicklas |
59 |
import="net.sf.basedb.clients.web.Base" |
5073 |
21 Aug 09 |
nicklas |
60 |
import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
1619 |
16 Nov 05 |
nicklas |
61 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
62 |
import="net.sf.basedb.util.Values" |
2942 |
22 Nov 06 |
nicklas |
63 |
import="net.sf.basedb.util.formatter.Formatter" |
2942 |
22 Nov 06 |
nicklas |
64 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
1881 |
01 Feb 06 |
nicklas |
65 |
import="java.util.Date" |
1881 |
01 Feb 06 |
nicklas |
66 |
import="java.util.Map" |
1881 |
01 Feb 06 |
nicklas |
67 |
import="java.util.Set" |
1619 |
16 Nov 05 |
nicklas |
68 |
import="java.util.List" |
2348 |
01 Jun 06 |
nicklas |
69 |
import="java.util.Collections" |
4093 |
18 Jan 08 |
enell |
70 |
import="java.util.Collection" |
1619 |
16 Nov 05 |
nicklas |
71 |
%> |
1619 |
16 Nov 05 |
nicklas |
72 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1619 |
16 Nov 05 |
nicklas |
73 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
1881 |
01 Feb 06 |
nicklas |
74 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
1881 |
01 Feb 06 |
nicklas |
75 |
<%! |
1881 |
01 Feb 06 |
nicklas |
76 |
private static final Item itemType = Item.JOB; |
1881 |
01 Feb 06 |
nicklas |
77 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
5073 |
21 Aug 09 |
nicklas |
78 |
|
5073 |
21 Aug 09 |
nicklas |
79 |
private String getItemName(BasicItem item) |
5073 |
21 Aug 09 |
nicklas |
80 |
{ |
5073 |
21 Aug 09 |
nicklas |
81 |
String itemName = ""; |
5073 |
21 Aug 09 |
nicklas |
82 |
if (item instanceof File) |
5073 |
21 Aug 09 |
nicklas |
83 |
{ |
5073 |
21 Aug 09 |
nicklas |
84 |
itemName = ((File)item).getPath().toString(); |
5073 |
21 Aug 09 |
nicklas |
85 |
} |
5073 |
21 Aug 09 |
nicklas |
86 |
else if (item instanceof Nameable) |
5073 |
21 Aug 09 |
nicklas |
87 |
{ |
5073 |
21 Aug 09 |
nicklas |
88 |
itemName = ((Nameable)item).getName(); |
5073 |
21 Aug 09 |
nicklas |
89 |
} |
5073 |
21 Aug 09 |
nicklas |
90 |
else |
5073 |
21 Aug 09 |
nicklas |
91 |
{ |
5073 |
21 Aug 09 |
nicklas |
92 |
itemName = item.toString(); |
5073 |
21 Aug 09 |
nicklas |
93 |
} |
5073 |
21 Aug 09 |
nicklas |
94 |
return itemName; |
5073 |
21 Aug 09 |
nicklas |
95 |
} |
1881 |
01 Feb 06 |
nicklas |
96 |
%> |
1619 |
16 Nov 05 |
nicklas |
97 |
<% |
1619 |
16 Nov 05 |
nicklas |
98 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1619 |
16 Nov 05 |
nicklas |
99 |
final String ID = sc.getId(); |
1881 |
01 Feb 06 |
nicklas |
100 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1881 |
01 Feb 06 |
nicklas |
101 |
final int itemId = cc.getId(); |
1881 |
01 Feb 06 |
nicklas |
102 |
final String tab = Values.getString(request.getParameter("tab"), "properties"); |
1619 |
16 Nov 05 |
nicklas |
103 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
104 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
1619 |
16 Nov 05 |
nicklas |
105 |
try |
1619 |
16 Nov 05 |
nicklas |
106 |
{ |
1881 |
01 Feb 06 |
nicklas |
107 |
Job job = Job.getById(dc, itemId); |
4355 |
30 Jun 08 |
nicklas |
108 |
String title = "View job -- " + HTML.encodeTags(job.getName()); |
1881 |
01 Feb 06 |
nicklas |
109 |
|
1881 |
01 Feb 06 |
nicklas |
110 |
final boolean writePermission = job.hasPermission(Permission.WRITE); |
1881 |
01 Feb 06 |
nicklas |
111 |
final boolean deletePermission = job.hasPermission(Permission.DELETE); |
4003 |
26 Nov 07 |
nicklas |
112 |
final boolean isRemoved = job.isRemoved(); |
4003 |
26 Nov 07 |
nicklas |
113 |
final boolean isUsed = isRemoved && job.isUsed(); |
4003 |
26 Nov 07 |
nicklas |
114 |
final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
1881 |
01 Feb 06 |
nicklas |
115 |
|
7267 |
15 Dec 16 |
nicklas |
116 |
boolean readPlugin = true; |
7267 |
15 Dec 16 |
nicklas |
117 |
PluginDefinition plugin = null; |
7267 |
15 Dec 16 |
nicklas |
118 |
try |
7267 |
15 Dec 16 |
nicklas |
119 |
{ |
7267 |
15 Dec 16 |
nicklas |
120 |
plugin = job.getPluginDefinition(); |
7267 |
15 Dec 16 |
nicklas |
121 |
} |
7267 |
15 Dec 16 |
nicklas |
122 |
catch (PermissionDeniedException ex) |
7267 |
15 Dec 16 |
nicklas |
123 |
{ |
7267 |
15 Dec 16 |
nicklas |
124 |
readPlugin = false; |
7267 |
15 Dec 16 |
nicklas |
125 |
} |
2709 |
05 Oct 06 |
nicklas |
126 |
boolean readCurrentConfig = true; |
2709 |
05 Oct 06 |
nicklas |
127 |
PluginConfiguration currentConfig = null; |
1881 |
01 Feb 06 |
nicklas |
128 |
try |
1881 |
01 Feb 06 |
nicklas |
129 |
{ |
2709 |
05 Oct 06 |
nicklas |
130 |
currentConfig = job.getPluginConfiguration(); |
1881 |
01 Feb 06 |
nicklas |
131 |
} |
1881 |
01 Feb 06 |
nicklas |
132 |
catch (PermissionDeniedException ex) |
1881 |
01 Feb 06 |
nicklas |
133 |
{ |
2709 |
05 Oct 06 |
nicklas |
134 |
readCurrentConfig = false; |
1881 |
01 Feb 06 |
nicklas |
135 |
} |
4311 |
23 May 08 |
nicklas |
136 |
boolean readAgent = true; |
4311 |
23 May 08 |
nicklas |
137 |
JobAgent agent = null; |
4311 |
23 May 08 |
nicklas |
138 |
try |
4311 |
23 May 08 |
nicklas |
139 |
{ |
4311 |
23 May 08 |
nicklas |
140 |
agent = job.getJobAgent(); |
4311 |
23 May 08 |
nicklas |
141 |
} |
4311 |
23 May 08 |
nicklas |
142 |
catch (PermissionDeniedException ex) |
4311 |
23 May 08 |
nicklas |
143 |
{ |
4311 |
23 May 08 |
nicklas |
144 |
readAgent = false; |
4311 |
23 May 08 |
nicklas |
145 |
} |
7307 |
07 Mar 17 |
nicklas |
146 |
boolean readActiveProject = true; |
7307 |
07 Mar 17 |
nicklas |
147 |
Project activeProject = null; |
7307 |
07 Mar 17 |
nicklas |
148 |
try |
7307 |
07 Mar 17 |
nicklas |
149 |
{ |
7307 |
07 Mar 17 |
nicklas |
150 |
if (job.getActiveProjectId() != 0) |
7307 |
07 Mar 17 |
nicklas |
151 |
{ |
7307 |
07 Mar 17 |
nicklas |
152 |
activeProject = Project.getById(dc, job.getActiveProjectId()); |
7307 |
07 Mar 17 |
nicklas |
153 |
} |
7307 |
07 Mar 17 |
nicklas |
154 |
} |
7307 |
07 Mar 17 |
nicklas |
155 |
catch (PermissionDeniedException ex) |
7307 |
07 Mar 17 |
nicklas |
156 |
{ |
7307 |
07 Mar 17 |
nicklas |
157 |
readActiveProject = false; |
7307 |
07 Mar 17 |
nicklas |
158 |
} |
7307 |
07 Mar 17 |
nicklas |
159 |
catch (Exception ex) |
7307 |
07 Mar 17 |
nicklas |
160 |
{ |
7307 |
07 Mar 17 |
nicklas |
161 |
// Some other problem (for example, no longer exists) |
7307 |
07 Mar 17 |
nicklas |
162 |
} |
2709 |
05 Oct 06 |
nicklas |
163 |
|
2724 |
11 Oct 06 |
nicklas |
164 |
int parameterVersion = job.getParameterVersion(); |
2724 |
11 Oct 06 |
nicklas |
165 |
int latestParameterVersion = currentConfig == null ? parameterVersion : currentConfig.getParameterVersion(); |
2724 |
11 Oct 06 |
nicklas |
166 |
|
2648 |
19 Sep 06 |
nicklas |
167 |
final Job.Status status = job.getStatus(); |
2648 |
19 Sep 06 |
nicklas |
168 |
final boolean autoUpdate = status == Job.Status.WAITING || |
4127 |
05 Feb 08 |
nicklas |
169 |
status == Job.Status.PREPARED || status == Job.Status.EXECUTING || status == Job.Status.ABORTING; |
2942 |
22 Nov 06 |
nicklas |
170 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
2942 |
22 Nov 06 |
nicklas |
171 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
4424 |
28 Aug 08 |
nicklas |
172 |
Set<String> jobParameters = job.getParameterNames(); |
4424 |
28 Aug 08 |
nicklas |
173 |
File logFile = null; |
4424 |
28 Aug 08 |
nicklas |
174 |
if (!autoUpdate && jobParameters != null && jobParameters.contains(Parameters.LOGFILE_PARAMETER)) |
4424 |
28 Aug 08 |
nicklas |
175 |
{ |
4424 |
28 Aug 08 |
nicklas |
176 |
try |
4424 |
28 Aug 08 |
nicklas |
177 |
{ |
4424 |
28 Aug 08 |
nicklas |
178 |
Object temp = job.getParameterValue(Parameters.LOGFILE_PARAMETER); |
4424 |
28 Aug 08 |
nicklas |
179 |
if (temp instanceof File) |
4424 |
28 Aug 08 |
nicklas |
180 |
{ |
4424 |
28 Aug 08 |
nicklas |
181 |
logFile = (File)temp; |
4424 |
28 Aug 08 |
nicklas |
182 |
} |
4424 |
28 Aug 08 |
nicklas |
183 |
else if (temp instanceof String) |
4424 |
28 Aug 08 |
nicklas |
184 |
{ |
4424 |
28 Aug 08 |
nicklas |
185 |
logFile = File.getByPath(dc, new Path((String)temp, Path.Type.FILE), false); |
4424 |
28 Aug 08 |
nicklas |
186 |
} |
4424 |
28 Aug 08 |
nicklas |
187 |
} |
4424 |
28 Aug 08 |
nicklas |
188 |
catch (Throwable t) |
4424 |
28 Aug 08 |
nicklas |
189 |
{} |
4424 |
28 Aug 08 |
nicklas |
190 |
} |
4093 |
18 Jan 08 |
enell |
191 |
|
7320 |
05 Apr 17 |
nicklas |
192 |
// Check if the job can be aborted or paused |
6432 |
14 Mar 14 |
nicklas |
193 |
boolean supportsAbort = false; |
7320 |
05 Apr 17 |
nicklas |
194 |
boolean supportsPause = false; |
6954 |
17 Sep 15 |
nicklas |
195 |
boolean supportsForceError = writePermission && status != Job.Status.DONE && status != Job.Status.ERROR; |
6432 |
14 Mar 14 |
nicklas |
196 |
|
6432 |
14 Mar 14 |
nicklas |
197 |
// The status must be executable or EXECUTING |
6432 |
14 Mar 14 |
nicklas |
198 |
if ((status == Job.Status.EXECUTING || status.isExecutable()) && writePermission) |
4093 |
18 Jan 08 |
enell |
199 |
{ |
6432 |
14 Mar 14 |
nicklas |
200 |
// Check if a signal-transporter exists |
4093 |
18 Jan 08 |
enell |
201 |
try |
4093 |
18 Jan 08 |
enell |
202 |
{ |
4093 |
18 Jan 08 |
enell |
203 |
SignalTransporter signalTransporter = job.getSignalTransporter(); |
6432 |
14 Mar 14 |
nicklas |
204 |
if (signalTransporter == null) |
6432 |
14 Mar 14 |
nicklas |
205 |
{ |
6432 |
14 Mar 14 |
nicklas |
206 |
// The job is only abortable if it is waiting |
6432 |
14 Mar 14 |
nicklas |
207 |
supportsAbort = status == Job.Status.WAITING; |
6432 |
14 Mar 14 |
nicklas |
208 |
} |
6432 |
14 Mar 14 |
nicklas |
209 |
else |
6432 |
14 Mar 14 |
nicklas |
210 |
{ |
6432 |
14 Mar 14 |
nicklas |
211 |
// Otherwise we must check with the signal transporter |
6432 |
14 Mar 14 |
nicklas |
212 |
Collection<Signal> supportedSignals = signalTransporter.getSupportedSignals(); |
6432 |
14 Mar 14 |
nicklas |
213 |
supportsAbort = supportedSignals == null || supportedSignals.contains(Signal.ABORT); |
7320 |
05 Apr 17 |
nicklas |
214 |
supportsPause = supportedSignals != null && supportedSignals.contains(Signal.PAUSE); |
6432 |
14 Mar 14 |
nicklas |
215 |
} |
4093 |
18 Jan 08 |
enell |
216 |
} |
4093 |
18 Jan 08 |
enell |
217 |
catch (Exception ex) |
4093 |
18 Jan 08 |
enell |
218 |
{} |
4093 |
18 Jan 08 |
enell |
219 |
} |
6432 |
14 Mar 14 |
nicklas |
220 |
if (autoUpdate) job.requestStatusUpdate(); |
1619 |
16 Nov 05 |
nicklas |
221 |
%> |
6311 |
23 Aug 13 |
nicklas |
222 |
<base:page type="popup" title="<%=title%>" id="view-page"> |
6311 |
23 Aug 13 |
nicklas |
223 |
<base:head scripts="tabcontrol-2.js,table.js,~jobs.js" |
7320 |
05 Apr 17 |
nicklas |
224 |
styles="tabcontrol.css,progressbar.css,table.css"> |
7320 |
05 Apr 17 |
nicklas |
225 |
<style> |
7320 |
05 Apr 17 |
nicklas |
226 |
.executecommand |
7320 |
05 Apr 17 |
nicklas |
227 |
{ |
7320 |
05 Apr 17 |
nicklas |
228 |
font-size: 0.85em; |
7320 |
05 Apr 17 |
nicklas |
229 |
color: #777777; |
7320 |
05 Apr 17 |
nicklas |
230 |
} |
7320 |
05 Apr 17 |
nicklas |
231 |
</style> |
7320 |
05 Apr 17 |
nicklas |
232 |
</base:head> |
6520 |
18 Aug 14 |
nicklas |
233 |
<base:body data-read-only="1"> |
6311 |
23 Aug 13 |
nicklas |
234 |
<h1><%=title%> <base:help tabcontrol="main" /></h1> |
6311 |
23 Aug 13 |
nicklas |
235 |
<div id="page-data" |
6311 |
23 Aug 13 |
nicklas |
236 |
data-item-id="<%=itemId%>" |
6311 |
23 Aug 13 |
nicklas |
237 |
data-job-parameter-version="<%=parameterVersion %>" |
6311 |
23 Aug 13 |
nicklas |
238 |
data-latest-parameter-version="<%=latestParameterVersion %>" |
7317 |
03 Apr 17 |
nicklas |
239 |
data-breakpoint="<%=HTML.encodeTags(job.getExecuteCommand()) %>" |
6311 |
23 Aug 13 |
nicklas |
240 |
data-job-status="<%=status.name()%>" |
6311 |
23 Aug 13 |
nicklas |
241 |
data-auto-update="<%=autoUpdate ? 1 : 0 %>" |
6311 |
23 Aug 13 |
nicklas |
242 |
></div> |
5402 |
06 Sep 10 |
nicklas |
243 |
|
5909 |
14 Dec 11 |
nicklas |
244 |
<t:tabcontrol id="main" |
5909 |
14 Dec 11 |
nicklas |
245 |
subclass="content dialogtabcontrol" |
5909 |
14 Dec 11 |
nicklas |
246 |
active="<%=tab%>" position="bottom"> |
2425 |
26 Jun 06 |
nicklas |
247 |
<t:tab id="properties" title="Properties" helpid="job.view.properties"> |
5909 |
14 Dec 11 |
nicklas |
248 |
<table class="fullform outlined"> |
1881 |
01 Feb 06 |
nicklas |
249 |
<% |
5909 |
14 Dec 11 |
nicklas |
250 |
if (isRemoved) |
1881 |
01 Feb 06 |
nicklas |
251 |
{ |
1881 |
01 Feb 06 |
nicklas |
252 |
%> |
5909 |
14 Dec 11 |
nicklas |
253 |
<tr> |
6621 |
24 Nov 14 |
nicklas |
254 |
<th></th> |
6621 |
24 Nov 14 |
nicklas |
255 |
<td colspan="2"> |
5909 |
14 Dec 11 |
nicklas |
256 |
<div class="itemstatus"> |
5909 |
14 Dec 11 |
nicklas |
257 |
<base:icon |
6311 |
23 Aug 13 |
nicklas |
258 |
id="btnDeletePermanently" |
5946 |
03 Feb 12 |
nicklas |
259 |
image="deleted.png" |
6311 |
23 Aug 13 |
nicklas |
260 |
data-notify="btnDeletePermanently" |
6311 |
23 Aug 13 |
nicklas |
261 |
enabled="<%=deletePermanentlyPermission %>" |
5909 |
14 Dec 11 |
nicklas |
262 |
tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>" |
5909 |
14 Dec 11 |
nicklas |
263 |
visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon> |
6311 |
23 Aug 13 |
nicklas |
264 |
<base:icon |
6311 |
23 Aug 13 |
nicklas |
265 |
id="btnUsingItems" |
6311 |
23 Aug 13 |
nicklas |
266 |
image="used.png" |
5909 |
14 Dec 11 |
nicklas |
267 |
tooltip="Show the items that are using this one" |
5909 |
14 Dec 11 |
nicklas |
268 |
visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon> |
5909 |
14 Dec 11 |
nicklas |
269 |
</div> |
5909 |
14 Dec 11 |
nicklas |
270 |
</td> |
5909 |
14 Dec 11 |
nicklas |
271 |
</tr> |
1881 |
01 Feb 06 |
nicklas |
272 |
<% |
1881 |
01 Feb 06 |
nicklas |
273 |
} |
1881 |
01 Feb 06 |
nicklas |
274 |
%> |
1619 |
16 Nov 05 |
nicklas |
275 |
<tr> |
6621 |
24 Nov 14 |
nicklas |
276 |
<th>Name</th> |
1619 |
16 Nov 05 |
nicklas |
277 |
<td><%=HTML.encodeTags(job.getName())%></td> |
1619 |
16 Nov 05 |
nicklas |
278 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
279 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
280 |
<th>Plugin</th> |
5705 |
22 Aug 11 |
nicklas |
281 |
<td> |
6576 |
22 Oct 14 |
nicklas |
282 |
<base:propertyvalue item="<%=job%>" property="pluginDefinition.name" nulltext="<i>External</i>"/> |
5705 |
22 Aug 11 |
nicklas |
283 |
<%=job.getPluginVersion() == null ? |
6576 |
22 Oct 14 |
nicklas |
284 |
"" : "(" + HTML.encodeTags(job.getPluginVersion()) + ")"%> |
5705 |
22 Aug 11 |
nicklas |
285 |
</td> |
5705 |
22 Aug 11 |
nicklas |
286 |
</tr> |
5705 |
22 Aug 11 |
nicklas |
287 |
<% |
5705 |
22 Aug 11 |
nicklas |
288 |
if (currentConfig != null) |
5705 |
22 Aug 11 |
nicklas |
289 |
{ |
5705 |
22 Aug 11 |
nicklas |
290 |
%> |
5909 |
14 Dec 11 |
nicklas |
291 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
292 |
<th class="subprompt">- configuration</th> |
5705 |
22 Aug 11 |
nicklas |
293 |
<td> |
5705 |
22 Aug 11 |
nicklas |
294 |
<base:propertyvalue item="<%=job%>" property="pluginConfiguration.name" /> |
5705 |
22 Aug 11 |
nicklas |
295 |
</td> |
5705 |
22 Aug 11 |
nicklas |
296 |
</tr> |
5705 |
22 Aug 11 |
nicklas |
297 |
<% |
5705 |
22 Aug 11 |
nicklas |
298 |
} |
5705 |
22 Aug 11 |
nicklas |
299 |
%> |
5909 |
14 Dec 11 |
nicklas |
300 |
<tr> |
7267 |
15 Dec 16 |
nicklas |
301 |
<th>Type</th> |
7267 |
15 Dec 16 |
nicklas |
302 |
<td> |
7267 |
15 Dec 16 |
nicklas |
303 |
<%=plugin == null ? "" : plugin.getMainType() %> |
7267 |
15 Dec 16 |
nicklas |
304 |
<base:propertyvalue item="<%=job%>" property="itemSubtype.name" nulltext="" /> |
7267 |
15 Dec 16 |
nicklas |
305 |
</td> |
7267 |
15 Dec 16 |
nicklas |
306 |
</tr> |
7267 |
15 Dec 16 |
nicklas |
307 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
308 |
<th>User</th> |
5705 |
22 Aug 11 |
nicklas |
309 |
<td> |
5705 |
22 Aug 11 |
nicklas |
310 |
<base:propertyvalue item="<%=job%>" property="owner.name" /> |
5705 |
22 Aug 11 |
nicklas |
311 |
</td> |
5705 |
22 Aug 11 |
nicklas |
312 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
313 |
<tr> |
7307 |
07 Mar 17 |
nicklas |
314 |
<th>Active project</th> |
7307 |
07 Mar 17 |
nicklas |
315 |
<td> |
7307 |
07 Mar 17 |
nicklas |
316 |
<%=activeProject == null ? (readActiveProject ? "<i>- none -</i>" : "<i>- denied -</i>") : HTML.encodeTags(activeProject.getName()) %> |
7307 |
07 Mar 17 |
nicklas |
317 |
</td> |
7307 |
07 Mar 17 |
nicklas |
318 |
</tr> |
7307 |
07 Mar 17 |
nicklas |
319 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
320 |
<th>Experiment</th> |
5705 |
22 Aug 11 |
nicklas |
321 |
<td> |
5705 |
22 Aug 11 |
nicklas |
322 |
<base:propertyvalue item="<%=job%>" property="experiment.name" /> |
5705 |
22 Aug 11 |
nicklas |
323 |
</td> |
5705 |
22 Aug 11 |
nicklas |
324 |
</tr> |
1881 |
01 Feb 06 |
nicklas |
325 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
326 |
<th>Status</th> |
5914 |
16 Dec 11 |
nicklas |
327 |
<td> |
7320 |
05 Apr 17 |
nicklas |
328 |
<div class="<%=status == Job.Status.ERROR ? "error messagecontainer" : ""%>" style="margin: 1px 0px;"> |
7320 |
05 Apr 17 |
nicklas |
329 |
<%=status%><%=job.isDryRun() ? " (dry-run)" : "" %>: |
7317 |
03 Apr 17 |
nicklas |
330 |
<span id="message"> |
7320 |
05 Apr 17 |
nicklas |
331 |
<%=(status == Job.Status.WAITING || status == Job.Status.PAUSED) && job.getExecuteCommand() != null ? |
7320 |
05 Apr 17 |
nicklas |
332 |
"<span class=\"executecommand\">(Resume from " + job.getExecuteCommand() + ")</span><br>" : ""%> |
7317 |
03 Apr 17 |
nicklas |
333 |
<%=HTML.niceFormat(job.getStatusMessage())%></span> |
5914 |
16 Dec 11 |
nicklas |
334 |
</div> |
1619 |
16 Nov 05 |
nicklas |
335 |
</td> |
1619 |
16 Nov 05 |
nicklas |
336 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
337 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
338 |
<th class="subprompt">- percent complete</th> |
1619 |
16 Nov 05 |
nicklas |
339 |
<td> |
6621 |
24 Nov 14 |
nicklas |
340 |
<table class="progressbar" style="margin-bottom: 2px;"> |
1619 |
16 Nov 05 |
nicklas |
341 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
342 |
<td> |
6142 |
20 Sep 12 |
nicklas |
343 |
<table class="bar" style="width: 200px;"> |
1619 |
16 Nov 05 |
nicklas |
344 |
<tr> |
1619 |
16 Nov 05 |
nicklas |
345 |
<% |
1619 |
16 Nov 05 |
nicklas |
346 |
int percent = job.getPercentComplete(); |
1619 |
16 Nov 05 |
nicklas |
347 |
%> |
6143 |
20 Sep 12 |
nicklas |
348 |
<td id="percentDone" class="percentDone" style="width: <%=percent%>%; <%=percent <= 0 ? "display: none;" : ""%>"> </td> |
6143 |
20 Sep 12 |
nicklas |
349 |
<td id="percentRemain" class="percentRemain" style="width: <%=100-percent%>%; <%=percent == 100 || percent == -1 ? "display: none;" : ""%>"> </td> |
6445 |
14 Apr 14 |
nicklas |
350 |
<td id="percentUnknown" class="percentUnknown" style="width: 100%; <%=percent != -1 ? "display: none;" : "" %>">unknown</td> |
1619 |
16 Nov 05 |
nicklas |
351 |
</tr> |
1619 |
16 Nov 05 |
nicklas |
352 |
</table> |
1619 |
16 Nov 05 |
nicklas |
353 |
</td> |
6143 |
20 Sep 12 |
nicklas |
354 |
<td id="percentText" class="percentText" |
5909 |
14 Dec 11 |
nicklas |
355 |
style="<%=percent < 0 ? "display: none;" : "" %>"><%=percent%>%</td> |
5909 |
14 Dec 11 |
nicklas |
356 |
<% |
5909 |
14 Dec 11 |
nicklas |
357 |
if (logFile != null) |
5909 |
14 Dec 11 |
nicklas |
358 |
{ |
5909 |
14 Dec 11 |
nicklas |
359 |
%> |
6311 |
23 Aug 13 |
nicklas |
360 |
<td style="padding-left: 10px;"><base:button |
6684 |
14 Jan 15 |
nicklas |
361 |
subclass="auto-init" |
6311 |
23 Aug 13 |
nicklas |
362 |
data-auto-init="view-file" |
6311 |
23 Aug 13 |
nicklas |
363 |
data-file-id="<%=logFile.getId()%>" |
6311 |
23 Aug 13 |
nicklas |
364 |
image="view.png" |
4424 |
28 Aug 08 |
nicklas |
365 |
title="View log…" |
4424 |
28 Aug 08 |
nicklas |
366 |
tooltip="View the log file with detailed information about this job" |
4424 |
28 Aug 08 |
nicklas |
367 |
/></td> |
4424 |
28 Aug 08 |
nicklas |
368 |
<% |
4424 |
28 Aug 08 |
nicklas |
369 |
} |
4424 |
28 Aug 08 |
nicklas |
370 |
%> |
1619 |
16 Nov 05 |
nicklas |
371 |
</tr> |
1619 |
16 Nov 05 |
nicklas |
372 |
</table> |
1619 |
16 Nov 05 |
nicklas |
373 |
</td> |
1619 |
16 Nov 05 |
nicklas |
374 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
375 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
376 |
<th>Description</th> |
5909 |
14 Dec 11 |
nicklas |
377 |
<td><%=HTML.niceFormat(job.getDescription())%></td> |
5909 |
14 Dec 11 |
nicklas |
378 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
379 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
380 |
<th>Created</th> |
1619 |
16 Nov 05 |
nicklas |
381 |
<td> |
2942 |
22 Nov 06 |
nicklas |
382 |
<%=dateTimeFormatter.format(job.getCreated())%> |
1619 |
16 Nov 05 |
nicklas |
383 |
</td> |
1619 |
16 Nov 05 |
nicklas |
384 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
385 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
386 |
<th class="subprompt">- scheduled</th> |
5406 |
13 Sep 10 |
nicklas |
387 |
<td> |
5406 |
13 Sep 10 |
nicklas |
388 |
<%=dateTimeFormatter.format(job.getScheduled())%> |
5406 |
13 Sep 10 |
nicklas |
389 |
</td> |
5406 |
13 Sep 10 |
nicklas |
390 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
391 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
392 |
<th class="subprompt">- priority</th> |
1619 |
16 Nov 05 |
nicklas |
393 |
<td> |
5909 |
14 Dec 11 |
nicklas |
394 |
<%=job.getPriority()%> (1 = highest, 10 = lowest) |
1619 |
16 Nov 05 |
nicklas |
395 |
</td> |
1619 |
16 Nov 05 |
nicklas |
396 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
397 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
398 |
<th>Running time</th> |
5402 |
06 Sep 10 |
nicklas |
399 |
<td id="runningTime"> |
3880 |
26 Oct 07 |
nicklas |
400 |
<% |
3880 |
26 Oct 07 |
nicklas |
401 |
Date started = job.getStarted(); |
3880 |
26 Oct 07 |
nicklas |
402 |
if (started != null) |
3880 |
26 Oct 07 |
nicklas |
403 |
{ |
3880 |
26 Oct 07 |
nicklas |
404 |
Date ended = job.getEnded(); |
3880 |
26 Oct 07 |
nicklas |
405 |
if (ended == null) ended = new Date(); |
3880 |
26 Oct 07 |
nicklas |
406 |
long runningTime = ended.getTime() - started.getTime(); |
3880 |
26 Oct 07 |
nicklas |
407 |
%> |
3880 |
26 Oct 07 |
nicklas |
408 |
<%=Values.formatTime(runningTime / 1000)%> |
3880 |
26 Oct 07 |
nicklas |
409 |
<% |
3880 |
26 Oct 07 |
nicklas |
410 |
} |
3880 |
26 Oct 07 |
nicklas |
411 |
%> |
3880 |
26 Oct 07 |
nicklas |
412 |
</td> |
3880 |
26 Oct 07 |
nicklas |
413 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
414 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
415 |
<th class="subprompt">- started</th> |
1636 |
18 Nov 05 |
nicklas |
416 |
<td> |
5909 |
14 Dec 11 |
nicklas |
417 |
<%=dateTimeFormatter.format(job.getStarted())%> |
5909 |
14 Dec 11 |
nicklas |
418 |
</td> |
5909 |
14 Dec 11 |
nicklas |
419 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
420 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
421 |
<th class="subprompt">- ended</th> |
5909 |
14 Dec 11 |
nicklas |
422 |
<td> |
5909 |
14 Dec 11 |
nicklas |
423 |
<%=dateTimeFormatter.format(job.getEnded())%> |
5909 |
14 Dec 11 |
nicklas |
424 |
</td> |
5909 |
14 Dec 11 |
nicklas |
425 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
426 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
427 |
<th>Server</th> |
5909 |
14 Dec 11 |
nicklas |
428 |
<td> |
7265 |
14 Dec 16 |
nicklas |
429 |
<%=HTML.encodeTags(job.getServerAndNode())%> |
1636 |
18 Nov 05 |
nicklas |
430 |
</td> |
1636 |
18 Nov 05 |
nicklas |
431 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
432 |
<tr> |
6439 |
31 Mar 14 |
nicklas |
433 |
<th>External ID</th> |
6439 |
31 Mar 14 |
nicklas |
434 |
<td> |
6439 |
31 Mar 14 |
nicklas |
435 |
<%=HTML.encodeTags(job.getExternalId())%> |
6439 |
31 Mar 14 |
nicklas |
436 |
</td> |
6439 |
31 Mar 14 |
nicklas |
437 |
</tr> |
6439 |
31 Mar 14 |
nicklas |
438 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
439 |
<th>Job agent</th> |
4311 |
23 May 08 |
nicklas |
440 |
<td><%=Base.getEncodedName(agent, !readAgent)%></td> |
4311 |
23 May 08 |
nicklas |
441 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
442 |
<tr class="dynamic"> |
5909 |
14 Dec 11 |
nicklas |
443 |
<th></th> |
5909 |
14 Dec 11 |
nicklas |
444 |
<td></td> |
5909 |
14 Dec 11 |
nicklas |
445 |
</tr> |
1619 |
16 Nov 05 |
nicklas |
446 |
</table> |
1881 |
01 Feb 06 |
nicklas |
447 |
</t:tab> |
2643 |
15 Sep 06 |
nicklas |
448 |
<% |
2643 |
15 Sep 06 |
nicklas |
449 |
if (job.getStackTrace() != null) |
2643 |
15 Sep 06 |
nicklas |
450 |
{ |
2643 |
15 Sep 06 |
nicklas |
451 |
%> |
2643 |
15 Sep 06 |
nicklas |
452 |
<t:tab id="stacktrace" title="Stack trace" helpid="job.view.stacktrace"> |
6378 |
12 Dec 13 |
nicklas |
453 |
<div class="stacktrace" style="padding: 0.5em;"><%=HTML.encodeTags(job.getStackTrace().replaceAll("\t", " "))%></div> |
2643 |
15 Sep 06 |
nicklas |
454 |
</t:tab> |
2643 |
15 Sep 06 |
nicklas |
455 |
<% |
2643 |
15 Sep 06 |
nicklas |
456 |
} |
2643 |
15 Sep 06 |
nicklas |
457 |
%> |
2425 |
26 Jun 06 |
nicklas |
458 |
<t:tab id="parameters" title="Parameters" helpid="job.view.parameters"> |
5909 |
14 Dec 11 |
nicklas |
459 |
<table class="fullform outlined"> |
5924 |
13 Jan 12 |
nicklas |
460 |
<tbody class="sectionheader"> |
5914 |
16 Dec 11 |
nicklas |
461 |
<tr> |
5914 |
16 Dec 11 |
nicklas |
462 |
<th colspan="2">Job parameters</th> |
5914 |
16 Dec 11 |
nicklas |
463 |
</tr> |
5914 |
16 Dec 11 |
nicklas |
464 |
</tbody> |
5909 |
14 Dec 11 |
nicklas |
465 |
<tbody> |
1881 |
01 Feb 06 |
nicklas |
466 |
<% |
4424 |
28 Aug 08 |
nicklas |
467 |
List<String> names = new java.util.ArrayList<String>(jobParameters); |
2348 |
01 Jun 06 |
nicklas |
468 |
Collections.sort(names); |
2348 |
01 Jun 06 |
nicklas |
469 |
for (String name : names) |
1796 |
20 Jan 06 |
nicklas |
470 |
{ |
2216 |
05 May 06 |
nicklas |
471 |
StringBuilder sb = new StringBuilder(); |
1881 |
01 Feb 06 |
nicklas |
472 |
String displayValue = ""; |
2348 |
01 Jun 06 |
nicklas |
473 |
String description = ""; |
1881 |
01 Feb 06 |
nicklas |
474 |
try |
1881 |
01 Feb 06 |
nicklas |
475 |
{ |
2348 |
01 Jun 06 |
nicklas |
476 |
ParameterInfo pi = job.getParameterInfo(name); |
2348 |
01 Jun 06 |
nicklas |
477 |
if (pi.getLabel() != null) name = HTML.encodeTags(pi.getLabel()); |
2348 |
01 Jun 06 |
nicklas |
478 |
description = HTML.encodeTags(pi.getDescription()); |
6988 |
30 Oct 15 |
nicklas |
479 |
List<?> values = pi.getValuesOrMask(); |
2216 |
05 May 06 |
nicklas |
480 |
int i = 0; |
2216 |
05 May 06 |
nicklas |
481 |
for (Object value : values) |
2216 |
05 May 06 |
nicklas |
482 |
{ |
2216 |
05 May 06 |
nicklas |
483 |
if (value != null) |
2216 |
05 May 06 |
nicklas |
484 |
{ |
2216 |
05 May 06 |
nicklas |
485 |
if (i > 0) sb.append(", "); |
2216 |
05 May 06 |
nicklas |
486 |
i++; |
2216 |
05 May 06 |
nicklas |
487 |
if (value instanceof BasicItem) |
2216 |
05 May 06 |
nicklas |
488 |
{ |
5073 |
21 Aug 09 |
nicklas |
489 |
sb.append(HTML.encodeTags(getItemName((BasicItem)value))); |
2216 |
05 May 06 |
nicklas |
490 |
} |
2216 |
05 May 06 |
nicklas |
491 |
else if (value instanceof Date) |
2216 |
05 May 06 |
nicklas |
492 |
{ |
2942 |
22 Nov 06 |
nicklas |
493 |
sb.append(dateFormatter.format((Date)value)); |
2216 |
05 May 06 |
nicklas |
494 |
} |
2216 |
05 May 06 |
nicklas |
495 |
else |
2216 |
05 May 06 |
nicklas |
496 |
{ |
2216 |
05 May 06 |
nicklas |
497 |
sb.append(HTML.encodeTags(value.toString())); |
2216 |
05 May 06 |
nicklas |
498 |
} |
2216 |
05 May 06 |
nicklas |
499 |
} |
2216 |
05 May 06 |
nicklas |
500 |
} |
2216 |
05 May 06 |
nicklas |
501 |
displayValue = sb.toString(); |
1881 |
01 Feb 06 |
nicklas |
502 |
} |
1881 |
01 Feb 06 |
nicklas |
503 |
catch (Throwable ex) |
1881 |
01 Feb 06 |
nicklas |
504 |
{ |
2216 |
05 May 06 |
nicklas |
505 |
displayValue = "<i>ERROR: "+ex.getMessage()+"</i>"; |
1881 |
01 Feb 06 |
nicklas |
506 |
} |
1881 |
01 Feb 06 |
nicklas |
507 |
%> |
1881 |
01 Feb 06 |
nicklas |
508 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
509 |
<th><span title="<%=description%>"><%=name%></span></th> |
1881 |
01 Feb 06 |
nicklas |
510 |
<td> |
1881 |
01 Feb 06 |
nicklas |
511 |
<%=displayValue%> |
1881 |
01 Feb 06 |
nicklas |
512 |
</td> |
1881 |
01 Feb 06 |
nicklas |
513 |
</tr> |
1881 |
01 Feb 06 |
nicklas |
514 |
<% |
1796 |
20 Jan 06 |
nicklas |
515 |
} |
1619 |
16 Nov 05 |
nicklas |
516 |
%> |
2709 |
05 Oct 06 |
nicklas |
517 |
<% |
2709 |
05 Oct 06 |
nicklas |
518 |
if (!readCurrentConfig) |
2709 |
05 Oct 06 |
nicklas |
519 |
{ |
2709 |
05 Oct 06 |
nicklas |
520 |
%> |
5909 |
14 Dec 11 |
nicklas |
521 |
</tbody> |
5924 |
13 Jan 12 |
nicklas |
522 |
<tbody class="sectionheader"> |
5914 |
16 Dec 11 |
nicklas |
523 |
<tr> |
5914 |
16 Dec 11 |
nicklas |
524 |
<th colspan="2">Plugin configuration parameters</th> |
5914 |
16 Dec 11 |
nicklas |
525 |
</tr> |
5914 |
16 Dec 11 |
nicklas |
526 |
</tbody> |
5909 |
14 Dec 11 |
nicklas |
527 |
<tbody> |
5909 |
14 Dec 11 |
nicklas |
528 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
529 |
<th></th> |
5909 |
14 Dec 11 |
nicklas |
530 |
<td><i>- denied -</i></td> |
5909 |
14 Dec 11 |
nicklas |
531 |
</tr> |
2709 |
05 Oct 06 |
nicklas |
532 |
<% |
2709 |
05 Oct 06 |
nicklas |
533 |
} |
2709 |
05 Oct 06 |
nicklas |
534 |
else if (currentConfig != null) |
2709 |
05 Oct 06 |
nicklas |
535 |
{ |
2709 |
05 Oct 06 |
nicklas |
536 |
%> |
5909 |
14 Dec 11 |
nicklas |
537 |
</tbody> |
5924 |
13 Jan 12 |
nicklas |
538 |
<tbody class="sectionheader"> |
5914 |
16 Dec 11 |
nicklas |
539 |
<tr> |
5914 |
16 Dec 11 |
nicklas |
540 |
<th colspan="2">Plugin configuration parameters</th> |
5914 |
16 Dec 11 |
nicklas |
541 |
</tr> |
5914 |
16 Dec 11 |
nicklas |
542 |
</tbody> |
5909 |
14 Dec 11 |
nicklas |
543 |
<tbody> |
2709 |
05 Oct 06 |
nicklas |
544 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
545 |
<th><span |
2709 |
05 Oct 06 |
nicklas |
546 |
title="The version of the parmeters used for this job, current version in paranthesis">Parameter version</span></td> |
5909 |
14 Dec 11 |
nicklas |
547 |
<td><%=parameterVersion%> (<%=latestParameterVersion %>)</th> |
2709 |
05 Oct 06 |
nicklas |
548 |
</tr> |
2709 |
05 Oct 06 |
nicklas |
549 |
<% |
2709 |
05 Oct 06 |
nicklas |
550 |
names = new java.util.ArrayList<String>(currentConfig.getParameterNames(parameterVersion)); |
2709 |
05 Oct 06 |
nicklas |
551 |
Collections.sort(names); |
2709 |
05 Oct 06 |
nicklas |
552 |
for (String name : names) |
2709 |
05 Oct 06 |
nicklas |
553 |
{ |
2709 |
05 Oct 06 |
nicklas |
554 |
StringBuilder sb = new StringBuilder(); |
2709 |
05 Oct 06 |
nicklas |
555 |
String displayValue = ""; |
2709 |
05 Oct 06 |
nicklas |
556 |
String description = ""; |
2709 |
05 Oct 06 |
nicklas |
557 |
try |
2709 |
05 Oct 06 |
nicklas |
558 |
{ |
2709 |
05 Oct 06 |
nicklas |
559 |
ParameterInfo pi = currentConfig.getParameterInfo(name, parameterVersion); |
2709 |
05 Oct 06 |
nicklas |
560 |
if (pi.getLabel() != null) name = HTML.encodeTags(pi.getLabel()); |
2709 |
05 Oct 06 |
nicklas |
561 |
description = HTML.encodeTags(pi.getDescription()); |
6988 |
30 Oct 15 |
nicklas |
562 |
List<?> values = pi.getValuesOrMask(); |
2709 |
05 Oct 06 |
nicklas |
563 |
int i = 0; |
2709 |
05 Oct 06 |
nicklas |
564 |
for (Object value : values) |
2709 |
05 Oct 06 |
nicklas |
565 |
{ |
2709 |
05 Oct 06 |
nicklas |
566 |
if (value != null) |
2709 |
05 Oct 06 |
nicklas |
567 |
{ |
2709 |
05 Oct 06 |
nicklas |
568 |
if (i > 0) sb.append(", "); |
2709 |
05 Oct 06 |
nicklas |
569 |
i++; |
2709 |
05 Oct 06 |
nicklas |
570 |
if (value instanceof BasicItem) |
2709 |
05 Oct 06 |
nicklas |
571 |
{ |
5073 |
21 Aug 09 |
nicklas |
572 |
sb.append(HTML.encodeTags(getItemName((BasicItem)value))); |
2709 |
05 Oct 06 |
nicklas |
573 |
} |
2709 |
05 Oct 06 |
nicklas |
574 |
else if (value instanceof Date) |
2709 |
05 Oct 06 |
nicklas |
575 |
{ |
2942 |
22 Nov 06 |
nicklas |
576 |
sb.append(dateFormatter.format((Date)value)); |
2709 |
05 Oct 06 |
nicklas |
577 |
} |
2709 |
05 Oct 06 |
nicklas |
578 |
else |
2709 |
05 Oct 06 |
nicklas |
579 |
{ |
2709 |
05 Oct 06 |
nicklas |
580 |
sb.append(HTML.encodeTags(value.toString())); |
2709 |
05 Oct 06 |
nicklas |
581 |
} |
2709 |
05 Oct 06 |
nicklas |
582 |
} |
2709 |
05 Oct 06 |
nicklas |
583 |
} |
2709 |
05 Oct 06 |
nicklas |
584 |
displayValue = sb.toString(); |
2709 |
05 Oct 06 |
nicklas |
585 |
} |
2709 |
05 Oct 06 |
nicklas |
586 |
catch (Throwable ex) |
2709 |
05 Oct 06 |
nicklas |
587 |
{ |
2709 |
05 Oct 06 |
nicklas |
588 |
displayValue = "<i>ERROR: "+ex.getMessage()+"</i>"; |
2709 |
05 Oct 06 |
nicklas |
589 |
} |
2709 |
05 Oct 06 |
nicklas |
590 |
%> |
2709 |
05 Oct 06 |
nicklas |
591 |
<tr> |
5909 |
14 Dec 11 |
nicklas |
592 |
<th><span title="<%=description%>"><%=name%></span></th> |
2709 |
05 Oct 06 |
nicklas |
593 |
<td> |
2709 |
05 Oct 06 |
nicklas |
594 |
<%=displayValue%> |
2709 |
05 Oct 06 |
nicklas |
595 |
</td> |
2709 |
05 Oct 06 |
nicklas |
596 |
</tr> |
2709 |
05 Oct 06 |
nicklas |
597 |
<% |
2709 |
05 Oct 06 |
nicklas |
598 |
} |
2709 |
05 Oct 06 |
nicklas |
599 |
%> |
2709 |
05 Oct 06 |
nicklas |
600 |
<% |
2709 |
05 Oct 06 |
nicklas |
601 |
} |
2709 |
05 Oct 06 |
nicklas |
602 |
%> |
5909 |
14 Dec 11 |
nicklas |
603 |
<tr class="dynamic"> |
5909 |
14 Dec 11 |
nicklas |
604 |
<th></th> |
5909 |
14 Dec 11 |
nicklas |
605 |
<td></td> |
5909 |
14 Dec 11 |
nicklas |
606 |
</tr> |
5909 |
14 Dec 11 |
nicklas |
607 |
</tbody> |
5909 |
14 Dec 11 |
nicklas |
608 |
</table> |
1881 |
01 Feb 06 |
nicklas |
609 |
</t:tab> |
5073 |
21 Aug 09 |
nicklas |
610 |
|
5073 |
21 Aug 09 |
nicklas |
611 |
<t:tab id="changes" title="Changed items" |
5073 |
21 Aug 09 |
nicklas |
612 |
tooltip="Display a log of all modifications made by this job" |
5073 |
21 Aug 09 |
nicklas |
613 |
visible="<%=!autoUpdate && ChangeHistoryUtil.showChangeHistoryTab(sc) %>"> |
5073 |
21 Aug 09 |
nicklas |
614 |
<% |
5073 |
21 Aug 09 |
nicklas |
615 |
ItemQuery<ChangeHistory> query = ChangeHistory.getChangesBy(job); |
5073 |
21 Aug 09 |
nicklas |
616 |
query.order(Orders.asc(Hql.property("id"))); |
7117 |
14 Apr 16 |
nicklas |
617 |
query.setMaxResults(1000); |
7117 |
14 Apr 16 |
nicklas |
618 |
query.setReturnTotalCount(true); |
5073 |
21 Aug 09 |
nicklas |
619 |
ItemResultIterator<ChangeHistory> changes = query.iterate(dc); |
7117 |
14 Apr 16 |
nicklas |
620 |
long numChanges = changes.getTotalCount(); |
5073 |
21 Aug 09 |
nicklas |
621 |
%> |
5952 |
10 Feb 12 |
nicklas |
622 |
<tbl:table |
5952 |
10 Feb 12 |
nicklas |
623 |
id="history" columns="all" |
7943 |
04 May 21 |
nicklas |
624 |
subclass="fulltable" stickyheaders="<%=null%>" style="border-bottom: 0px;"> |
5073 |
21 Aug 09 |
nicklas |
625 |
<tbl:columndef id="changeType" title="Change type" /> |
5073 |
21 Aug 09 |
nicklas |
626 |
<tbl:columndef id="item" title="Item" /> |
5073 |
21 Aug 09 |
nicklas |
627 |
<tbl:columndef id="info" title="Info" /> |
5073 |
21 Aug 09 |
nicklas |
628 |
|
5952 |
10 Feb 12 |
nicklas |
629 |
<tbl:data style="top: 0px;"> |
5929 |
18 Jan 12 |
nicklas |
630 |
<tbl:headers> |
5929 |
18 Jan 12 |
nicklas |
631 |
<tbl:headerrow> |
5929 |
18 Jan 12 |
nicklas |
632 |
<tbl:columnheaders /> |
5929 |
18 Jan 12 |
nicklas |
633 |
</tbl:headerrow> |
5929 |
18 Jan 12 |
nicklas |
634 |
</tbl:headers> |
5073 |
21 Aug 09 |
nicklas |
635 |
<tbl:rows> |
5073 |
21 Aug 09 |
nicklas |
636 |
<% |
7117 |
14 Apr 16 |
nicklas |
637 |
if (numChanges > 1000) |
7117 |
14 Apr 16 |
nicklas |
638 |
{ |
7117 |
14 Apr 16 |
nicklas |
639 |
%> |
7117 |
14 Apr 16 |
nicklas |
640 |
<tbl:panel subclass="bg-filled-100"> |
7117 |
14 Apr 16 |
nicklas |
641 |
<b>NOTE! Listing 1000 of <span title="<%=numChanges %>"><%=Values.formatNumber(numChanges / 1000f, 1, "k") %></span> total changes.</b> |
7117 |
14 Apr 16 |
nicklas |
642 |
</tbl:panel> |
7117 |
14 Apr 16 |
nicklas |
643 |
<% |
7117 |
14 Apr 16 |
nicklas |
644 |
} |
5073 |
21 Aug 09 |
nicklas |
645 |
while (changes.hasNext()) |
5073 |
21 Aug 09 |
nicklas |
646 |
{ |
5073 |
21 Aug 09 |
nicklas |
647 |
ChangeHistory change = changes.next(); |
5073 |
21 Aug 09 |
nicklas |
648 |
%> |
5073 |
21 Aug 09 |
nicklas |
649 |
<tbl:row> |
6520 |
18 Aug 14 |
nicklas |
650 |
<tbl:cell column="changeType"><%=change.getChangeType()%></tbl:cell> |
5073 |
21 Aug 09 |
nicklas |
651 |
<tbl:cell column="item"><%=ChangeHistoryUtil.getItem(dc, change, false, false)%></tbl:cell> |
5073 |
21 Aug 09 |
nicklas |
652 |
<tbl:cell column="info"><%=HTML.encodeTags(change.getChangeInfo())%></tbl:cell> |
5073 |
21 Aug 09 |
nicklas |
653 |
</tbl:row> |
5073 |
21 Aug 09 |
nicklas |
654 |
<% |
5073 |
21 Aug 09 |
nicklas |
655 |
} |
5952 |
10 Feb 12 |
nicklas |
656 |
if (numChanges == 0) |
5952 |
10 Feb 12 |
nicklas |
657 |
{ |
5952 |
10 Feb 12 |
nicklas |
658 |
%> |
6604 |
18 Nov 14 |
nicklas |
659 |
<tbl:panel subclass="bg-filled-50"> |
5952 |
10 Feb 12 |
nicklas |
660 |
<div class="messagecontainer note"> |
5952 |
10 Feb 12 |
nicklas |
661 |
No log entries found for this job. NOTE! This job may have made |
5952 |
10 Feb 12 |
nicklas |
662 |
other changes that are not recorded by the logging mechanism. |
5952 |
10 Feb 12 |
nicklas |
663 |
</div> |
5952 |
10 Feb 12 |
nicklas |
664 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
665 |
<% |
5952 |
10 Feb 12 |
nicklas |
666 |
} |
5073 |
21 Aug 09 |
nicklas |
667 |
%> |
5073 |
21 Aug 09 |
nicklas |
668 |
</tbl:rows> |
5073 |
21 Aug 09 |
nicklas |
669 |
</tbl:data> |
5073 |
21 Aug 09 |
nicklas |
670 |
</tbl:table> |
5073 |
21 Aug 09 |
nicklas |
671 |
</t:tab> |
1881 |
01 Feb 06 |
nicklas |
672 |
</t:tabcontrol> |
2648 |
19 Sep 06 |
nicklas |
673 |
|
5909 |
14 Dec 11 |
nicklas |
674 |
<base:buttongroup subclass="dialogbuttons"> |
1634 |
18 Nov 05 |
nicklas |
675 |
<% |
7320 |
05 Apr 17 |
nicklas |
676 |
if (supportsPause) |
7320 |
05 Apr 17 |
nicklas |
677 |
{ |
7320 |
05 Apr 17 |
nicklas |
678 |
%> |
7326 |
06 Apr 17 |
nicklas |
679 |
<base:button id="btnPause" title="Pause" image="pause.png" tooltip="Pause the job" /> |
7320 |
05 Apr 17 |
nicklas |
680 |
<% |
7320 |
05 Apr 17 |
nicklas |
681 |
} |
4093 |
18 Jan 08 |
enell |
682 |
if (supportsAbort) |
4093 |
18 Jan 08 |
enell |
683 |
{ |
4093 |
18 Jan 08 |
enell |
684 |
%> |
6880 |
21 Apr 15 |
nicklas |
685 |
<base:button id="btnAbort" title="Abort…" image="abort.png" tooltip="Abort the job" /> |
4093 |
18 Jan 08 |
enell |
686 |
<% |
4093 |
18 Jan 08 |
enell |
687 |
} |
6880 |
21 Apr 15 |
nicklas |
688 |
else if (supportsForceError) |
6880 |
21 Apr 15 |
nicklas |
689 |
{ |
6880 |
21 Apr 15 |
nicklas |
690 |
%> |
6880 |
21 Apr 15 |
nicklas |
691 |
<base:button id="btnForceError" title="Force error…" image="bug.png" tooltip="Force update the job status to ERROR" /> |
6880 |
21 Apr 15 |
nicklas |
692 |
<% |
6880 |
21 Apr 15 |
nicklas |
693 |
} |
4093 |
18 Jan 08 |
enell |
694 |
%> |
4093 |
18 Jan 08 |
enell |
695 |
<% |
7320 |
05 Apr 17 |
nicklas |
696 |
if ((status == Job.Status.PAUSED || status == Job.Status.ERROR) && job.getJobType() == Job.Type.RUN_PLUGIN) |
2185 |
25 Apr 06 |
nicklas |
697 |
{ |
5404 |
10 Sep 10 |
martin |
698 |
boolean restartable = !job.getPluginDefinition().supports("net.sf.basedb.core.plugin.NonRestartable"); |
5404 |
10 Sep 10 |
martin |
699 |
if (restartable) |
5404 |
10 Sep 10 |
martin |
700 |
{ |
5404 |
10 Sep 10 |
martin |
701 |
%> |
6311 |
23 Aug 13 |
nicklas |
702 |
<base:button |
6311 |
23 Aug 13 |
nicklas |
703 |
id="btnRestartJob" |
6311 |
23 Aug 13 |
nicklas |
704 |
title="Restart job" |
5946 |
03 Feb 12 |
nicklas |
705 |
image="refresh.png" |
5404 |
10 Sep 10 |
martin |
706 |
tooltip="Try to run this job again with the same parameters" |
5404 |
10 Sep 10 |
martin |
707 |
/> |
6311 |
23 Aug 13 |
nicklas |
708 |
<base:button |
6311 |
23 Aug 13 |
nicklas |
709 |
id="btnReconfigureJob" |
6311 |
23 Aug 13 |
nicklas |
710 |
title="Re-configure job" |
5945 |
02 Feb 12 |
nicklas |
711 |
image="runplugin.png" |
5404 |
10 Sep 10 |
martin |
712 |
tooltip="Change the parameters for this job and try again" |
5404 |
10 Sep 10 |
martin |
713 |
visible="<%=job.hasContext()%>" |
5404 |
10 Sep 10 |
martin |
714 |
/> |
5404 |
10 Sep 10 |
martin |
715 |
<% |
5404 |
10 Sep 10 |
martin |
716 |
} |
2185 |
25 Apr 06 |
nicklas |
717 |
} |
7320 |
05 Apr 17 |
nicklas |
718 |
if (status == Job.Status.DONE && job.isDryRun()) |
4380 |
06 Aug 08 |
nicklas |
719 |
{ |
4380 |
06 Aug 08 |
nicklas |
720 |
%> |
6311 |
23 Aug 13 |
nicklas |
721 |
<base:button |
6311 |
23 Aug 13 |
nicklas |
722 |
id="btnRestartJob" |
6311 |
23 Aug 13 |
nicklas |
723 |
data-clear-dry-run="1" |
6311 |
23 Aug 13 |
nicklas |
724 |
title="Really run" |
5946 |
03 Feb 12 |
nicklas |
725 |
image="refresh.png" |
4380 |
06 Aug 08 |
nicklas |
726 |
tooltip="Run this dry-run job for real" |
4380 |
06 Aug 08 |
nicklas |
727 |
/> |
7747 |
16 Sep 19 |
nicklas |
728 |
<base:button |
7747 |
16 Sep 19 |
nicklas |
729 |
id="btnReconfigureJob" |
7747 |
16 Sep 19 |
nicklas |
730 |
title="Re-configure job" |
7747 |
16 Sep 19 |
nicklas |
731 |
image="runplugin.png" |
7747 |
16 Sep 19 |
nicklas |
732 |
tooltip="Change the parameters for this job and try again" |
7747 |
16 Sep 19 |
nicklas |
733 |
visible="<%=job.hasContext()%>" |
7747 |
16 Sep 19 |
nicklas |
734 |
/> |
4380 |
06 Aug 08 |
nicklas |
735 |
<% |
4380 |
06 Aug 08 |
nicklas |
736 |
} |
2185 |
25 Apr 06 |
nicklas |
737 |
%> |
6311 |
23 Aug 13 |
nicklas |
738 |
<base:button id="close" title="Close" /> |
1634 |
18 Nov 05 |
nicklas |
739 |
</base:buttongroup> |
1619 |
16 Nov 05 |
nicklas |
740 |
</base:body> |
1619 |
16 Nov 05 |
nicklas |
741 |
</base:page> |
1619 |
16 Nov 05 |
nicklas |
742 |
<% |
1619 |
16 Nov 05 |
nicklas |
743 |
} |
1619 |
16 Nov 05 |
nicklas |
744 |
finally |
1619 |
16 Nov 05 |
nicklas |
745 |
{ |
1619 |
16 Nov 05 |
nicklas |
746 |
if (dc != null) dc.close(); |
1619 |
16 Nov 05 |
nicklas |
747 |
} |
1881 |
01 Feb 06 |
nicklas |
748 |
|
1619 |
16 Nov 05 |
nicklas |
749 |
%> |