1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.api; |
21 |
|
|
22 |
|
import java.io.IOException; |
23 |
|
import java.lang.reflect.Type; |
24 |
|
import java.util.ArrayList; |
25 |
|
import java.util.Collections; |
26 |
|
import java.util.Date; |
27 |
|
import java.util.List; |
28 |
|
import java.util.Locale; |
29 |
|
|
30 |
|
import org.apache.commons.lang3.StringUtils; |
31 |
|
import org.apache.commons.lang3.math.NumberUtils; |
32 |
|
import org.slf4j.Logger; |
33 |
|
import org.slf4j.LoggerFactory; |
34 |
|
import org.xwiki.component.manager.ComponentLookupException; |
35 |
|
import org.xwiki.job.Job; |
36 |
|
import org.xwiki.job.event.status.JobStatus; |
37 |
|
import org.xwiki.job.event.status.JobStatus.State; |
38 |
|
import org.xwiki.model.reference.DocumentReference; |
39 |
|
import org.xwiki.model.reference.DocumentReferenceResolver; |
40 |
|
import org.xwiki.model.reference.EntityReference; |
41 |
|
import org.xwiki.model.reference.EntityReferenceSerializer; |
42 |
|
import org.xwiki.model.reference.SpaceReference; |
43 |
|
import org.xwiki.model.reference.WikiReference; |
44 |
|
import org.xwiki.rendering.renderer.PrintRendererFactory; |
45 |
|
import org.xwiki.rendering.syntax.Syntax; |
46 |
|
|
47 |
|
import com.xpn.xwiki.XWikiContext; |
48 |
|
import com.xpn.xwiki.XWikiException; |
49 |
|
import com.xpn.xwiki.doc.XWikiDeletedDocument; |
50 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
51 |
|
import com.xpn.xwiki.internal.XWikiInitializerJob; |
52 |
|
import com.xpn.xwiki.internal.XWikiInitializerJobStatus; |
53 |
|
import com.xpn.xwiki.objects.meta.MetaClass; |
54 |
|
import com.xpn.xwiki.user.api.XWikiUser; |
55 |
|
import com.xpn.xwiki.util.Programming; |
56 |
|
import com.xpn.xwiki.web.Utils; |
57 |
|
import com.xpn.xwiki.web.XWikiEngineContext; |
58 |
|
import com.xpn.xwiki.web.XWikiURLFactory; |
59 |
|
|
|
|
| 40.6% |
Uncovered Elements: 406 (684) |
Complexity: 272 |
Complexity Density: 0.69 |
|
60 |
|
public class XWiki extends Api |
61 |
|
{ |
62 |
|
|
63 |
|
protected static final Logger LOGGER = LoggerFactory.getLogger(XWiki.class); |
64 |
|
|
65 |
|
|
66 |
|
private com.xpn.xwiki.XWiki xwiki; |
67 |
|
|
68 |
|
|
69 |
|
@see |
70 |
|
|
71 |
|
private StatsService statsService; |
72 |
|
|
73 |
|
|
74 |
|
@see |
75 |
|
|
76 |
|
private CriteriaService criteriaService; |
77 |
|
|
78 |
|
|
79 |
|
@see |
80 |
|
|
81 |
|
private DocumentReferenceResolver<String> currentMixedDocumentReferenceResolver; |
82 |
|
|
83 |
|
|
84 |
|
@see |
85 |
|
|
86 |
|
private DocumentReferenceResolver<String> defaultDocumentReferenceResolver; |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
private EntityReferenceSerializer<String> defaultStringEntityReferenceSerializer; |
93 |
|
|
94 |
|
private DocumentReferenceResolver<EntityReference> currentgetdocumentResolver; |
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
@param |
100 |
|
@param |
101 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
102 |
17722 |
public XWiki(com.xpn.xwiki.XWiki xwiki, XWikiContext context)... |
103 |
|
{ |
104 |
17729 |
super(context); |
105 |
|
|
106 |
17715 |
this.xwiki = xwiki; |
107 |
17710 |
this.statsService = new StatsService(context); |
108 |
17719 |
this.criteriaService = new CriteriaService(context); |
109 |
|
} |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
111 |
38768 |
private DocumentReferenceResolver<String> getCurrentMixedDocumentReferenceResolver()... |
112 |
|
{ |
113 |
38766 |
if (this.currentMixedDocumentReferenceResolver == null) { |
114 |
8408 |
this.currentMixedDocumentReferenceResolver = |
115 |
|
Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, "currentmixed"); |
116 |
|
} |
117 |
|
|
118 |
38767 |
return this.currentMixedDocumentReferenceResolver; |
119 |
|
} |
120 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
121 |
988 |
private DocumentReferenceResolver<EntityReference> getCurrentgetdocumentResolver()... |
122 |
|
{ |
123 |
988 |
if (this.currentgetdocumentResolver == null) { |
124 |
810 |
this.currentgetdocumentResolver = |
125 |
|
Utils.getComponent(DocumentReferenceResolver.TYPE_REFERENCE, "currentgetdocument"); |
126 |
|
} |
127 |
|
|
128 |
988 |
return this.currentgetdocumentResolver; |
129 |
|
} |
130 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
131 |
0 |
private DocumentReferenceResolver<String> getDefaultDocumentReferenceResolver()... |
132 |
|
{ |
133 |
0 |
if (this.defaultDocumentReferenceResolver == null) { |
134 |
0 |
this.defaultDocumentReferenceResolver = Utils.getComponent(DocumentReferenceResolver.TYPE_STRING); |
135 |
|
} |
136 |
|
|
137 |
0 |
return this.defaultDocumentReferenceResolver; |
138 |
|
} |
139 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
140 |
6 |
private EntityReferenceSerializer<String> getDefaultStringEntityReferenceSerializer()... |
141 |
|
{ |
142 |
6 |
if (this.defaultStringEntityReferenceSerializer == null) { |
143 |
3 |
this.defaultStringEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING); |
144 |
|
} |
145 |
|
|
146 |
6 |
return this.defaultStringEntityReferenceSerializer; |
147 |
|
} |
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
154 |
0 |
@Programming... |
155 |
|
public com.xpn.xwiki.XWiki getXWiki() |
156 |
|
{ |
157 |
0 |
if (hasProgrammingRights()) { |
158 |
0 |
return this.xwiki; |
159 |
|
} |
160 |
|
|
161 |
0 |
return null; |
162 |
|
} |
163 |
|
|
164 |
|
|
165 |
|
@return@link |
166 |
|
@since |
167 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
168 |
0 |
public XWikiInitializerJobStatus getJobStatus()... |
169 |
|
{ |
170 |
0 |
XWikiInitializerJob job = Utils.getComponent((Type) Job.class, XWikiInitializerJob.JOBTYPE); |
171 |
|
|
172 |
0 |
return job != null ? job.getStatus() : null; |
173 |
|
} |
174 |
|
|
175 |
|
|
176 |
|
@return |
177 |
|
@since |
178 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
179 |
0 |
public JobStatus getCurrentInitializerJobStatus()... |
180 |
|
{ |
181 |
|
|
182 |
0 |
XWikiInitializerJobStatus xwikiStatus = getJobStatus(); |
183 |
|
|
184 |
0 |
if (xwikiStatus == null) { |
185 |
0 |
return null; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
0 |
if (xwikiStatus.getState() != State.FINISHED) { |
190 |
0 |
return xwikiStatus; |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
0 |
Job wikiJob = this.xwiki.getWikiInitializerJob(this.context.getWikiId()); |
195 |
|
|
196 |
0 |
return wikiJob != null ? wikiJob.getStatus() : null; |
197 |
|
} |
198 |
|
|
199 |
|
|
200 |
|
@return |
201 |
|
|
202 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
203 |
1063 |
public String getVersion()... |
204 |
|
{ |
205 |
1063 |
return this.xwiki.getVersion(); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
@return |
212 |
|
@throws |
213 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
214 |
1 |
public String getRequestURL() throws XWikiException... |
215 |
|
{ |
216 |
1 |
return getXWikiContext().getURLFactory().getRequestURL(getXWikiContext()).toString(); |
217 |
|
} |
218 |
|
|
219 |
|
|
220 |
|
|
221 |
|
|
222 |
|
@return |
223 |
|
@throws |
224 |
|
@since |
225 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
226 |
8605 |
public String getRelativeRequestURL() throws XWikiException... |
227 |
|
{ |
228 |
8605 |
XWikiURLFactory urlFactory = getXWikiContext().getURLFactory(); |
229 |
|
|
230 |
8603 |
return urlFactory.getURL(urlFactory.getRequestURL(getXWikiContext()), getXWikiContext()); |
231 |
|
} |
232 |
|
|
233 |
|
|
234 |
|
|
235 |
|
|
236 |
|
@param |
237 |
|
@return |
238 |
|
@link |
239 |
|
@throws |
240 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
241 |
38286 |
public Document getDocument(String fullName) throws XWikiException... |
242 |
|
{ |
243 |
38286 |
DocumentReference reference; |
244 |
|
|
245 |
|
|
246 |
38286 |
if (fullName != null) { |
247 |
|
|
248 |
|
|
249 |
38284 |
reference = getCurrentMixedDocumentReferenceResolver().resolve(fullName); |
250 |
|
} else { |
251 |
0 |
reference = getDefaultDocumentReferenceResolver().resolve(""); |
252 |
|
} |
253 |
|
|
254 |
38287 |
return getDocument(reference); |
255 |
|
} |
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
@param |
261 |
|
@return |
262 |
|
@link |
263 |
|
@throws |
264 |
|
@since |
265 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
266 |
47414 |
public Document getDocument(DocumentReference reference) throws XWikiException... |
267 |
|
{ |
268 |
47415 |
try { |
269 |
47414 |
XWikiDocument doc = this.xwiki.getDocument(reference, getXWikiContext()); |
270 |
47416 |
if (this.xwiki.getRightService().hasAccessLevel("view", getXWikiContext().getUser(), |
271 |
|
doc.getPrefixedFullName(), getXWikiContext()) == false) { |
272 |
5 |
return null; |
273 |
|
} |
274 |
|
|
275 |
47409 |
Document newdoc = doc.newDocument(getXWikiContext()); |
276 |
47411 |
return newdoc; |
277 |
|
} catch (Exception ex) { |
278 |
0 |
LOGGER.warn("Failed to access document " + reference + ": " + ex.getMessage()); |
279 |
0 |
return new Document(new XWikiDocument(reference), getXWikiContext()); |
280 |
|
} |
281 |
|
} |
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
|
287 |
|
|
288 |
|
|
289 |
|
|
290 |
|
@param |
291 |
|
@return |
292 |
|
@link |
293 |
|
@throws |
294 |
|
@since |
295 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
296 |
988 |
public Document getDocument(EntityReference reference) throws XWikiException... |
297 |
|
{ |
298 |
988 |
return getDocument(getCurrentgetdocumentResolver().resolve(reference)); |
299 |
|
} |
300 |
|
|
301 |
|
|
302 |
|
|
303 |
|
|
304 |
|
|
305 |
|
@param |
306 |
|
@return |
307 |
|
@link |
308 |
|
@throws |
309 |
|
@since |
310 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
311 |
7 |
public Document getDocumentAsAuthor(String fullName) throws XWikiException... |
312 |
|
{ |
313 |
7 |
DocumentReference reference; |
314 |
|
|
315 |
|
|
316 |
7 |
if (fullName != null) { |
317 |
|
|
318 |
|
|
319 |
7 |
reference = getCurrentMixedDocumentReferenceResolver().resolve(fullName); |
320 |
|
} else { |
321 |
0 |
reference = getDefaultDocumentReferenceResolver().resolve(""); |
322 |
|
} |
323 |
|
|
324 |
7 |
return getDocumentAsAuthor(reference); |
325 |
|
} |
326 |
|
|
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
@param |
332 |
|
@return |
333 |
|
@link |
334 |
|
@throws |
335 |
|
@since |
336 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
337 |
7 |
public Document getDocumentAsAuthor(DocumentReference reference) throws XWikiException... |
338 |
|
{ |
339 |
7 |
String author = this.getEffectiveScriptAuthorName(); |
340 |
7 |
XWikiDocument doc = this.xwiki.getDocument(reference, getXWikiContext()); |
341 |
7 |
if (this.xwiki.getRightService().hasAccessLevel("view", author, doc.getFullName(), |
342 |
|
getXWikiContext()) == false) { |
343 |
0 |
return null; |
344 |
|
} |
345 |
|
|
346 |
7 |
Document newdoc = doc.newDocument(getXWikiContext()); |
347 |
7 |
return newdoc; |
348 |
|
} |
349 |
|
|
350 |
|
|
351 |
|
@param@link |
352 |
|
@param@link |
353 |
|
@return |
354 |
|
@throws |
355 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
356 |
304 |
public List<DeletedDocument> getDeletedDocuments(String fullname, String locale) throws XWikiException... |
357 |
|
{ |
358 |
304 |
XWikiDeletedDocument[] dds = this.xwiki.getDeletedDocuments(fullname, locale, this.context); |
359 |
302 |
if (dds == null || dds.length == 0) { |
360 |
287 |
return Collections.emptyList(); |
361 |
|
} |
362 |
15 |
List<DeletedDocument> result = new ArrayList<DeletedDocument>(dds.length); |
363 |
15 |
for (XWikiDeletedDocument dd : dds) { |
364 |
17 |
result.add(new DeletedDocument(dd, this.context)); |
365 |
|
} |
366 |
15 |
return result; |
367 |
|
} |
368 |
|
|
369 |
|
|
370 |
|
@return |
371 |
|
@param@link |
372 |
|
@param@link |
373 |
|
@throws |
374 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
375 |
0 |
public DeletedDocument getDeletedDocument(String fullname, String locale, String index) throws XWikiException... |
376 |
|
{ |
377 |
0 |
if (!NumberUtils.isDigits(index)) { |
378 |
0 |
return null; |
379 |
|
} |
380 |
0 |
XWikiDeletedDocument dd = |
381 |
|
this.xwiki.getDeletedDocument(fullname, locale, Integer.parseInt(index), this.context); |
382 |
0 |
if (dd == null) { |
383 |
0 |
return null; |
384 |
|
} |
385 |
|
|
386 |
0 |
return new DeletedDocument(dd, this.context); |
387 |
|
} |
388 |
|
|
389 |
|
|
390 |
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
@param@link |
396 |
|
@return |
397 |
|
|
398 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.4 |
|
399 |
0 |
public List<DeletedAttachment> getDeletedAttachments(String docName)... |
400 |
|
{ |
401 |
0 |
try { |
402 |
0 |
List<com.xpn.xwiki.doc.DeletedAttachment> attachments = |
403 |
|
this.xwiki.getDeletedAttachments(docName, this.context); |
404 |
0 |
if (attachments == null || attachments.isEmpty()) { |
405 |
0 |
attachments = Collections.emptyList(); |
406 |
|
} |
407 |
0 |
List<DeletedAttachment> result = new ArrayList<DeletedAttachment>(attachments.size()); |
408 |
0 |
for (com.xpn.xwiki.doc.DeletedAttachment attachment : attachments) { |
409 |
0 |
result.add(new DeletedAttachment(attachment, this.context)); |
410 |
|
} |
411 |
0 |
return result; |
412 |
|
} catch (Exception ex) { |
413 |
0 |
LOGGER.warn("Failed to retrieve deleted attachments", ex); |
414 |
|
} |
415 |
0 |
return Collections.emptyList(); |
416 |
|
} |
417 |
|
|
418 |
|
|
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
|
|
424 |
|
|
425 |
|
@param@link |
426 |
|
@param@link |
427 |
|
@return |
428 |
|
|
429 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
430 |
0 |
public List<DeletedAttachment> getDeletedAttachments(String docName, String filename)... |
431 |
|
{ |
432 |
0 |
try { |
433 |
0 |
List<com.xpn.xwiki.doc.DeletedAttachment> attachments = |
434 |
|
this.xwiki.getDeletedAttachments(docName, filename, this.context); |
435 |
0 |
if (attachments == null) { |
436 |
0 |
attachments = Collections.emptyList(); |
437 |
|
} |
438 |
0 |
List<DeletedAttachment> result = new ArrayList<DeletedAttachment>(attachments.size()); |
439 |
0 |
for (com.xpn.xwiki.doc.DeletedAttachment attachment : attachments) { |
440 |
0 |
result.add(new DeletedAttachment(attachment, this.context)); |
441 |
|
} |
442 |
0 |
return result; |
443 |
|
} catch (Exception ex) { |
444 |
0 |
LOGGER.warn("Failed to retrieve deleted attachments", ex); |
445 |
|
} |
446 |
0 |
return Collections.emptyList(); |
447 |
|
} |
448 |
|
|
449 |
|
|
450 |
|
|
451 |
|
|
452 |
|
@param |
453 |
|
@return |
454 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
455 |
0 |
public DeletedAttachment getDeletedAttachment(String id)... |
456 |
|
{ |
457 |
0 |
try { |
458 |
0 |
com.xpn.xwiki.doc.DeletedAttachment attachment = this.xwiki.getDeletedAttachment(id, this.context); |
459 |
0 |
if (attachment != null) { |
460 |
0 |
return new DeletedAttachment(attachment, this.context); |
461 |
|
} |
462 |
|
} catch (Exception ex) { |
463 |
0 |
LOGGER.warn("Failed to retrieve deleted attachment", ex); |
464 |
|
} |
465 |
0 |
return null; |
466 |
|
} |
467 |
|
|
468 |
|
|
469 |
|
|
470 |
|
|
471 |
|
@param |
472 |
|
@return |
473 |
|
@throws |
474 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
475 |
37317 |
public boolean exists(String fullname) throws XWikiException... |
476 |
|
{ |
477 |
37316 |
return this.xwiki.exists(fullname, getXWikiContext()); |
478 |
|
} |
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
@param |
484 |
|
@return |
485 |
|
@since |
486 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
487 |
1435 |
public boolean exists(DocumentReference reference) throws XWikiException... |
488 |
|
{ |
489 |
1435 |
return this.xwiki.exists(reference, getXWikiContext()); |
490 |
|
} |
491 |
|
|
492 |
|
|
493 |
|
|
494 |
|
|
495 |
|
|
496 |
|
@param |
497 |
|
@param |
498 |
|
@return |
499 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
500 |
13 |
public boolean checkAccess(String docname, String right)... |
501 |
|
{ |
502 |
13 |
try { |
503 |
13 |
DocumentReference docReference = getCurrentMixedDocumentReferenceResolver().resolve(docname); |
504 |
13 |
XWikiDocument doc = getXWikiContext().getWiki().getDocument(docReference, this.context); |
505 |
13 |
return getXWikiContext().getWiki().checkAccess(right, doc, getXWikiContext()); |
506 |
|
} catch (XWikiException e) { |
507 |
0 |
return false; |
508 |
|
} |
509 |
|
} |
510 |
|
|
511 |
|
|
512 |
|
|
513 |
|
|
514 |
|
@param |
515 |
|
@param |
516 |
|
@return |
517 |
|
@link |
518 |
|
@throws |
519 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
520 |
0 |
public Document getDocument(String space, String fullname) throws XWikiException... |
521 |
|
{ |
522 |
0 |
XWikiDocument doc = this.xwiki.getDocument(space, fullname, getXWikiContext()); |
523 |
0 |
if (this.xwiki.getRightService().hasAccessLevel("view", getXWikiContext().getUser(), doc.getFullName(), |
524 |
|
getXWikiContext()) == false) { |
525 |
0 |
return null; |
526 |
|
} |
527 |
|
|
528 |
0 |
return doc.newDocument(getXWikiContext()); |
529 |
|
} |
530 |
|
|
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
@param |
535 |
|
@param |
536 |
|
@return |
537 |
|
@throws |
538 |
|
|
|
|
| 53.8% |
Uncovered Elements: 6 (13) |
Complexity: 5 |
Complexity Density: 0.56 |
|
539 |
3 |
public Document getDocument(Document doc, String rev) throws XWikiException... |
540 |
|
{ |
541 |
3 |
if ((doc == null) || (doc.getDoc() == null)) { |
542 |
0 |
return null; |
543 |
|
} |
544 |
|
|
545 |
3 |
if (this.xwiki.getRightService().hasAccessLevel("view", getXWikiContext().getUser(), doc.getFullName(), |
546 |
|
getXWikiContext()) == false) { |
547 |
|
|
548 |
0 |
return null; |
549 |
|
} |
550 |
|
|
551 |
3 |
try { |
552 |
3 |
XWikiDocument revdoc = this.xwiki.getDocument(doc.getDoc(), rev, getXWikiContext()); |
553 |
3 |
return revdoc.newDocument(getXWikiContext()); |
554 |
|
} catch (Exception e) { |
555 |
|
|
556 |
0 |
LOGGER.error("Failed to read versioned document", e); |
557 |
|
|
558 |
0 |
return null; |
559 |
|
} |
560 |
|
} |
561 |
|
|
562 |
|
|
563 |
|
|
564 |
|
|
565 |
|
@param |
566 |
|
@return |
567 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
568 |
0 |
public String getTextArea(String content)... |
569 |
|
{ |
570 |
0 |
return com.xpn.xwiki.XWiki.getTextArea(content, getXWikiContext()); |
571 |
|
} |
572 |
|
|
573 |
|
|
574 |
|
|
575 |
|
|
576 |
|
@return |
577 |
|
@throws |
578 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
579 |
28 |
public List<String> getClassList() throws XWikiException... |
580 |
|
{ |
581 |
28 |
return this.xwiki.getClassList(getXWikiContext()); |
582 |
|
} |
583 |
|
|
584 |
|
|
585 |
|
|
586 |
|
|
587 |
|
@return |
588 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
589 |
184 |
public MetaClass getMetaclass()... |
590 |
|
{ |
591 |
184 |
return this.xwiki.getMetaclass(); |
592 |
|
} |
593 |
|
|
594 |
|
|
595 |
|
|
596 |
|
|
597 |
|
|
598 |
|
|
599 |
|
|
600 |
|
|
601 |
|
|
602 |
|
|
603 |
|
|
604 |
|
|
605 |
|
|
606 |
|
|
607 |
|
|
608 |
|
|
609 |
|
|
610 |
|
|
611 |
|
|
612 |
|
|
613 |
|
|
614 |
|
|
615 |
|
|
616 |
|
|
617 |
|
|
618 |
|
@param |
619 |
|
@return |
620 |
|
@throws |
621 |
|
@deprecated |
622 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
623 |
0 |
@Deprecated... |
624 |
|
public List<String> searchDocuments(String wheresql) throws XWikiException |
625 |
|
{ |
626 |
0 |
return this.xwiki.getStore().searchDocumentsNames(wheresql, getXWikiContext()); |
627 |
|
} |
628 |
|
|
629 |
|
|
630 |
|
|
631 |
|
|
632 |
|
|
633 |
|
@param |
634 |
|
@param |
635 |
|
@param |
636 |
|
@return |
637 |
|
@throws |
638 |
|
@see |
639 |
|
@deprecated |
640 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
641 |
0 |
@Deprecated... |
642 |
|
public List<String> searchDocuments(String wheresql, int nb, int start) throws XWikiException |
643 |
|
{ |
644 |
0 |
return this.xwiki.getStore().searchDocumentsNames(wheresql, nb, start, getXWikiContext()); |
645 |
|
} |
646 |
|
|
647 |
|
|
648 |
|
|
649 |
|
|
650 |
|
|
651 |
|
|
652 |
|
@param |
653 |
|
@param |
654 |
|
@param |
655 |
|
@param |
656 |
|
@return |
657 |
|
@throws |
658 |
|
@deprecated |
659 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
660 |
0 |
@Deprecated... |
661 |
|
public List<String> searchDocuments(String wheresql, int nb, int start, String selectColumns) throws XWikiException |
662 |
|
{ |
663 |
0 |
if (hasProgrammingRights()) { |
664 |
0 |
return this.xwiki.getStore().searchDocumentsNames(wheresql, nb, start, selectColumns, getXWikiContext()); |
665 |
|
} |
666 |
|
|
667 |
0 |
return Collections.emptyList(); |
668 |
|
} |
669 |
|
|
670 |
|
|
671 |
|
|
672 |
|
|
673 |
|
@param |
674 |
|
@param |
675 |
|
@return |
676 |
|
@throws |
677 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
678 |
0 |
public List<Document> searchDocuments(String wheresql, boolean distinctbylocale) throws XWikiException... |
679 |
|
{ |
680 |
0 |
return convert(this.xwiki.getStore().searchDocuments(wheresql, distinctbylocale, getXWikiContext())); |
681 |
|
} |
682 |
|
|
683 |
|
|
684 |
|
|
685 |
|
|
686 |
|
@param |
687 |
|
@param |
688 |
|
@return |
689 |
|
@param |
690 |
|
@param |
691 |
|
@throws |
692 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
693 |
0 |
public List<Document> searchDocuments(String wheresql, boolean distinctbylocale, int nb, int start)... |
694 |
|
throws XWikiException |
695 |
|
{ |
696 |
0 |
return convert(this.xwiki.getStore().searchDocuments(wheresql, distinctbylocale, nb, start, getXWikiContext())); |
697 |
|
} |
698 |
|
|
699 |
|
|
700 |
|
|
701 |
|
|
702 |
|
|
703 |
|
|
704 |
|
|
705 |
|
|
706 |
|
|
707 |
|
|
708 |
|
|
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
|
714 |
|
|
715 |
|
|
716 |
|
@param |
717 |
|
|
718 |
|
@param |
719 |
|
@param |
720 |
|
@param |
721 |
|
@return |
722 |
|
@throws |
723 |
|
@deprecated |
724 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
725 |
0 |
@Deprecated... |
726 |
|
public List<String> searchDocuments(String parameterizedWhereClause, int maxResults, int startOffset, |
727 |
|
List<?> parameterValues) throws XWikiException |
728 |
|
{ |
729 |
0 |
return this.xwiki.getStore().searchDocumentsNames(parameterizedWhereClause, maxResults, startOffset, |
730 |
|
parameterValues, getXWikiContext()); |
731 |
|
} |
732 |
|
|
733 |
|
|
734 |
|
@link |
735 |
|
|
736 |
|
@see |
737 |
|
@deprecated |
738 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
739 |
0 |
@Deprecated... |
740 |
|
public List<String> searchDocuments(String parameterizedWhereClause, List<?> parameterValues) throws XWikiException |
741 |
|
{ |
742 |
0 |
return this.xwiki.getStore().searchDocumentsNames(parameterizedWhereClause, parameterValues, getXWikiContext()); |
743 |
|
} |
744 |
|
|
745 |
|
|
746 |
|
|
747 |
|
@link |
748 |
|
|
749 |
|
@param |
750 |
|
@param |
751 |
|
|
752 |
|
@param |
753 |
|
@param |
754 |
|
@param |
755 |
|
@return |
756 |
|
@see |
757 |
|
@throws |
758 |
|
@deprecated |
759 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
760 |
0 |
@Deprecated... |
761 |
|
public List<String> searchDocumentsNames(String wikiName, String parameterizedWhereClause, int maxResults, |
762 |
|
int startOffset, List<?> parameterValues) throws XWikiException |
763 |
|
{ |
764 |
0 |
String database = this.context.getWikiId(); |
765 |
|
|
766 |
0 |
try { |
767 |
0 |
this.context.setWikiId(wikiName); |
768 |
|
|
769 |
0 |
return searchDocuments(parameterizedWhereClause, maxResults, startOffset, parameterValues); |
770 |
|
} finally { |
771 |
0 |
this.context.setWikiId(database); |
772 |
|
} |
773 |
|
} |
774 |
|
|
775 |
|
|
776 |
|
|
777 |
|
@link |
778 |
|
|
779 |
|
@param |
780 |
|
|
781 |
|
@param |
782 |
|
@param |
783 |
|
@param |
784 |
|
@return |
785 |
|
@throws |
786 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
787 |
0 |
public List<String> searchSpacesNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues)... |
788 |
|
throws XWikiException |
789 |
|
{ |
790 |
0 |
return this.xwiki.getStore().search("select distinct doc.space from XWikiDocument doc " + parametrizedSqlClause, |
791 |
|
nb, start, parameterValues, this.context); |
792 |
|
} |
793 |
|
|
794 |
|
|
795 |
|
|
796 |
|
@link |
797 |
|
|
798 |
|
|
799 |
|
@param |
800 |
|
|
801 |
|
@param |
802 |
|
@param |
803 |
|
@param@link |
804 |
|
@return@link |
805 |
|
@throws |
806 |
|
@since |
807 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
808 |
2 |
public List<Attachment> searchAttachments(String parametrizedSqlClause, int nb, int start, List<?> parameterValues)... |
809 |
|
throws XWikiException |
810 |
|
{ |
811 |
2 |
return convertAttachments( |
812 |
|
this.xwiki.searchAttachments(parametrizedSqlClause, true, nb, start, parameterValues, this.context)); |
813 |
|
} |
814 |
|
|
815 |
|
|
816 |
|
|
817 |
|
|
818 |
|
@param |
819 |
|
@link |
820 |
|
@param@link |
821 |
|
@return |
822 |
|
@throws |
823 |
|
@see |
824 |
|
@since |
825 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
826 |
2 |
public int countAttachments(String parametrizedSqlClause, List<?> parameterValues) throws XWikiException... |
827 |
|
{ |
828 |
2 |
return this.xwiki.countAttachments(parametrizedSqlClause, parameterValues, this.context); |
829 |
|
} |
830 |
|
|
831 |
|
|
832 |
|
|
833 |
|
|
834 |
|
@param |
835 |
|
@return |
836 |
|
|
|
|
| 88% |
Uncovered Elements: 3 (25) |
Complexity: 7 |
Complexity Density: 0.47 |
|
837 |
6 |
public List<Document> wrapDocs(List<?> docs)... |
838 |
|
{ |
839 |
6 |
List<Document> result = new ArrayList<Document>(); |
840 |
6 |
if (docs != null) { |
841 |
6 |
for (java.lang.Object obj : docs) { |
842 |
8 |
try { |
843 |
8 |
if (obj instanceof XWikiDocument) { |
844 |
4 |
XWikiDocument doc = (XWikiDocument) obj; |
845 |
4 |
Document wrappedDoc = doc.newDocument(getXWikiContext()); |
846 |
4 |
result.add(wrappedDoc); |
847 |
4 |
} else if (obj instanceof Document) { |
848 |
2 |
result.add((Document) obj); |
849 |
2 |
} else if (obj instanceof String) { |
850 |
2 |
Document doc = getDocument(obj.toString()); |
851 |
2 |
if (doc != null) { |
852 |
2 |
result.add(doc); |
853 |
|
} |
854 |
|
} |
855 |
|
} catch (XWikiException ex) { |
856 |
|
} |
857 |
|
} |
858 |
|
} |
859 |
|
|
860 |
6 |
return result; |
861 |
|
} |
862 |
|
|
863 |
|
|
864 |
|
|
865 |
|
|
866 |
|
@param |
867 |
|
@return |
868 |
|
@deprecated |
869 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
870 |
0 |
@Deprecated... |
871 |
|
public String parseContent(String content) |
872 |
|
{ |
873 |
0 |
return this.xwiki.parseContent(content, getXWikiContext()); |
874 |
|
} |
875 |
|
|
876 |
|
|
877 |
|
|
878 |
|
|
879 |
|
|
880 |
|
|
881 |
|
@param |
882 |
|
@return |
883 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
884 |
71458 |
public String parseTemplate(String template)... |
885 |
|
{ |
886 |
71455 |
return this.xwiki.parseTemplate(template, getXWikiContext()); |
887 |
|
} |
888 |
|
|
889 |
|
|
890 |
|
|
891 |
|
|
892 |
|
|
893 |
|
|
894 |
|
@param |
895 |
|
@return |
896 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
897 |
0 |
public String renderTemplate(String template)... |
898 |
|
{ |
899 |
0 |
return this.xwiki.renderTemplate(template, getXWikiContext()); |
900 |
|
} |
901 |
|
|
902 |
|
|
903 |
|
|
904 |
|
|
905 |
|
|
906 |
|
@param |
907 |
|
@return |
908 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
909 |
0 |
public String invokeServletAndReturnAsString(String url)... |
910 |
|
{ |
911 |
0 |
return this.xwiki.invokeServletAndReturnAsString(url, getXWikiContext()); |
912 |
|
} |
913 |
|
|
914 |
|
|
915 |
|
|
916 |
|
|
917 |
|
|
918 |
|
|
919 |
|
@param |
920 |
|
@return |
921 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
922 |
14424 |
public String getSkinFile(String filename)... |
923 |
|
{ |
924 |
14423 |
return this.xwiki.getSkinFile(filename, getXWikiContext()); |
925 |
|
} |
926 |
|
|
927 |
|
|
928 |
|
|
929 |
|
|
930 |
|
|
931 |
|
|
932 |
|
@param |
933 |
|
@param |
934 |
|
|
935 |
|
@return |
936 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
937 |
7248 |
public String getSkinFile(String filename, boolean forceSkinAction)... |
938 |
|
{ |
939 |
7248 |
return this.xwiki.getSkinFile(filename, forceSkinAction, getXWikiContext()); |
940 |
|
} |
941 |
|
|
942 |
|
|
943 |
|
|
944 |
|
|
945 |
|
|
946 |
|
|
947 |
|
|
948 |
|
|
949 |
|
|
950 |
|
@return |
951 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
952 |
9003 |
public String getSkin()... |
953 |
|
{ |
954 |
9002 |
return this.xwiki.getSkin(getXWikiContext()); |
955 |
|
} |
956 |
|
|
957 |
|
|
958 |
|
|
959 |
|
|
960 |
|
|
961 |
|
|
962 |
|
@return |
963 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
964 |
0 |
public String getBaseSkin()... |
965 |
|
{ |
966 |
0 |
return this.xwiki.getBaseSkin(getXWikiContext()); |
967 |
|
} |
968 |
|
|
969 |
|
|
970 |
|
|
971 |
|
|
972 |
|
|
973 |
|
@return |
974 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
975 |
6827 |
public String getSpaceCopyright()... |
976 |
|
{ |
977 |
6827 |
return this.xwiki.getSpaceCopyright(getXWikiContext()); |
978 |
|
} |
979 |
|
|
980 |
|
|
981 |
|
|
982 |
|
|
983 |
|
|
984 |
|
@param |
985 |
|
@return |
986 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
987 |
2240 |
public String getXWikiPreference(String preference)... |
988 |
|
{ |
989 |
2234 |
return this.xwiki.getXWikiPreference(preference, getXWikiContext()); |
990 |
|
} |
991 |
|
|
992 |
|
|
993 |
|
|
994 |
|
|
995 |
|
|
996 |
|
@param |
997 |
|
@param |
998 |
|
@return |
999 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1000 |
0 |
public String getXWikiPreference(String preference, String defaultValue)... |
1001 |
|
{ |
1002 |
0 |
return this.xwiki.getXWikiPreference(preference, defaultValue, getXWikiContext()); |
1003 |
|
} |
1004 |
|
|
1005 |
|
|
1006 |
|
|
1007 |
|
|
1008 |
|
|
1009 |
|
|
1010 |
|
@param |
1011 |
|
@return |
1012 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1013 |
44821 |
public String getSpacePreference(String preference)... |
1014 |
|
{ |
1015 |
44821 |
return this.xwiki.getSpacePreference(preference, getXWikiContext()); |
1016 |
|
} |
1017 |
|
|
1018 |
|
|
1019 |
|
|
1020 |
|
|
1021 |
|
|
1022 |
|
|
1023 |
|
@param |
1024 |
|
@param |
1025 |
|
@return |
1026 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1027 |
0 |
public String getSpacePreference(String preference, String defaultValue)... |
1028 |
|
{ |
1029 |
0 |
return this.xwiki.getSpacePreference(preference, defaultValue, getXWikiContext()); |
1030 |
|
} |
1031 |
|
|
1032 |
|
|
1033 |
|
|
1034 |
|
|
1035 |
|
@param |
1036 |
|
@return |
1037 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1038 |
0 |
public String getSkinPreference(String preference)... |
1039 |
|
{ |
1040 |
0 |
return this.xwiki.getSkinPreference(preference, getXWikiContext()); |
1041 |
|
} |
1042 |
|
|
1043 |
|
|
1044 |
|
|
1045 |
|
|
1046 |
|
@param |
1047 |
|
@param |
1048 |
|
@return |
1049 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1050 |
1063 |
public String getSkinPreference(String preference, String defaultValue)... |
1051 |
|
{ |
1052 |
1062 |
return this.xwiki.getSkinPreference(preference, defaultValue, getXWikiContext()); |
1053 |
|
} |
1054 |
|
|
1055 |
|
|
1056 |
|
|
1057 |
|
|
1058 |
|
|
1059 |
|
|
1060 |
|
@param |
1061 |
|
@param |
1062 |
|
@return |
1063 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1064 |
0 |
public String getSpacePreferenceFor(String preference, String space)... |
1065 |
|
{ |
1066 |
0 |
return getSpacePreferenceFor(preference, space, ""); |
1067 |
|
} |
1068 |
|
|
1069 |
|
|
1070 |
|
|
1071 |
|
|
1072 |
|
|
1073 |
|
|
1074 |
|
@param |
1075 |
|
@param |
1076 |
|
@param |
1077 |
|
@return |
1078 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1079 |
0 |
public String getSpacePreferenceFor(String preference, String space, String defaultValue)... |
1080 |
|
{ |
1081 |
0 |
return this.xwiki.getSpacePreference(preference, space, defaultValue, getXWikiContext()); |
1082 |
|
} |
1083 |
|
|
1084 |
|
|
1085 |
|
|
1086 |
|
|
1087 |
|
|
1088 |
|
|
1089 |
|
@param |
1090 |
|
@param |
1091 |
|
@return |
1092 |
|
@since |
1093 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1094 |
0 |
public String getSpacePreferenceFor(String preference, SpaceReference spaceReference)... |
1095 |
|
{ |
1096 |
0 |
return this.xwiki.getSpacePreference(preference, spaceReference, getXWikiContext()); |
1097 |
|
} |
1098 |
|
|
1099 |
|
|
1100 |
|
|
1101 |
|
|
1102 |
|
|
1103 |
|
|
1104 |
|
@param |
1105 |
|
@param |
1106 |
|
@param |
1107 |
|
@return |
1108 |
|
@since |
1109 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1110 |
0 |
public String getSpacePreferenceFor(String preference, SpaceReference spaceReference, String defaultValue)... |
1111 |
|
{ |
1112 |
0 |
return this.xwiki.getSpacePreference(preference, spaceReference, defaultValue, getXWikiContext()); |
1113 |
|
} |
1114 |
|
|
1115 |
|
|
1116 |
|
|
1117 |
|
|
1118 |
|
|
1119 |
|
@param |
1120 |
|
@param |
1121 |
|
@return |
1122 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1123 |
0 |
public long getXWikiPreferenceAsLong(String preference, long defaultValue)... |
1124 |
|
{ |
1125 |
0 |
return this.xwiki.getXWikiPreferenceAsLong(preference, defaultValue, getXWikiContext()); |
1126 |
|
} |
1127 |
|
|
1128 |
|
|
1129 |
|
|
1130 |
|
|
1131 |
|
|
1132 |
|
@param |
1133 |
|
@return |
1134 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1135 |
0 |
public long getXWikiPreferenceAsLong(String preference)... |
1136 |
|
{ |
1137 |
0 |
return this.xwiki.getXWikiPreferenceAsLong(preference, getXWikiContext()); |
1138 |
|
} |
1139 |
|
|
1140 |
|
|
1141 |
|
|
1142 |
|
|
1143 |
|
|
1144 |
|
|
1145 |
|
@param |
1146 |
|
@param |
1147 |
|
@return |
1148 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1149 |
0 |
public long getSpacePreferenceAsLong(String preference, long defaultValue)... |
1150 |
|
{ |
1151 |
0 |
return this.xwiki.getSpacePreferenceAsLong(preference, defaultValue, getXWikiContext()); |
1152 |
|
} |
1153 |
|
|
1154 |
|
|
1155 |
|
|
1156 |
|
|
1157 |
|
|
1158 |
|
|
1159 |
|
@param |
1160 |
|
@return |
1161 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1162 |
0 |
public long getSpacePreferenceAsLong(String preference)... |
1163 |
|
{ |
1164 |
0 |
return this.xwiki.getSpacePreferenceAsLong(preference, getXWikiContext()); |
1165 |
|
} |
1166 |
|
|
1167 |
|
|
1168 |
|
|
1169 |
|
|
1170 |
|
|
1171 |
|
@param |
1172 |
|
@param |
1173 |
|
@return |
1174 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1175 |
118 |
public int getXWikiPreferenceAsInt(String preference, int defaultValue)... |
1176 |
|
{ |
1177 |
118 |
return this.xwiki.getXWikiPreferenceAsInt(preference, defaultValue, getXWikiContext()); |
1178 |
|
} |
1179 |
|
|
1180 |
|
|
1181 |
|
|
1182 |
|
|
1183 |
|
|
1184 |
|
@param |
1185 |
|
@return |
1186 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1187 |
0 |
public int getXWikiPreferenceAsInt(String preference)... |
1188 |
|
{ |
1189 |
0 |
return this.xwiki.getXWikiPreferenceAsInt(preference, getXWikiContext()); |
1190 |
|
} |
1191 |
|
|
1192 |
|
|
1193 |
|
|
1194 |
|
|
1195 |
|
|
1196 |
|
|
1197 |
|
@param |
1198 |
|
@param |
1199 |
|
@return |
1200 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1201 |
572 |
public int getSpacePreferenceAsInt(String preference, int defaultValue)... |
1202 |
|
{ |
1203 |
572 |
return this.xwiki.getSpacePreferenceAsInt(preference, defaultValue, getXWikiContext()); |
1204 |
|
} |
1205 |
|
|
1206 |
|
|
1207 |
|
|
1208 |
|
|
1209 |
|
|
1210 |
|
|
1211 |
|
@param |
1212 |
|
@return |
1213 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1214 |
0 |
public int getSpacePreferenceAsInt(String preference)... |
1215 |
|
{ |
1216 |
0 |
return this.xwiki.getSpacePreferenceAsInt(preference, getXWikiContext()); |
1217 |
|
} |
1218 |
|
|
1219 |
|
|
1220 |
|
|
1221 |
|
|
1222 |
|
|
1223 |
|
@param |
1224 |
|
@return |
1225 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1226 |
4797 |
public String getUserPreference(String preference)... |
1227 |
|
{ |
1228 |
4796 |
return this.xwiki.getUserPreference(preference, getXWikiContext()); |
1229 |
|
} |
1230 |
|
|
1231 |
|
|
1232 |
|
|
1233 |
|
|
1234 |
|
@param |
1235 |
|
@return |
1236 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1237 |
0 |
public String getUserPreferenceFromCookie(String preference)... |
1238 |
|
{ |
1239 |
0 |
return this.xwiki.getUserPreferenceFromCookie(preference, getXWikiContext()); |
1240 |
|
} |
1241 |
|
|
1242 |
|
|
1243 |
|
@link |
1244 |
|
|
1245 |
|
@return |
1246 |
|
@deprecated@link |
1247 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1248 |
0 |
@Deprecated... |
1249 |
|
public String getLanguagePreference() |
1250 |
|
{ |
1251 |
0 |
return this.xwiki.getLanguagePreference(getXWikiContext()); |
1252 |
|
} |
1253 |
|
|
1254 |
|
|
1255 |
|
|
1256 |
|
|
1257 |
|
|
1258 |
|
|
1259 |
|
|
1260 |
|
|
1261 |
|
@return |
1262 |
|
@since |
1263 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1264 |
0 |
public Locale getLocalePreference()... |
1265 |
|
{ |
1266 |
0 |
return this.xwiki.getLocalePreference(getXWikiContext()); |
1267 |
|
} |
1268 |
|
|
1269 |
|
|
1270 |
|
@link |
1271 |
|
|
1272 |
|
@return |
1273 |
|
@deprecated@link |
1274 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1275 |
0 |
@Deprecated... |
1276 |
|
public String getInterfaceLanguagePreference() |
1277 |
|
{ |
1278 |
0 |
return this.xwiki.getInterfaceLanguagePreference(getXWikiContext()); |
1279 |
|
} |
1280 |
|
|
1281 |
|
|
1282 |
|
|
1283 |
|
|
1284 |
|
|
1285 |
|
|
1286 |
|
@return |
1287 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1288 |
0 |
public Locale getInterfaceLocalePreference()... |
1289 |
|
{ |
1290 |
0 |
return this.xwiki.getInterfaceLocalePreference(getXWikiContext()); |
1291 |
|
} |
1292 |
|
|
1293 |
|
|
1294 |
|
@return |
1295 |
|
|
1296 |
|
|
1297 |
|
@see |
1298 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
1299 |
49 |
public List<String> getWikiNames()... |
1300 |
|
{ |
1301 |
49 |
List<String> result = new ArrayList<String>(); |
1302 |
|
|
1303 |
49 |
try { |
1304 |
49 |
result = this.xwiki.getVirtualWikisDatabaseNames(getXWikiContext()); |
1305 |
|
} catch (Exception e) { |
1306 |
0 |
LOGGER.error("Failed to get the list of all wiki names", e); |
1307 |
|
} |
1308 |
|
|
1309 |
49 |
return result; |
1310 |
|
} |
1311 |
|
|
1312 |
|
|
1313 |
|
|
1314 |
|
|
1315 |
|
@return |
1316 |
|
@see |
1317 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1318 |
49 |
public boolean hasSubWikis()... |
1319 |
|
{ |
1320 |
49 |
return getWikiNames().size() > 1; |
1321 |
|
} |
1322 |
|
|
1323 |
|
|
1324 |
|
|
1325 |
|
|
1326 |
|
@return |
1327 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1328 |
9226 |
public boolean isMultiLingual()... |
1329 |
|
{ |
1330 |
9226 |
return this.xwiki.isMultiLingual(getXWikiContext()); |
1331 |
|
} |
1332 |
|
|
1333 |
|
|
1334 |
|
|
1335 |
|
|
1336 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1337 |
0 |
public void flushCache()... |
1338 |
|
{ |
1339 |
0 |
if (hasProgrammingRights()) { |
1340 |
0 |
this.xwiki.flushCache(getXWikiContext()); |
1341 |
|
} |
1342 |
|
} |
1343 |
|
|
1344 |
|
|
1345 |
|
|
1346 |
|
|
1347 |
|
@return |
1348 |
|
|
1349 |
|
|
1350 |
|
|
1351 |
|
|
1352 |
|
|
1353 |
|
|
1354 |
|
|
1355 |
|
@throws |
1356 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1357 |
0 |
public int createUser() throws XWikiException... |
1358 |
|
{ |
1359 |
0 |
return createUser(false, "edit"); |
1360 |
|
} |
1361 |
|
|
1362 |
|
|
1363 |
|
|
1364 |
|
|
1365 |
|
|
1366 |
|
@param |
1367 |
|
@return |
1368 |
|
|
1369 |
|
|
1370 |
|
|
1371 |
|
|
1372 |
|
|
1373 |
|
|
1374 |
|
|
1375 |
|
@throws |
1376 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1377 |
0 |
public int createUser(boolean withValidation) throws XWikiException... |
1378 |
|
{ |
1379 |
0 |
return createUser(withValidation, "edit"); |
1380 |
|
} |
1381 |
|
|
1382 |
|
|
1383 |
|
|
1384 |
|
|
1385 |
|
|
1386 |
|
|
1387 |
|
|
1388 |
|
|
1389 |
|
@param |
1390 |
|
@param |
1391 |
|
@return |
1392 |
|
|
1393 |
|
|
1394 |
|
|
1395 |
|
|
1396 |
|
|
1397 |
|
|
1398 |
|
|
1399 |
|
@throws |
1400 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
1401 |
0 |
public int createUser(boolean withValidation, String userRights) throws XWikiException... |
1402 |
|
{ |
1403 |
0 |
boolean registerRight; |
1404 |
0 |
try { |
1405 |
|
|
1406 |
|
|
1407 |
0 |
if (hasProgrammingRights()) { |
1408 |
0 |
registerRight = true; |
1409 |
|
} else { |
1410 |
0 |
registerRight = this.xwiki.getRightService().hasAccessLevel("register", getXWikiContext().getUser(), |
1411 |
|
"XWiki.XWikiPreferences", getXWikiContext()); |
1412 |
|
} |
1413 |
|
|
1414 |
0 |
if (registerRight) { |
1415 |
0 |
return this.xwiki.createUser(withValidation, userRights, getXWikiContext()); |
1416 |
|
} |
1417 |
|
|
1418 |
0 |
return -1; |
1419 |
|
} catch (Exception e) { |
1420 |
0 |
LOGGER.error("Failed to create user", e); |
1421 |
|
|
1422 |
0 |
return -10; |
1423 |
|
} |
1424 |
|
|
1425 |
|
} |
1426 |
|
|
1427 |
|
|
1428 |
|
|
1429 |
|
|
1430 |
|
|
1431 |
|
@param |
1432 |
|
@return |
1433 |
|
@throws |
1434 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1435 |
0 |
public int validateUser(boolean withConfirmEmail) throws XWikiException... |
1436 |
|
{ |
1437 |
0 |
return this.xwiki.validateUser(withConfirmEmail, getXWikiContext()); |
1438 |
|
} |
1439 |
|
|
1440 |
|
|
1441 |
|
|
1442 |
|
|
1443 |
|
@param |
1444 |
|
@throws |
1445 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1446 |
0 |
public void addToAllGroup(String fullwikiname) throws XWikiException... |
1447 |
|
{ |
1448 |
0 |
if (hasProgrammingRights()) { |
1449 |
0 |
this.xwiki.setUserDefaultGroup(fullwikiname, getXWikiContext()); |
1450 |
|
} |
1451 |
|
} |
1452 |
|
|
1453 |
|
|
1454 |
|
|
1455 |
|
|
1456 |
|
@param |
1457 |
|
@param |
1458 |
|
@param |
1459 |
|
@param |
1460 |
|
@param |
1461 |
|
@throws |
1462 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1463 |
0 |
public void sendConfirmationMail(String xwikiname, String password, String email, String add_message,... |
1464 |
|
String contentfield) throws XWikiException |
1465 |
|
{ |
1466 |
0 |
if (hasProgrammingRights()) { |
1467 |
0 |
this.xwiki.sendConfirmationEmail(xwikiname, password, email, add_message, contentfield, getXWikiContext()); |
1468 |
|
} |
1469 |
|
} |
1470 |
|
|
1471 |
|
|
1472 |
|
|
1473 |
|
|
1474 |
|
@param |
1475 |
|
@param |
1476 |
|
@param |
1477 |
|
@param |
1478 |
|
@throws |
1479 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1480 |
0 |
public void sendConfirmationMail(String xwikiname, String password, String email, String contentfield)... |
1481 |
|
throws XWikiException |
1482 |
|
{ |
1483 |
0 |
if (hasProgrammingRights()) { |
1484 |
0 |
this.xwiki.sendConfirmationEmail(xwikiname, password, email, "", contentfield, getXWikiContext()); |
1485 |
|
} |
1486 |
|
} |
1487 |
|
|
1488 |
|
|
1489 |
|
|
1490 |
|
|
1491 |
|
@param |
1492 |
|
@param |
1493 |
|
@return |
1494 |
|
@throws |
1495 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1496 |
3 |
public boolean copyDocument(String docname, String targetdocname) throws XWikiException... |
1497 |
|
{ |
1498 |
3 |
return this.copyDocument(docname, targetdocname, null, null, null, false, false); |
1499 |
|
} |
1500 |
|