1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.internal.skin; |
21 |
|
|
22 |
|
import java.net.URL; |
23 |
|
|
24 |
|
import javax.inject.Provider; |
25 |
|
|
26 |
|
import org.xwiki.filter.input.StringInputSource; |
27 |
|
import org.xwiki.model.reference.DocumentReference; |
28 |
|
import org.xwiki.model.reference.ObjectPropertyReference; |
29 |
|
import org.xwiki.skin.ResourceRepository; |
30 |
|
|
31 |
|
import com.xpn.xwiki.XWikiContext; |
32 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
33 |
|
import com.xpn.xwiki.web.XWikiURLFactory; |
34 |
|
|
35 |
|
|
36 |
|
@version |
37 |
|
@since |
38 |
|
|
|
|
| 50% |
Uncovered Elements: 5 (10) |
Complexity: 3 |
Complexity Density: 0.43 |
|
39 |
|
public class ObjectPropertyWikiResource extends AbstractWikiResource<ObjectPropertyReference, StringInputSource> |
40 |
|
{ |
41 |
|
private final String content; |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
43 |
2 |
public ObjectPropertyWikiResource(String path, ResourceRepository repository, ObjectPropertyReference reference,... |
44 |
|
DocumentReference authorReference, Provider<XWikiContext> xcontextProvider, String content) |
45 |
|
{ |
46 |
2 |
super(path, path, reference.getName(), repository, reference, authorReference, xcontextProvider); |
47 |
|
|
48 |
2 |
this.content = content; |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
2 |
@Override... |
52 |
|
protected StringInputSource getInputSourceInternal(XWikiDocument document) |
53 |
|
{ |
54 |
2 |
return new StringInputSource(this.content); |
55 |
|
} |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
57 |
0 |
@Override... |
58 |
|
public String getURL(XWikiDocument document) throws Exception |
59 |
|
{ |
60 |
0 |
XWikiContext xcontext = this.xcontextProvider.get(); |
61 |
|
|
62 |
0 |
XWikiURLFactory urlf = xcontext.getURLFactory(); |
63 |
|
|
64 |
0 |
URL url = urlf.createSkinURL(this.reference.getName(), document.getSpace(), document.getName(), |
65 |
|
document.getDatabase(), xcontext); |
66 |
0 |
return urlf.getURL(url, xcontext); |
67 |
|
} |
68 |
|
} |