1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package com.xpn.xwiki.plugin.rightsmanager; |
22 |
|
|
23 |
|
import java.text.MessageFormat; |
24 |
|
import java.util.Collections; |
25 |
|
import java.util.List; |
26 |
|
import java.util.Map; |
27 |
|
|
28 |
|
import org.slf4j.Logger; |
29 |
|
import org.slf4j.LoggerFactory; |
30 |
|
|
31 |
|
import com.xpn.xwiki.XWikiContext; |
32 |
|
import com.xpn.xwiki.XWikiException; |
33 |
|
import com.xpn.xwiki.api.Api; |
34 |
|
import com.xpn.xwiki.api.Document; |
35 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
36 |
|
import com.xpn.xwiki.plugin.rightsmanager.utils.RequestLimit; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
@version |
42 |
|
@since |
43 |
|
@since |
44 |
|
|
|
|
| 8% |
Uncovered Elements: 149 (162) |
Complexity: 62 |
Complexity Density: 0.55 |
|
45 |
|
public class RightsManagerGroupsApi extends Api |
46 |
|
{ |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
public static final String CONTEXT_LASTERRORCODE = RightsManagerPluginApi.CONTEXT_LASTERRORCODE; |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
public static final String CONTEXT_LASTEXCEPTION = RightsManagerPluginApi.CONTEXT_LASTEXCEPTION; |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
protected static final Logger LOGGER = LoggerFactory.getLogger(RightsManagerGroupsApi.class); |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
@param |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
22 |
public RightsManagerGroupsApi(XWikiContext context)... |
68 |
|
{ |
69 |
22 |
super(context); |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
@link@link |
74 |
|
|
75 |
|
@param@link |
76 |
|
@param |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
78 |
0 |
private void logError(String comment, XWikiException e)... |
79 |
|
{ |
80 |
0 |
LOGGER.error(comment, e); |
81 |
|
|
82 |
0 |
this.context.put(CONTEXT_LASTERRORCODE, e.getCode()); |
83 |
0 |
this.context.put(CONTEXT_LASTEXCEPTION, e); |
84 |
|
} |
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
@return |
90 |
|
@throws |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
0 |
public int countAllGroups() throws XWikiException... |
93 |
|
{ |
94 |
0 |
return countAllMatchedGroups(null); |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
@param |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
@return |
104 |
|
@throws |
105 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
106 |
0 |
public int countAllMatchedGroups(Map<?, ?> matchFields) throws XWikiException... |
107 |
|
{ |
108 |
0 |
int count = 0; |
109 |
|
|
110 |
0 |
try { |
111 |
0 |
count = |
112 |
|
RightsManager.getInstance().countAllUsersOrGroups(false, |
113 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), this.context); |
114 |
|
} catch (RightsManagerException e) { |
115 |
0 |
logError("Try to count all groups", e); |
116 |
|
} |
117 |
|
|
118 |
0 |
return count; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
@param |
125 |
|
@return |
126 |
|
@throws |
127 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
0 |
public int countAllWikiGroups(String wikiName) throws XWikiException... |
129 |
|
{ |
130 |
0 |
return countAllMatchedWikiGroups(wikiName, null); |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
@param |
137 |
|
@param |
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
@return |
143 |
|
@throws |
144 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
145 |
0 |
public int countAllMatchedWikiGroups(String wikiName, Map<?, ?> matchFields) throws XWikiException... |
146 |
|
{ |
147 |
0 |
int count = 0; |
148 |
|
|
149 |
0 |
try { |
150 |
0 |
count = |
151 |
|
RightsManager.getInstance().countAllWikiUsersOrGroups(false, wikiName, |
152 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), this.context); |
153 |
|
} catch (RightsManagerException e) { |
154 |
0 |
logError(MessageFormat.format("Try to count all groups in wiki [{0}]", new Object[] { wikiName }), e); |
155 |
|
} |
156 |
|
|
157 |
0 |
return count; |
158 |
|
} |
159 |
|
|
160 |
|
|
161 |
|
@return |
162 |
|
@throws |
163 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
0 |
public int countAllGlobalGroups() throws XWikiException... |
165 |
|
{ |
166 |
0 |
return countAllMatchedGlobalGroups(null); |
167 |
|
} |
168 |
|
|
169 |
|
|
170 |
|
@param |
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
@return |
176 |
|
@throws |
177 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
178 |
0 |
public int countAllMatchedGlobalGroups(Map<?, ?> matchFields) throws XWikiException... |
179 |
|
{ |
180 |
0 |
int count = 0; |
181 |
|
|
182 |
0 |
try { |
183 |
0 |
count = |
184 |
|
RightsManager.getInstance().countAllGlobalUsersOrGroups(false, |
185 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), this.context); |
186 |
|
} catch (RightsManagerException e) { |
187 |
0 |
logError("Try to count all groups in main wiki", e); |
188 |
|
} |
189 |
|
|
190 |
0 |
return count; |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
|
@return |
195 |
|
@throws |
196 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
197 |
0 |
public int countAllLocalGroups() throws XWikiException... |
198 |
|
{ |
199 |
0 |
return countAllMatchedLocalGroups(null); |
200 |
|
} |
201 |
|
|
202 |
|
|
203 |
|
@param |
204 |
|
|
205 |
|
|
206 |
|
|
207 |
|
|
208 |
|
@return |
209 |
|
@throws |
210 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
211 |
4 |
public int countAllMatchedLocalGroups(Map<?, ?> matchFields) throws XWikiException... |
212 |
|
{ |
213 |
4 |
int count = 0; |
214 |
|
|
215 |
4 |
try { |
216 |
4 |
count = |
217 |
|
RightsManager.getInstance().countAllLocalUsersOrGroups(false, |
218 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), this.context); |
219 |
|
} catch (RightsManagerException e) { |
220 |
0 |
logError("Try to count all groups in current wiki", e); |
221 |
|
} |
222 |
|
|
223 |
4 |
return count; |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
@param |
230 |
|
@param |
231 |
|
@return@link@link |
232 |
|
@throws |
233 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
234 |
0 |
public List<String> getAllGroupsNames(int nb, int start) throws XWikiException... |
235 |
|
{ |
236 |
0 |
return getAllMatchedGroupsNames(null, nb, start); |
237 |
|
} |
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
@return@link@link |
243 |
|
@throws |
244 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
245 |
0 |
public List<String> getAllGroupsNames() throws XWikiException... |
246 |
|
{ |
247 |
0 |
return getAllMatchedGroupsNames(null); |
248 |
|
} |
249 |
|
|
250 |
|
|
251 |
|
|
252 |
|
|
253 |
|
@param |
254 |
|
|
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
@return@link@link |
259 |
|
@throws |
260 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
261 |
0 |
public List<String> getAllMatchedGroupsNames(Map<?, ?> matchFields) throws XWikiException... |
262 |
|
{ |
263 |
0 |
return getAllMatchedGroupsNames(matchFields, 0, 0, null); |
264 |
|
} |
265 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 |
|
@param |
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
@param |
275 |
|
@param |
276 |
|
@return@link@link |
277 |
|
@throws |
278 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
279 |
0 |
public List<String> getAllMatchedGroupsNames(Map<?, ?> matchFields, int nb, int start) throws XWikiException... |
280 |
|
{ |
281 |
0 |
return getAllMatchedGroupsNames(matchFields, nb, start, null); |
282 |
|
} |
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
|
287 |
|
@param |
288 |
|
|
289 |
|
|
290 |
|
|
291 |
|
|
292 |
|
@param |
293 |
|
@param |
294 |
|
@param |
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
|
@return@link@link |
300 |
|
@throws |
301 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
302 |
0 |
public List<String> getAllMatchedGroupsNames(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
303 |
|
throws XWikiException |
304 |
|
{ |
305 |
0 |
List<String> groupList; |
306 |
|
|
307 |
0 |
try { |
308 |
0 |
groupList = |
309 |
|
(List<String>) RightsManager.getInstance().getAllMatchedUsersOrGroups(false, |
310 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), false, new RequestLimit(nb, start), |
311 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
312 |
|
} catch (RightsManagerException e) { |
313 |
0 |
logError("Try to get all matched groups names", e); |
314 |
|
|
315 |
0 |
groupList = Collections.emptyList(); |
316 |
|
} |
317 |
|
|
318 |
0 |
return groupList; |
319 |
|
} |
320 |
|
|
321 |
|
|
322 |
|
|
323 |
|
|
324 |
|
@param |
325 |
|
@param |
326 |
|
@return@link@link |
327 |
|
@throws |
328 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
329 |
0 |
public List<String> getAllGlobalGroupsNames(int nb, int start) throws XWikiException... |
330 |
|
{ |
331 |
0 |
return getAllMatchedGlobalGroupsNames(null, nb, start); |
332 |
|
} |
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
@return@link@link |
338 |
|
@throws |
339 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
340 |
0 |
public List<String> getAllGlobalGroupsNames() throws XWikiException... |
341 |
|
{ |
342 |
0 |
return getAllMatchedGlobalGroupsNames(null); |
343 |
|
} |
344 |
|
|
345 |
|
|
346 |
|
|
347 |
|
|
348 |
|
@param |
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
|
@return@link@link |
354 |
|
@throws |
355 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
356 |
0 |
public List<String> getAllMatchedGlobalGroupsNames(Map<?, ?> matchFields) throws XWikiException... |
357 |
|
{ |
358 |
0 |
return getAllMatchedGlobalGroupsNames(matchFields, 0, 0, null); |
359 |
|
} |
360 |
|
|
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
@param |
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
@param |
370 |
|
@param |
371 |
|
@return@link@link |
372 |
|
@throws |
373 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
374 |
0 |
public List<String> getAllMatchedGlobalGroupsNames(Map<?, ?> matchFields, int nb, int start)... |
375 |
|
throws XWikiException |
376 |
|
{ |
377 |
0 |
return getAllMatchedGlobalGroupsNames(matchFields, nb, start, null); |
378 |
|
} |
379 |
|
|
380 |
|
|
381 |
|
|
382 |
|
|
383 |
|
@param |
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
@param |
389 |
|
@param |
390 |
|
@param |
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
@return@link@link |
396 |
|
@throws |
397 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
398 |
0 |
public List<String> getAllMatchedGlobalGroupsNames(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
399 |
|
throws XWikiException |
400 |
|
{ |
401 |
0 |
List<String> groupList; |
402 |
|
|
403 |
0 |
try { |
404 |
0 |
groupList = |
405 |
|
(List<String>) RightsManager.getInstance().getAllMatchedGlobalUsersOrGroups(false, |
406 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), false, new RequestLimit(nb, start), |
407 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
408 |
|
} catch (RightsManagerException e) { |
409 |
0 |
logError("Try to get all matched groups names from global wiki", e); |
410 |
|
|
411 |
0 |
groupList = Collections.emptyList(); |
412 |
|
} |
413 |
|
|
414 |
0 |
return groupList; |
415 |
|
} |
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
|
@param |
421 |
|
@param |
422 |
|
@param |
423 |
|
@return@link@link |
424 |
|
@throws |
425 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
426 |
0 |
public List<String> getAllWikiGroupsNames(String wikiName, int nb, int start) throws XWikiException... |
427 |
|
{ |
428 |
0 |
return getAllMatchedWikiGroupsNames(wikiName, null, nb, start); |
429 |
|
} |
430 |
|
|
431 |
|
|
432 |
|
|
433 |
|
|
434 |
|
@param |
435 |
|
@return@link@link |
436 |
|
@throws |
437 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
438 |
0 |
public List<String> getAllWikiGroupsNames(String wikiName) throws XWikiException... |
439 |
|
{ |
440 |
0 |
return getAllMatchedWikiGroupsNames(wikiName, null); |
441 |
|
} |
442 |
|
|
443 |
|
|
444 |
|
|
445 |
|
|
446 |
|
@param |
447 |
|
@param |
448 |
|
|
449 |
|
|
450 |
|
|
451 |
|
|
452 |
|
@return@link@link |
453 |
|
@throws |
454 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
455 |
0 |
public List<String> getAllMatchedWikiGroupsNames(String wikiName, Map<?, ?> matchFields) throws XWikiException... |
456 |
|
{ |
457 |
0 |
return getAllMatchedWikiGroupsNames(wikiName, matchFields, 0, 0, null); |
458 |
|
} |
459 |
|
|
460 |
|
|
461 |
|
|
462 |
|
|
463 |
|
@param |
464 |
|
@param |
465 |
|
|
466 |
|
|
467 |
|
|
468 |
|
|
469 |
|
@param |
470 |
|
@param |
471 |
|
@return@link@link |
472 |
|
@throws |
473 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
474 |
0 |
public List<String> getAllMatchedWikiGroupsNames(String wikiName, Map<?, ?> matchFields, int nb, int start)... |
475 |
|
throws XWikiException |
476 |
|
{ |
477 |
0 |
return getAllMatchedWikiGroupsNames(wikiName, matchFields, nb, start, null); |
478 |
|
} |
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
@param |
484 |
|
@param |
485 |
|
|
486 |
|
|
487 |
|
|
488 |
|
|
489 |
|
@param |
490 |
|
@param |
491 |
|
@param |
492 |
|
|
493 |
|
|
494 |
|
|
495 |
|
|
496 |
|
@return@link@link |
497 |
|
@throws |
498 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
499 |
0 |
public List<String> getAllMatchedWikiGroupsNames(String wikiName, Map<?, ?> matchFields, int nb, int start,... |
500 |
|
List<?> order) throws XWikiException |
501 |
|
{ |
502 |
0 |
List<String> groupList; |
503 |
|
|
504 |
0 |
try { |
505 |
0 |
groupList = |
506 |
|
(List<String>) RightsManager.getInstance().getAllMatchedWikiUsersOrGroups(false, wikiName, |
507 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), false, new RequestLimit(nb, start), |
508 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
509 |
|
} catch (RightsManagerException e) { |
510 |
0 |
logError("Try to get all matched groups names from provided wiki", e); |
511 |
|
|
512 |
0 |
groupList = Collections.emptyList(); |
513 |
|
} |
514 |
|
|
515 |
0 |
return groupList; |
516 |
|
} |
517 |
|
|
518 |
|
|
519 |
|
|
520 |
|
|
521 |
|
@param |
522 |
|
@param |
523 |
|
@return@link@link |
524 |
|
@throws |
525 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
526 |
0 |
public List<String> getAllLocalGroupsNames(int nb, int start) throws XWikiException... |
527 |
|
{ |
528 |
0 |
return getAllMatchedLocalGroupsNames(null, nb, start); |
529 |
|
} |
530 |
|
|
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
@return@link@link |
535 |
|
@throws |
536 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
537 |
0 |
public List<String> getAllLocalGroupsNames() throws XWikiException... |
538 |
|
{ |
539 |
0 |
return getAllMatchedLocalGroupsNames(null); |
540 |
|
} |
541 |
|
|
542 |
|
|
543 |
|
|
544 |
|
|
545 |
|
@param |
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
|
550 |
|
@return@link@link |
551 |
|
@throws |
552 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
553 |
0 |
public List<String> getAllMatchedLocalGroupsNames(Map<?, ?> matchFields) throws XWikiException... |
554 |
|
{ |
555 |
0 |
return getAllMatchedLocalGroupsNames(matchFields, 0, 0, null); |
556 |
|
} |
557 |
|
|
558 |
|
|
559 |
|
|
560 |
|
|
561 |
|
@param |
562 |
|
|
563 |
|
|
564 |
|
|
565 |
|
|
566 |
|
@param |
567 |
|
@param |
568 |
|
@return@link@link |
569 |
|
@throws |
570 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
571 |
0 |
public List<String> getAllMatchedLocalGroupsNames(Map<?, ?> matchFields, int nb, int start)... |
572 |
|
throws XWikiException |
573 |
|
{ |
574 |
0 |
return getAllMatchedLocalGroupsNames(matchFields, nb, start, null); |
575 |
|
} |
576 |
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
|
@param |
581 |
|
|
582 |
|
|
583 |
|
|
584 |
|
|
585 |
|
@param |
586 |
|
@param |
587 |
|
@param |
588 |
|
|
589 |
|
|
590 |
|
|
591 |
|
|
592 |
|
@return@link@link |
593 |
|
@throws |
594 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
595 |
0 |
public List<String> getAllMatchedLocalGroupsNames(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
596 |
|
throws XWikiException |
597 |
|
{ |
598 |
0 |
List<String> groupList; |
599 |
|
|
600 |
0 |
try { |
601 |
0 |
groupList = |
602 |
|
(List<String>) RightsManager.getInstance().getAllMatchedLocalUsersOrGroups(false, |
603 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), false, new RequestLimit(nb, start), |
604 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
605 |
|
} catch (RightsManagerException e) { |
606 |
0 |
logError("Try to get all matched groups names from local wiki", e); |
607 |
|
|
608 |
0 |
groupList = Collections.emptyList(); |
609 |
|
} |
610 |
|
|
611 |
0 |
return groupList; |
612 |
|
} |
613 |
|
|
614 |
|
|
615 |
|
|
616 |
|
|
617 |
|
@param |
618 |
|
@param |
619 |
|
@return@link@link |
620 |
|
@throws |
621 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
622 |
0 |
public List<Document> getAllGroups(int nb, int start) throws XWikiException... |
623 |
|
{ |
624 |
0 |
return getAllMatchedGroups(null, nb, start); |
625 |
|
} |
626 |
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
|
@return@link@link |
631 |
|
@throws |
632 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
633 |
0 |
public List<Document> getAllGroups() throws XWikiException... |
634 |
|
{ |
635 |
0 |
return getAllMatchedGroups(null); |
636 |
|
} |
637 |
|
|
638 |
|
|
639 |
|
|
640 |
|
|
641 |
|
@param |
642 |
|
|
643 |
|
|
644 |
|
|
645 |
|
|
646 |
|
@return@link@link |
647 |
|
@throws |
648 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
649 |
0 |
public List<Document> getAllMatchedGroups(Map<?, ?> matchFields) throws XWikiException... |
650 |
|
{ |
651 |
0 |
return getAllMatchedGroups(matchFields, 0, 0, null); |
652 |
|
} |
653 |
|
|
654 |
|
|
655 |
|
|
656 |
|
|
657 |
|
@param |
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
662 |
|
@param |
663 |
|
@param |
664 |
|
@return@link@link |
665 |
|
@throws |
666 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
667 |
0 |
public List<Document> getAllMatchedGroups(Map<?, ?> matchFields, int nb, int start) throws XWikiException... |
668 |
|
{ |
669 |
0 |
return getAllMatchedGroups(matchFields, nb, start, null); |
670 |
|
} |
671 |
|
|
672 |
|
|
673 |
|
|
674 |
|
|
675 |
|
@param |
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
|
@param |
681 |
|
@param |
682 |
|
@param |
683 |
|
|
684 |
|
|
685 |
|
|
686 |
|
|
687 |
|
@return@link@link |
688 |
|
@throws |
689 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
690 |
0 |
public List<Document> getAllMatchedGroups(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
691 |
|
throws XWikiException |
692 |
|
{ |
693 |
0 |
List<Document> groupList; |
694 |
|
|
695 |
0 |
try { |
696 |
0 |
List<XWikiDocument> xdocList = |
697 |
|
(List<XWikiDocument>) RightsManager.getInstance().getAllMatchedUsersOrGroups(false, |
698 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), true, new RequestLimit(nb, start), |
699 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
700 |
|
|
701 |
0 |
groupList = convert(xdocList); |
702 |
|
} catch (RightsManagerException e) { |
703 |
0 |
logError("Try to get all matched groups documents", e); |
704 |
|
|
705 |
0 |
groupList = Collections.emptyList(); |
706 |
|
} |
707 |
|
|
708 |
0 |
return groupList; |
709 |
|
} |
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
|
714 |
|
@param |
715 |
|
@param |
716 |
|
@return@link@link |
717 |
|
@throws |
718 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
719 |
0 |
public List<Document> getAllGlobalGroups(int nb, int start) throws XWikiException... |
720 |
|
{ |
721 |
0 |
return getAllMatchedGlobalGroups(null, nb, start); |
722 |
|
} |
723 |
|
|
724 |
|
|
725 |
|
|
726 |
|
|
727 |
|
@return@link@link |
728 |
|
@throws |
729 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
730 |
0 |
public List<Document> getAllGlobalGroups() throws XWikiException... |
731 |
|
{ |
732 |
0 |
return getAllMatchedGlobalGroups(null); |
733 |
|
} |
734 |
|
|
735 |
|
|
736 |
|
|
737 |
|
|
738 |
|
@param |
739 |
|
|
740 |
|
|
741 |
|
|
742 |
|
|
743 |
|
@return@link@link |
744 |
|
@throws |
745 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
746 |
0 |
public List<Document> getAllMatchedGlobalGroups(Map<?, ?> matchFields) throws XWikiException... |
747 |
|
{ |
748 |
0 |
return getAllMatchedGlobalGroups(matchFields, 0, 0, null); |
749 |
|
} |
750 |
|
|
751 |
|
|
752 |
|
|
753 |
|
|
754 |
|
@param |
755 |
|
|
756 |
|
|
757 |
|
|
758 |
|
|
759 |
|
@param |
760 |
|
@param |
761 |
|
@return@link@link |
762 |
|
@throws |
763 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
764 |
0 |
public List<Document> getAllMatchedGlobalGroups(Map<?, ?> matchFields, int nb, int start) throws XWikiException... |
765 |
|
{ |
766 |
0 |
return getAllMatchedGlobalGroups(matchFields, nb, start, null); |
767 |
|
} |
768 |
|
|
769 |
|
|
770 |
|
|
771 |
|
|
772 |
|
@param |
773 |
|
|
774 |
|
|
775 |
|
|
776 |
|
|
777 |
|
@param |
778 |
|
@param |
779 |
|
@param |
780 |
|
|
781 |
|
|
782 |
|
|
783 |
|
|
784 |
|
@return@link@link |
785 |
|
@throws |
786 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
787 |
0 |
public List<Document> getAllMatchedGlobalGroups(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
788 |
|
throws XWikiException |
789 |
|
{ |
790 |
0 |
List<Document> groupList; |
791 |
|
|
792 |
0 |
try { |
793 |
0 |
List<XWikiDocument> xdocList = |
794 |
|
(List<XWikiDocument>) RightsManager.getInstance().getAllMatchedGlobalUsersOrGroups(false, |
795 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), true, new RequestLimit(nb, start), |
796 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
797 |
|
|
798 |
0 |
groupList = convert(xdocList); |
799 |
|
} catch (RightsManagerException e) { |
800 |
0 |
logError("Try to get all matched groups documents from global wiki", e); |
801 |
|
|
802 |
0 |
groupList = Collections.emptyList(); |
803 |
|
} |
804 |
|
|
805 |
0 |
return groupList; |
806 |
|
} |
807 |
|
|
808 |
|
|
809 |
|
|
810 |
|
|
811 |
|
@param |
812 |
|
@param |
813 |
|
@param |
814 |
|
@return@link@link |
815 |
|
@throws |
816 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
817 |
0 |
public List<Document> getAllWikiGroups(String wikiName, int nb, int start) throws XWikiException... |
818 |
|
{ |
819 |
0 |
return getAllMatchedWikiGroups(wikiName, null, nb, start); |
820 |
|
} |
821 |
|
|
822 |
|
|
823 |
|
|
824 |
|
|
825 |
|
@param |
826 |
|
@return@link@link |
827 |
|
@throws |
828 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
829 |
0 |
public List<Document> getAllWikiGroups(String wikiName) throws XWikiException... |
830 |
|
{ |
831 |
0 |
return getAllMatchedWikiGroups(wikiName, null); |
832 |
|
} |
833 |
|
|
834 |
|
|
835 |
|
|
836 |
|
|
837 |
|
@param |
838 |
|
@param |
839 |
|
|
840 |
|
|
841 |
|
|
842 |
|
|
843 |
|
@return@link@link |
844 |
|
@throws |
845 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
846 |
0 |
public List<Document> getAllMatchedWikiGroups(String wikiName, Map<?, ?> matchFields) throws XWikiException... |
847 |
|
{ |
848 |
0 |
return getAllMatchedWikiGroups(wikiName, matchFields, 0, 0, null); |
849 |
|
} |
850 |
|
|
851 |
|
|
852 |
|
|
853 |
|
|
854 |
|
@param |
855 |
|
@param |
856 |
|
|
857 |
|
|
858 |
|
|
859 |
|
|
860 |
|
@param |
861 |
|
@param |
862 |
|
@return@link@link |
863 |
|
@throws |
864 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
865 |
0 |
public List<Document> getAllMatchedWikiGroups(String wikiName, Map<?, ?> matchFields, int nb, int start)... |
866 |
|
throws XWikiException |
867 |
|
{ |
868 |
0 |
return getAllMatchedWikiGroups(wikiName, matchFields, nb, start, null); |
869 |
|
} |
870 |
|
|
871 |
|
|
872 |
|
|
873 |
|
|
874 |
|
@param |
875 |
|
@param |
876 |
|
|
877 |
|
|
878 |
|
|
879 |
|
|
880 |
|
@param |
881 |
|
@param |
882 |
|
@param |
883 |
|
|
884 |
|
|
885 |
|
|
886 |
|
|
887 |
|
@return@link@link |
888 |
|
@throws |
889 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
890 |
0 |
public List<Document> getAllMatchedWikiGroups(String wikiName, Map<?, ?> matchFields, int nb, int start,... |
891 |
|
List<?> order) throws XWikiException |
892 |
|
{ |
893 |
0 |
List<Document> groupList; |
894 |
|
|
895 |
0 |
try { |
896 |
0 |
List<XWikiDocument> xdocList = |
897 |
|
(List<XWikiDocument>) RightsManager.getInstance().getAllMatchedWikiUsersOrGroups(false, wikiName, |
898 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), true, new RequestLimit(nb, start), |
899 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
900 |
|
|
901 |
0 |
groupList = convert(xdocList); |
902 |
|
} catch (RightsManagerException e) { |
903 |
0 |
logError("Try to get all matched groups documents from provided wiki", e); |
904 |
|
|
905 |
0 |
groupList = Collections.emptyList(); |
906 |
|
} |
907 |
|
|
908 |
0 |
return groupList; |
909 |
|
} |
910 |
|
|
911 |
|
|
912 |
|
|
913 |
|
|
914 |
|
@param |
915 |
|
@param |
916 |
|
@return@link@link |
917 |
|
@throws |
918 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
919 |
0 |
public List<Document> getAllLocalGroups(int nb, int start) throws XWikiException... |
920 |
|
{ |
921 |
0 |
return getAllMatchedLocalGroups(null, nb, start); |
922 |
|
} |
923 |
|
|
924 |
|
|
925 |
|
|
926 |
|
|
927 |
|
@return@link@link |
928 |
|
@throws |
929 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
930 |
0 |
public List<Document> getAllLocalGroups() throws XWikiException... |
931 |
|
{ |
932 |
0 |
return getAllMatchedLocalGroups(null); |
933 |
|
} |
934 |
|
|
935 |
|
|
936 |
|
|
937 |
|
|
938 |
|
@param |
939 |
|
|
940 |
|
|
941 |
|
|
942 |
|
|
943 |
|
@return@link@link |
944 |
|
@throws |
945 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
946 |
0 |
public List<Document> getAllMatchedLocalGroups(Map<?, ?> matchFields) throws XWikiException... |
947 |
|
{ |
948 |
0 |
return getAllMatchedLocalGroups(matchFields, 0, 0, null); |
949 |
|
} |
950 |
|
|
951 |
|
|
952 |
|
|
953 |
|
|
954 |
|
@param |
955 |
|
|
956 |
|
|
957 |
|
|
958 |
|
|
959 |
|
@param |
960 |
|
@param |
961 |
|
@return@link@link |
962 |
|
@throws |
963 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
964 |
0 |
public List<Document> getAllMatchedLocalGroups(Map<?, ?> matchFields, int nb, int start) throws XWikiException... |
965 |
|
{ |
966 |
0 |
return getAllMatchedLocalGroups(matchFields, nb, start, null); |
967 |
|
} |
968 |
|
|
969 |
|
|
970 |
|
|
971 |
|
|
972 |
|
@param |
973 |
|
|
974 |
|
|
975 |
|
|
976 |
|
|
977 |
|
@param |
978 |
|
@param |
979 |
|
@param |
980 |
|
|
981 |
|
|
982 |
|
|
983 |
|
|
984 |
|
@return@link@link |
985 |
|
@throws |
986 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
987 |
4 |
public List<Document> getAllMatchedLocalGroups(Map<?, ?> matchFields, int nb, int start, List<?> order)... |
988 |
|
throws XWikiException |
989 |
|
{ |
990 |
4 |
List<Document> groupList; |
991 |
|
|
992 |
4 |
try { |
993 |
4 |
List<XWikiDocument> xdocList = |
994 |
|
(List<XWikiDocument>) RightsManager.getInstance().getAllMatchedLocalUsersOrGroups(false, |
995 |
|
RightsManagerPluginApi.createMatchingTable(matchFields), true, new RequestLimit(nb, start), |
996 |
|
RightsManagerPluginApi.createOrderTable(order), this.context); |
997 |
|
|
998 |
4 |
groupList = convert(xdocList); |
999 |
|
} catch (RightsManagerException e) { |
1000 |
0 |
logError("Try to get all matched groups documents from local wiki", e); |
1001 |
|
|
1002 |
0 |
groupList = Collections.emptyList(); |
1003 |
|
} |
1004 |
|
|
1005 |
4 |
return groupList; |
1006 |
|
} |
1007 |
|
} |