1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.plugin.activitystream.impl; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.Date; |
24 |
|
import java.util.List; |
25 |
|
import java.util.Map; |
26 |
|
|
27 |
|
import com.xpn.xwiki.XWikiContext; |
28 |
|
import com.xpn.xwiki.plugin.activitystream.api.ActivityEvent; |
29 |
|
|
30 |
|
|
31 |
|
@version |
32 |
|
|
|
|
| 77.6% |
Uncovered Elements: 30 (134) |
Complexity: 58 |
Complexity Density: 0.85 |
|
33 |
|
public class ActivityEventImpl implements ActivityEvent |
34 |
|
{ |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
protected String eventId; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
protected String requestId; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
protected int priority; |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
protected Date date; |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
protected String stream; |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
protected String application; |
64 |
|
|
65 |
|
|
66 |
|
@link |
67 |
|
|
68 |
|
protected String type; |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
protected String user; |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
protected String wiki; |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
protected String space; |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
protected String page; |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
protected String url; |
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
protected String title; |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
protected String body = ""; |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
protected String version = ""; |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
protected String param1 = ""; |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
protected String param2 = ""; |
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
protected String param3 = ""; |
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
protected String param4 = ""; |
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
protected String param5 = ""; |
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
protected boolean hidden; |
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
protected Map<String, String> parameters; |
144 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
145 |
0 |
@Override... |
146 |
|
public String getDisplayTitle(XWikiContext context) |
147 |
|
{ |
148 |
0 |
return context.getMessageTool().get(this.title, getParams()); |
149 |
|
} |
150 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
151 |
0 |
@Override... |
152 |
|
public String getDisplayBody(XWikiContext context) |
153 |
|
{ |
154 |
0 |
return context.getMessageTool().get(this.body, getParams()); |
155 |
|
} |
156 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
157 |
0 |
@Override... |
158 |
|
public String getDisplayDate(XWikiContext context) |
159 |
|
{ |
160 |
0 |
return context.getWiki().formatDate(this.date, null, context); |
161 |
|
} |
162 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
163 |
0 |
@Override... |
164 |
|
public String getDisplayUser(XWikiContext context) |
165 |
|
{ |
166 |
0 |
return context.getWiki().getUserName(this.user, context); |
167 |
|
} |
168 |
|
|
|
|
| 65.2% |
Uncovered Elements: 8 (23) |
Complexity: 7 |
Complexity Density: 0.64 |
|
169 |
64 |
@Override... |
170 |
|
public void setParams(List<String> params) |
171 |
|
{ |
172 |
64 |
if (params != null) { |
173 |
64 |
if (params.size() > 0) { |
174 |
64 |
setParam1(params.get(0)); |
175 |
|
} |
176 |
64 |
if (params.size() > 1) { |
177 |
1 |
setParam2(params.get(1)); |
178 |
|
} |
179 |
64 |
if (params.size() > 2) { |
180 |
0 |
setParam3(params.get(2)); |
181 |
|
} |
182 |
64 |
if (params.size() > 3) { |
183 |
0 |
setParam4(params.get(3)); |
184 |
|
} |
185 |
64 |
if (params.size() > 4) { |
186 |
0 |
setParam5(params.get(4)); |
187 |
|
} |
188 |
|
} |
189 |
|
} |
190 |
|
|
191 |
|
|
192 |
|
@return |
193 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
194 |
0 |
public List<String> getParams()... |
195 |
|
{ |
196 |
0 |
List<String> params = new ArrayList<String>(); |
197 |
0 |
params.add(getParam1()); |
198 |
0 |
params.add(getParam2()); |
199 |
0 |
params.add(getParam3()); |
200 |
0 |
params.add(getParam4()); |
201 |
0 |
params.add(getParam5()); |
202 |
0 |
return params; |
203 |
|
} |
204 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
205 |
192 |
@Override... |
206 |
|
public String getEventId() |
207 |
|
{ |
208 |
192 |
return this.eventId; |
209 |
|
} |
210 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
211 |
279 |
@Override... |
212 |
|
public void setEventId(String eventId) |
213 |
|
{ |
214 |
279 |
this.eventId = eventId; |
215 |
|
} |
216 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
217 |
283 |
@Override... |
218 |
|
public String getRequestId() |
219 |
|
{ |
220 |
283 |
return this.requestId; |
221 |
|
} |
222 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
223 |
215 |
@Override... |
224 |
|
public void setRequestId(String requestId) |
225 |
|
{ |
226 |
215 |
this.requestId = requestId; |
227 |
|
} |
228 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
229 |
128 |
@Override... |
230 |
|
public int getPriority() |
231 |
|
{ |
232 |
128 |
return this.priority; |
233 |
|
} |
234 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
235 |
215 |
@Override... |
236 |
|
public void setPriority(int priority) |
237 |
|
{ |
238 |
215 |
this.priority = priority; |
239 |
|
} |
240 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
241 |
352 |
@Override... |
242 |
|
public String getApplication() |
243 |
|
{ |
244 |
352 |
return this.application; |
245 |
|
} |
246 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
247 |
215 |
@Override... |
248 |
|
public void setStream(String stream) |
249 |
|
{ |
250 |
215 |
this.stream = stream; |
251 |
|
} |
252 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
253 |
169 |
@Override... |
254 |
|
public String getVersion() |
255 |
|
{ |
256 |
169 |
return this.version; |
257 |
|
} |
258 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
259 |
216 |
@Override... |
260 |
|
public void setVersion(String version) |
261 |
|
{ |
262 |
216 |
if (version != null) { |
263 |
216 |
this.version = version; |
264 |
|
} |
265 |
|
} |
266 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
267 |
128 |
@Override... |
268 |
|
public String getParam1() |
269 |
|
{ |
270 |
128 |
return this.param1; |
271 |
|
} |
272 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
273 |
215 |
@Override... |
274 |
|
public void setParam1(String param1) |
275 |
|
{ |
276 |
215 |
this.param1 = param1; |
277 |
|
} |
278 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
279 |
128 |
@Override... |
280 |
|
public String getParam2() |
281 |
|
{ |
282 |
128 |
return this.param2; |
283 |
|
} |
284 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
285 |
152 |
@Override... |
286 |
|
public void setParam2(String param2) |
287 |
|
{ |
288 |
152 |
this.param2 = param2; |
289 |
|
} |
290 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
291 |
128 |
@Override... |
292 |
|
public String getParam3() |
293 |
|
{ |
294 |
128 |
return this.param3; |
295 |
|
} |
296 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
297 |
151 |
@Override... |
298 |
|
public void setParam3(String param3) |
299 |
|
{ |
300 |
151 |
this.param3 = param3; |
301 |
|
} |
302 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
303 |
128 |
@Override... |
304 |
|
public String getParam4() |
305 |
|
{ |
306 |
128 |
return this.param4; |
307 |
|
} |
308 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
309 |
151 |
@Override... |
310 |
|
public void setParam4(String param4) |
311 |
|
{ |
312 |
151 |
this.param4 = param4; |
313 |
|
} |
314 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
315 |
128 |
@Override... |
316 |
|
public String getParam5() |
317 |
|
{ |
318 |
128 |
return this.param5; |
319 |
|
} |
320 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
321 |
151 |
@Override... |
322 |
|
public void setParam5(String param5) |
323 |
|
{ |
324 |
151 |
this.param5 = param5; |
325 |
|
} |
326 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
327 |
365 |
@Override... |
328 |
|
public String getWiki() |
329 |
|
{ |
330 |
365 |
return this.wiki; |
331 |
|
} |
332 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
333 |
216 |
@Override... |
334 |
|
public void setWiki(String wiki) |
335 |
|
{ |
336 |
216 |
this.wiki = wiki; |
337 |
|
} |
338 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
339 |
723 |
@Override... |
340 |
|
public String getType() |
341 |
|
{ |
342 |
723 |
return this.type; |
343 |
|
} |
344 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
345 |
216 |
@Override... |
346 |
|
public void setType(String type) |
347 |
|
{ |
348 |
216 |
this.type = type; |
349 |
|
} |
350 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
351 |
477 |
@Override... |
352 |
|
public String getUser() |
353 |
|
{ |
354 |
477 |
return this.user; |
355 |
|
} |
356 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
357 |
216 |
@Override... |
358 |
|
public void setUser(String user) |
359 |
|
{ |
360 |
216 |
this.user = user; |
361 |
|
} |
362 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
363 |
192 |
@Override... |
364 |
|
public String getSpace() |
365 |
|
{ |
366 |
192 |
return this.space; |
367 |
|
} |
368 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
369 |
215 |
@Override... |
370 |
|
public void setSpace(String space) |
371 |
|
{ |
372 |
215 |
this.space = space; |
373 |
|
} |
374 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
375 |
283 |
@Override... |
376 |
|
public String getPage() |
377 |
|
{ |
378 |
283 |
return this.page; |
379 |
|
} |
380 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
381 |
216 |
@Override... |
382 |
|
public void setPage(String page) |
383 |
|
{ |
384 |
216 |
this.page = page; |
385 |
|
} |
386 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
387 |
192 |
@Override... |
388 |
|
public String getUrl() |
389 |
|
{ |
390 |
192 |
return this.url; |
391 |
|
} |
392 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
393 |
212 |
@Override... |
394 |
|
public void setUrl(String url) |
395 |
|
{ |
396 |
212 |
this.url = url; |
397 |
|
} |
398 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
399 |
128 |
@Override... |
400 |
|
public String getTitle() |
401 |
|
{ |
402 |
128 |
return this.title; |
403 |
|
} |
404 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
405 |
215 |
@Override... |
406 |
|
public void setTitle(String title) |
407 |
|
{ |
408 |
215 |
this.title = title; |
409 |
|
} |
410 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
411 |
128 |
@Override... |
412 |
|
public String getBody() |
413 |
|
{ |
414 |
128 |
return this.body; |
415 |
|
} |
416 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
417 |
215 |
@Override... |
418 |
|
public void setBody(String body) |
419 |
|
{ |
420 |
215 |
this.body = body; |
421 |
|
} |
422 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
423 |
355 |
@Override... |
424 |
|
public Date getDate() |
425 |
|
{ |
426 |
355 |
return this.date; |
427 |
|
} |
428 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
429 |
216 |
@Override... |
430 |
|
public void setDate(Date date) |
431 |
|
{ |
432 |
216 |
this.date = date; |
433 |
|
} |
434 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
435 |
256 |
@Override... |
436 |
|
public String getStream() |
437 |
|
{ |
438 |
256 |
return this.stream; |
439 |
|
} |
440 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
441 |
215 |
@Override... |
442 |
|
public void setApplication(String application) |
443 |
|
{ |
444 |
215 |
this.application = application; |
445 |
|
} |
446 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
447 |
0 |
@Override... |
448 |
|
public void setParameters(Map<String, String> parameters) |
449 |
|
{ |
450 |
0 |
this.parameters = parameters; |
451 |
|
} |
452 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
453 |
0 |
@Override... |
454 |
|
public Map<String, String> getParameters() |
455 |
|
{ |
456 |
0 |
return this.parameters; |
457 |
|
} |
458 |
|
|
459 |
|
|
460 |
|
@return |
461 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
462 |
128 |
public boolean isHidden()... |
463 |
|
{ |
464 |
128 |
return this.hidden; |
465 |
|
} |
466 |
|
|
467 |
|
|
468 |
|
@param |
469 |
|
@see |
470 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
471 |
215 |
public void setHidden(Boolean hidden)... |
472 |
|
{ |
473 |
215 |
if (hidden != null) { |
474 |
215 |
this.hidden = hidden; |
475 |
|
} |
476 |
|
} |
477 |
|
} |