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.skinx; |
21 |
|
|
22 |
|
import org.xwiki.model.reference.DocumentReference; |
23 |
|
import org.xwiki.model.reference.LocalDocumentReference; |
24 |
|
|
25 |
|
import com.xpn.xwiki.XWikiContext; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@version |
32 |
|
|
|
|
| 76.5% |
Uncovered Elements: 4 (17) |
Complexity: 7 |
Complexity Density: 0.78 |
|
33 |
|
public class CssSkinExtensionPlugin extends AbstractDocumentSkinExtensionPlugin |
34 |
|
{ |
35 |
|
|
36 |
|
public static final String SSX_CLASS_NAME = "XWiki.StyleSheetExtension"; |
37 |
|
|
38 |
|
|
39 |
|
public static final LocalDocumentReference SSX_CLASS_REFERENCE = new LocalDocumentReference("XWiki", |
40 |
|
"StyleSheetExtension"); |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
public static final String PLUGIN_NAME = "ssx"; |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
@param |
53 |
|
@param |
54 |
|
@see |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
32 |
public CssSkinExtensionPlugin(String name, String className, XWikiContext context)... |
57 |
|
{ |
58 |
32 |
super(PLUGIN_NAME, className, context); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
@inheritDoc |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@see |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
4 |
@Override... |
71 |
|
public void virtualInit(XWikiContext context) |
72 |
|
{ |
73 |
4 |
super.virtualInit(context); |
74 |
|
} |
75 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
76 |
11195 |
@Override... |
77 |
|
public String getLink(String documentName, XWikiContext context) |
78 |
|
{ |
79 |
11195 |
DocumentReference documentReference = getCurrentDocumentReferenceResolver().resolve(documentName); |
80 |
11195 |
if (!isAccessible(documentReference, context)) { |
81 |
|
|
82 |
|
|
83 |
0 |
return ""; |
84 |
|
} |
85 |
|
|
86 |
11195 |
return String.format("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />", |
87 |
|
getDocumentSkinExtensionURL(documentReference, documentName, PLUGIN_NAME, context)); |
88 |
|
} |
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
9074 |
@Override... |
91 |
|
protected String getExtensionClassName() |
92 |
|
{ |
93 |
9076 |
return SSX_CLASS_NAME; |
94 |
|
} |
95 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
0 |
@Override... |
97 |
|
protected String getExtensionName() |
98 |
|
{ |
99 |
0 |
return "Stylesheet"; |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
@inheritDoc |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
@see |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
111 |
6893 |
@Override... |
112 |
|
public String endParsing(String content, XWikiContext context) |
113 |
|
{ |
114 |
6893 |
return super.endParsing(content, context); |
115 |
|
} |
116 |
|
} |