1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.url.internal.standard; |
21 |
|
|
22 |
|
import javax.inject.Inject; |
23 |
|
import javax.inject.Named; |
24 |
|
import javax.inject.Singleton; |
25 |
|
|
26 |
|
import org.xwiki.component.annotation.Component; |
27 |
|
import org.xwiki.configuration.ConfigurationSource; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
35 |
|
@Component |
36 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 10 |
Complexity Density: 1 |
|
37 |
|
public class DefaultStandardURLConfiguration implements StandardURLConfiguration |
38 |
|
{ |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private static final String PREFIX = "url.standard."; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
@Inject |
48 |
|
@Named("xwikiproperties") |
49 |
|
private ConfigurationSource configuration; |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
5 |
@Override... |
52 |
|
public boolean isPathBasedMultiWiki() |
53 |
|
{ |
54 |
5 |
return isPathBasedMultiWiki(Boolean.TRUE); |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
@param |
61 |
|
@return@link |
62 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
5 |
protected boolean isPathBasedMultiWiki(Boolean defaultValue)... |
64 |
|
{ |
65 |
5 |
return this.configuration.getProperty(PREFIX + "multiwiki.isPathBased", defaultValue); |
66 |
|
} |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
33 |
@Override... |
69 |
|
public String getWikiPathPrefix() |
70 |
|
{ |
71 |
33 |
return getWikiPathPrefix("wiki"); |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
62 |
@Override... |
75 |
|
public WikiNotFoundBehavior getWikiNotFoundBehavior() |
76 |
|
{ |
77 |
62 |
return getWikiNotFoundBehavior(WikiNotFoundBehavior.REDIRECT_TO_MAIN_WIKI); |
78 |
|
} |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
35208 |
@Override... |
81 |
|
public String getEntityPathPrefix() |
82 |
|
{ |
83 |
35203 |
return getEntityPathPrefix("bin"); |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
1 |
@Override... |
87 |
|
public boolean isViewActionHidden() |
88 |
|
{ |
89 |
1 |
return isViewActionHidden(false); |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@param |
96 |
|
@return@link |
97 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
98 |
33 |
protected String getWikiPathPrefix(String defaultValue)... |
99 |
|
{ |
100 |
33 |
return this.configuration.getProperty(PREFIX + "multiwiki.wikiPathPrefix", defaultValue); |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
@param |
107 |
|
@return@link |
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
1 |
protected boolean isViewActionHidden(boolean defaultValue)... |
110 |
|
{ |
111 |
1 |
return this.configuration.getProperty(PREFIX + "hideViewAction", defaultValue); |
112 |
|
} |
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
@param |
118 |
|
@return@link |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
35105 |
protected String getEntityPathPrefix(String defaultValue)... |
121 |
|
{ |
122 |
35129 |
return this.configuration.getProperty(PREFIX + "entityPathPrefix", defaultValue); |
123 |
|
} |
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
@param |
129 |
|
@return@link |
130 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
131 |
59 |
protected WikiNotFoundBehavior getWikiNotFoundBehavior(WikiNotFoundBehavior defaultValue)... |
132 |
|
{ |
133 |
61 |
return this.configuration.getProperty(PREFIX + "multiwiki.notFoundBehavior", defaultValue); |
134 |
|
} |
135 |
|
} |