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.skinx; |
22 |
|
|
23 |
|
import java.util.Collections; |
24 |
|
import java.util.Set; |
25 |
|
|
26 |
|
import org.apache.commons.lang3.StringUtils; |
27 |
|
|
28 |
|
import com.xpn.xwiki.XWikiContext; |
29 |
|
import com.xpn.xwiki.api.Api; |
30 |
|
import com.xpn.xwiki.plugin.XWikiPluginInterface; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 9 |
Complexity Density: 0.6 |
|
38 |
|
public class CssSkinFileExtensionPlugin extends AbstractSkinExtensionPlugin |
39 |
|
{ |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
public static final String PLUGIN_NAME = "ssfx"; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@param |
50 |
|
@param |
51 |
|
@param |
52 |
|
@see |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
32 |
public CssSkinFileExtensionPlugin(String name, String className, XWikiContext context)... |
55 |
|
{ |
56 |
32 |
super(name, className, context); |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
5507 |
@Override... |
60 |
|
public String getName() |
61 |
|
{ |
62 |
5507 |
return PLUGIN_NAME; |
63 |
|
} |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
5443 |
@Override... |
66 |
|
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context) |
67 |
|
{ |
68 |
5443 |
return new SkinFileExtensionPluginApi((AbstractSkinExtensionPlugin) plugin, context); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
71 |
5225 |
@Override... |
72 |
|
public String getLink(String filename, XWikiContext context) |
73 |
|
{ |
74 |
5226 |
boolean forceSkinAction = (Boolean) getParametersForResource(filename, context).get("forceSkinAction"); |
75 |
5226 |
StringBuilder result = new StringBuilder("<link rel='stylesheet' type='text/css' href='"); |
76 |
5226 |
result.append(context.getWiki().getSkinFile(filename, forceSkinAction, context)); |
77 |
5227 |
if (forceSkinAction) { |
78 |
5202 |
String parameters = StringUtils.removeStart(parametersAsQueryString(filename, context), "&"); |
79 |
5200 |
if (!StringUtils.isEmpty(parameters)) { |
80 |
1404 |
result.append("?").append(parameters); |
81 |
|
} |
82 |
|
} |
83 |
5227 |
result.append("'/>"); |
84 |
5225 |
return result.toString(); |
85 |
|
} |
86 |
|
|
87 |
|
|
88 |
|
@inheritDoc |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
@see |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
6892 |
@Override... |
97 |
|
public String endParsing(String content, XWikiContext context) |
98 |
|
{ |
99 |
6892 |
return super.endParsing(content, context); |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
@inheritDoc |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
@see |
109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
6890 |
@Override... |
111 |
|
public Set<String> getAlwaysUsedExtensions(XWikiContext context) |
112 |
|
{ |
113 |
6891 |
return Collections.emptySet(); |
114 |
|
} |
115 |
|
|
116 |
|
|
117 |
|
@inheritDoc |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
@see |
123 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
6891 |
@Override... |
125 |
|
public boolean hasPageExtensions(XWikiContext context) |
126 |
|
{ |
127 |
6892 |
return false; |
128 |
|
} |
129 |
|
} |