forked from jenkinsci/analysis-core-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-view.patch
593 lines (565 loc) · 22.8 KB
/
build-view.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
### Eclipse Workspace Patch 1.0
#P analysis-core
Index: src/main/java/hudson/plugins/analysis/views/ErrorDetail.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/ErrorDetail.java (revision 38274)
+++ src/main/java/hudson/plugins/analysis/views/ErrorDetail.java (working copy)
@@ -3,7 +3,6 @@
import java.util.Collection;
import hudson.model.AbstractBuild;
-import hudson.model.ModelObject;
import hudson.plugins.analysis.Messages;
@@ -12,10 +11,7 @@
*
* @author Ulli Hafner
*/
-public class ErrorDetail implements ModelObject {
- /** Current build as owner of this action. */
- private final AbstractBuild<?, ?> owner;
- /** All errors of the project. */
+public class ErrorDetail extends AbstractBuildView implements BuildView {
private final Collection<String> errors;
/**
@@ -27,17 +23,9 @@
* all modules of the project
*/
public ErrorDetail(final AbstractBuild<?, ?> owner, final Collection<String> errors) {
- this.owner = owner;
- this.errors = errors;
- }
+ super(owner);
- /**
- * Returns the build as owner of this action.
- *
- * @return the owner
- */
- public final AbstractBuild<?, ?> getOwner() {
- return owner;
+ this.errors = errors;
}
/** {@inheritDoc} */
Index: src/main/java/hudson/plugins/analysis/views/SourceDetail.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/SourceDetail.java (revision 38274)
+++ src/main/java/hudson/plugins/analysis/views/SourceDetail.java (working copy)
@@ -20,7 +20,6 @@
import de.java2html.options.JavaSourceConversionOptions;
import hudson.model.AbstractBuild;
-import hudson.model.ModelObject;
import hudson.plugins.analysis.util.EncodingValidator;
import hudson.plugins.analysis.util.model.FileAnnotation;
@@ -33,15 +32,13 @@
* @author Ulli Hafner
*/
@SuppressWarnings("PMD.CyclomaticComplexity")
-public class SourceDetail implements ModelObject {
+public class SourceDetail extends AbstractBuildView {
/** Offset of the source code generator. After this line the actual source file lines start. */
protected static final int SOURCE_GENERATOR_OFFSET = 13;
/** Color for the first (primary) annotation range. */
private static final String FIRST_COLOR = "#FCAF3E";
/** Color for all other annotation ranges. */
private static final String OTHER_COLOR = "#FCE94F";
- /** The current build as owner of this object. */
- private final AbstractBuild<?, ?> owner;
/** Stripped file name of this annotation without the path prefix. */
private final String fileName;
/** The annotation to be shown. */
@@ -62,7 +59,7 @@
* the default encoding to be used when reading and parsing files
*/
public SourceDetail(final AbstractBuild<?, ?> owner, final FileAnnotation annotation, final String defaultEncoding) {
- this.owner = owner;
+ super(owner);
this.annotation = annotation;
this.defaultEncoding = defaultEncoding;
fileName = StringUtils.substringAfterLast(annotation.getFileName(), "/");
@@ -77,7 +74,7 @@
private void initializeContent() {
InputStream file = null;
try {
- File tempFile = new File(annotation.getTempName(owner));
+ File tempFile = new File(annotation.getTempName(getOwner()));
if (tempFile.exists()) {
file = new FileInputStream(tempFile);
}
@@ -236,15 +233,6 @@
}
/**
- * Returns the build as owner of this object.
- *
- * @return the build
- */
- public AbstractBuild<?, ?> getOwner() {
- return owner;
- }
-
- /**
* Returns the line that should be highlighted.
*
* @return the line to highlight
Index: src/main/java/hudson/plugins/analysis/views/AbstractBuildView.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/AbstractBuildView.java (revision 0)
+++ src/main/java/hudson/plugins/analysis/views/AbstractBuildView.java (revision 0)
@@ -0,0 +1,55 @@
+package hudson.plugins.analysis.views;
+
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+import com.google.common.collect.Maps;
+
+import hudson.model.AbstractBuild;
+
+/**
+ * Base class for views that are owned by an {@link AbstractBuild}.
+ *
+ * @author Ulli Hafner
+ */
+public abstract class AbstractBuildView implements BuildView {
+ private final AbstractBuild<?, ?> owner;
+ private final Map<String, String> properties = Maps.newHashMap();
+
+ /**
+ * Creates a new instance of {@link AbstractBuildView}.
+ *
+ * @param owner
+ * the build as owner of this view
+ */
+ public AbstractBuildView(final AbstractBuild<?, ?> owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * Returns the build as owner of this view.
+ *
+ * @return the owner
+ */
+ public AbstractBuild<?, ?> getOwner() {
+ return owner;
+ }
+
+ /** {@inheritDoc} */
+ public void addProperty(final String key, final String value) {
+ properties.put(key, value);
+ }
+
+ /** {@inheritDoc} */
+ public String getProperty(final String key) {
+ if (hasProperty(key)) {
+ return properties.get(key);
+ }
+ throw new NoSuchElementException("No such property found: " + key);
+ }
+
+ /** {@inheritDoc} */
+ public boolean hasProperty(final String key) {
+ return properties.containsKey(key);
+ }
+}
Index: src/main/java/hudson/plugins/analysis/views/DetailFactory.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/DetailFactory.java (revision 38314)
+++ src/main/java/hudson/plugins/analysis/views/DetailFactory.java (working copy)
@@ -83,7 +83,7 @@
* @return the dynamic result of this module detail view
*/
// CHECKSTYLE:OFF
- public Object createTrendDetails(final String link, final AbstractBuild<?, ?> owner,
+ public BuildView createTrendDetails(final String link, final AbstractBuild<?, ?> owner,
final AnnotationContainer container, final Collection<FileAnnotation> fixedAnnotations,
final Collection<FileAnnotation> newAnnotations, final Collection<String> errors,
final String defaultEncoding, final String displayName) {
@@ -124,7 +124,7 @@
* the name of the selected object
* @return the dynamic result of this module detail view
*/
- public Object createDetails(final String link, final AbstractBuild<?, ?> owner, final AnnotationContainer container,
+ public BuildView createDetails(final String link, final AbstractBuild<?, ?> owner, final AnnotationContainer container,
final String defaultEncoding, final String displayName) {
PriorityDetailFactory factory = new PriorityDetailFactory(this);
if (factory.isPriority(link)) {
Index: src/main/java/hudson/plugins/analysis/views/AbstractAnnotationsDetail.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/AbstractAnnotationsDetail.java (revision 38274)
+++ src/main/java/hudson/plugins/analysis/views/AbstractAnnotationsDetail.java (working copy)
@@ -1,11 +1,14 @@
package hudson.plugins.analysis.views;
import java.util.Collection;
+import java.util.Map;
+import java.util.NoSuchElementException;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
-import hudson.model.ModelObject;
+import com.google.common.collect.Maps;
+
import hudson.model.AbstractBuild;
import hudson.plugins.analysis.util.model.AnnotationContainer;
@@ -18,14 +21,14 @@
*
* @author Ulli Hafner
*/
-public abstract class AbstractAnnotationsDetail extends AnnotationContainer implements ModelObject {
+public abstract class AbstractAnnotationsDetail extends AnnotationContainer implements BuildView {
/** Unique identifier of this class. */
private static final long serialVersionUID = 1750266351592937774L;
- /** Current build as owner of this object. */
private final AbstractBuild<?, ?> owner;
/** The default encoding to be used when reading and parsing files. */
private final String defaultEncoding;
+ private final Map<String, String> properties = Maps.newHashMap();
/** The factory to create detail objects with. */
private final DetailFactory detailFactory;
@@ -131,4 +134,23 @@
public Priority[] getPriorities() {
return Priority.values();
}
+
+
+ /** {@inheritDoc} */
+ public void addProperty(final String key, final String value) {
+ properties.put(key, value);
+ }
+
+ /** {@inheritDoc} */
+ public String getProperty(final String key) {
+ if (hasProperty(key)) {
+ return properties.get(key);
+ }
+ throw new NoSuchElementException("No such property found: " + key);
+ }
+
+ /** {@inheritDoc} */
+ public boolean hasProperty(final String key) {
+ return properties.containsKey(key);
+ }
}
Index: src/main/java/hudson/plugins/analysis/views/BuildView.java
===================================================================
--- src/main/java/hudson/plugins/analysis/views/BuildView.java (revision 0)
+++ src/main/java/hudson/plugins/analysis/views/BuildView.java (revision 0)
@@ -0,0 +1,56 @@
+package hudson.plugins.analysis.views;
+
+import com.gargoylesoftware.htmlunit.ElementNotFoundException;
+
+import hudson.model.ModelObject;
+import hudson.model.AbstractBuild;
+
+/**
+ * A build view is owned by a project and has generic properties.
+ *
+ * @author Ulli Hafner
+ */
+public interface BuildView extends ModelObject {
+ /**
+ * Returns the build as owner of this view.
+ *
+ * @return the owner
+ */
+ AbstractBuild<?, ?> getOwner();
+
+ /**
+ * Adds the property with the specified key to this view.
+ *
+ * @param key
+ * the property key
+ * @param value
+ * the value of the property
+ */
+ void addProperty(String key, String value);
+
+ /**
+ * Searches for the property with the specified key in this view. If the key
+ * is not found in this property list, an {@link ElementNotFoundException}
+ * is thrown.
+ *
+ * @param key
+ * the property key
+ * @return the value with the specified key value
+ * @throws ElementNotFoundException
+ * if there is no property with the specified key value
+ * @see #hasProperty(String)
+ */
+ String getProperty(String key);
+
+ /**
+ * Returns whether a property with the specified key is defined for this
+ * view.
+ *
+ * @param key
+ * the property key
+ * @return <code>true</code> if a property with the specified key in defined
+ * for this view, <code>false</code> otherwise
+ */
+ boolean hasProperty(String key);
+}
+
Index: src/main/java/hudson/plugins/analysis/core/BuildResult.java
===================================================================
--- src/main/java/hudson/plugins/analysis/core/BuildResult.java (revision 38274)
+++ src/main/java/hudson/plugins/analysis/core/BuildResult.java (working copy)
@@ -38,6 +38,7 @@
import hudson.plugins.analysis.util.model.JavaProject;
import hudson.plugins.analysis.util.model.MavenModule;
import hudson.plugins.analysis.util.model.Priority;
+import hudson.plugins.analysis.views.BuildView;
import hudson.plugins.analysis.views.DetailFactory;
/**
@@ -890,7 +891,7 @@
* Stapler response
* @return the dynamic result of the analysis (detail page).
*/
- public Object getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
+ public BuildView getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
return DetailFactory.create(getResultActionType()).createTrendDetails(link, getOwner(), getContainer(), getFixedWarnings(),
getNewWarnings(), getErrors(), getDefaultEncoding(), getDisplayName());
}
#P dry
Index: src/main/java/hudson/plugins/dry/DryDetailBuilder.java
===================================================================
--- src/main/java/hudson/plugins/dry/DryDetailBuilder.java (revision 38274)
+++ src/main/java/hudson/plugins/dry/DryDetailBuilder.java (working copy)
@@ -3,6 +3,7 @@
import hudson.model.AbstractBuild;
import hudson.plugins.analysis.util.model.AnnotationContainer;
import hudson.plugins.analysis.util.model.FileAnnotation;
+import hudson.plugins.analysis.views.BuildView;
import hudson.plugins.analysis.views.DetailFactory;
import hudson.plugins.analysis.views.SourceDetail;
import hudson.plugins.analysis.views.TabDetail;
@@ -20,7 +21,7 @@
public class DryDetailBuilder extends DetailFactory {
/** {@inheritDoc} */
@Override
- public Object createDetails(final String link, final AbstractBuild<?, ?> owner,
+ public BuildView createDetails(final String link, final AbstractBuild<?, ?> owner,
final AnnotationContainer container, final String defaultEncoding, final String displayName) {
if (link.startsWith("link.")) {
String suffix = StringUtils.substringAfter(link, "link.");
@@ -48,7 +49,7 @@
* to ID
* @return the detail view or <code>null</code>
*/
- private Object createDrySourceDetail(final AbstractBuild<?, ?> owner,
+ private BuildView createDrySourceDetail(final AbstractBuild<?, ?> owner,
final AnnotationContainer container, final String defaultEncoding,
final String fromString, final String toString) {
long from = Long.parseLong(fromString);
#P tasks
Index: src/main/resources/tasks/priorities-summary_de.properties
===================================================================
--- src/main/resources/tasks/priorities-summary_de.properties (revision 0)
+++ src/main/resources/tasks/priorities-summary_de.properties (revision 0)
@@ -0,0 +1,2 @@
+Total=Gesamt
+Summary=Zusammenfassung
Index: src/main/resources/tasks/priorities-summary.jelly
===================================================================
--- src/main/resources/tasks/priorities-summary.jelly (revision 0)
+++ src/main/resources/tasks/priorities-summary.jelly (revision 0)
@@ -0,0 +1,31 @@
+<!--
+ Section header
+-->
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
+ xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
+
+ <h2>${%Summary}</h2>
+ <table class="pane" id="tasks.summary">
+ <tr>
+ <td class="pane-header">${%Total}</td>
+ <j:forEach var="priority" items="${it.priorities}">
+ <td class="pane-header">${priority.longLocalizedString} (${it.tags(priority)})</td>
+ </j:forEach>
+ </tr>
+ <tbody>
+ <tr>
+ <td class="pane">${it.numberOfAnnotations}</td>
+ <j:forEach var="priority" items="${it.priorities}">
+ <td class="pane">
+ <j:if test="${it.getNumberOfAnnotations(priority) == 0}">
+ 0
+ </j:if>
+ <j:if test="${it.getNumberOfAnnotations(priority) != 0}">
+ <a href="${priority}">${it.getNumberOfAnnotations(priority)}</a>
+ </j:if>
+ </td>
+ </j:forEach>
+ </tr>
+ </tbody>
+ </table>
+</j:jelly>
\ No newline at end of file
Index: src/main/resources/tasks/priorities-summary_nl.properties
===================================================================
--- src/main/resources/tasks/priorities-summary_nl.properties (revision 0)
+++ src/main/resources/tasks/priorities-summary_nl.properties (revision 0)
@@ -0,0 +1,24 @@
+# The MIT License
+#
+# Copyright (c) 2004-2010, Sun Microsystems, Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+Summary=Samenvatting
+Total=Totaal
Index: src/main/resources/tasks/priorities-summary_fr.properties
===================================================================
--- src/main/resources/tasks/priorities-summary_fr.properties (revision 0)
+++ src/main/resources/tasks/priorities-summary_fr.properties (revision 0)
@@ -0,0 +1,27 @@
+# The MIT License
+#
+# Copyright (c) 2004-2010, Sun Microsystems, Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+High\ Priority=Haute priorit\u00E9
+Low\ Priority=Basse priorit\u00E9
+Normal\ Priority=Priorit\u00E9 normale
+Summary=R\u00E9sum\u00E9
+Total=Total
Index: src/main/resources/tasks/priorities-summary_ja.properties
===================================================================
--- src/main/resources/tasks/priorities-summary_ja.properties (revision 0)
+++ src/main/resources/tasks/priorities-summary_ja.properties (revision 0)
@@ -0,0 +1,5 @@
+Total=\u5408\u8a08
+High\ Priority=\u91cd\u8981\u5ea6 High
+Normal\ Priority= \u91cd\u8981\u5ea6 Normal\u3000
+Low\ Priority=\u91cd\u8981\u5ea6 Low
+Summary=\u8981\u7d04
Index: src/main/resources/hudson/plugins/tasks/TasksResult/index.jelly
===================================================================
--- src/main/resources/hudson/plugins/tasks/TasksResult/index.jelly (revision 38316)
+++ src/main/resources/hudson/plugins/tasks/TasksResult/index.jelly (working copy)
@@ -1,6 +1,6 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
- xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:tab="/tab">
+ xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:tab="/tab" xmlns:tasks="/tasks">
<l:layout norefresh="true">
<st:include it="${it.owner}" page="sidepanel.jelly" />
<l:main-panel>
@@ -39,7 +39,7 @@
</tbody>
</table>
- <tab:priorities-summary />
+ <tasks:priorities-summary />
<tab:main />
Index: src/main/java/hudson/plugins/tasks/TasksTabDetail.java
===================================================================
--- src/main/java/hudson/plugins/tasks/TasksTabDetail.java (revision 38316)
+++ src/main/java/hudson/plugins/tasks/TasksTabDetail.java (working copy)
@@ -2,6 +2,7 @@
import hudson.model.AbstractBuild;
import hudson.plugins.analysis.util.model.FileAnnotation;
+import hudson.plugins.analysis.util.model.Priority;
import hudson.plugins.analysis.views.DetailFactory;
import hudson.plugins.analysis.views.TabDetail;
@@ -49,5 +50,24 @@
public String getFixed() {
return "tasks-fixed.jelly";
}
+
+ /**
+ * Returns the tags for the specified priority.
+ *
+ * @param priority
+ * the priority
+ * @return the tags for the specified priority
+ */
+ public final String getTags(final Priority priority) {
+ if (priority == Priority.HIGH) {
+ return getProperty(TasksResult.HIGH_KEY);
+ }
+ else if (priority == Priority.NORMAL) {
+ return getProperty(TasksResult.NORMAL_KEY);
+ }
+ else {
+ return getProperty(TasksResult.LOW_KEY);
+ }
+ }
}
Index: src/main/java/hudson/plugins/tasks/TasksResult.java
===================================================================
--- src/main/java/hudson/plugins/tasks/TasksResult.java (revision 38316)
+++ src/main/java/hudson/plugins/tasks/TasksResult.java (working copy)
@@ -4,12 +4,15 @@
import hudson.plugins.analysis.core.BuildResult;
import hudson.plugins.analysis.core.ResultAction;
import hudson.plugins.analysis.util.model.Priority;
+import hudson.plugins.analysis.views.BuildView;
import hudson.plugins.tasks.parser.Task;
import hudson.plugins.tasks.parser.TasksParserResult;
import java.util.ArrayList;
import org.apache.commons.lang.StringUtils;
+import org.kohsuke.stapler.StaplerRequest;
+import org.kohsuke.stapler.StaplerResponse;
import com.thoughtworks.xstream.XStream;
@@ -20,9 +23,12 @@
* @author Ulli Hafner
*/
public class TasksResult extends BuildResult {
- /** Unique identifier of this class. */
private static final long serialVersionUID = -344808345805935004L;
+ static final String LOW_KEY = Priority.LOW.name();
+ static final String NORMAL_KEY = Priority.NORMAL.name();
+ static final String HIGH_KEY = Priority.HIGH.name();
+
/** Tag identifiers indicating high priority. */
private final String highTags;
/** Tag identifiers indicating normal priority. */
@@ -125,6 +131,19 @@
return priorities.toArray(new Priority[priorities.size()]);
}
+ /** {@inheritDoc} */
+ @Override
+ public BuildView getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
+ BuildView view = super.getDynamic(link, request, response);
+
+ if (view != null) {
+ view.addProperty(HIGH_KEY, highTags);
+ view.addProperty(NORMAL_KEY, normalTags);
+ view.addProperty(LOW_KEY, lowTags);
+ }
+ return view;
+ }
+
/**
* Returns the tags for the specified priority.
*