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.rightsmanager; |
22 |
|
|
23 |
|
import org.slf4j.Logger; |
24 |
|
import org.slf4j.LoggerFactory; |
25 |
|
import org.xwiki.observation.ObservationManager; |
26 |
|
|
27 |
|
import com.xpn.xwiki.XWikiContext; |
28 |
|
import com.xpn.xwiki.plugin.XWikiDefaultPlugin; |
29 |
|
import com.xpn.xwiki.plugin.XWikiPluginInterface; |
30 |
|
import com.xpn.xwiki.web.Utils; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
@since |
38 |
|
|
|
|
| 90.9% |
Uncovered Elements: 1 (11) |
Complexity: 4 |
Complexity Density: 0.67 |
|
39 |
|
public class RightsManagerPlugin extends XWikiDefaultPlugin |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
public static final String PLUGIN_NAME = "rightsmanager"; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
protected static final Logger LOGGER = LoggerFactory.getLogger(RightsManagerPlugin.class); |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
@param |
59 |
|
@param |
60 |
|
@param |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
3 |
public RightsManagerPlugin(String name, String className, XWikiContext context)... |
63 |
|
{ |
64 |
3 |
super(PLUGIN_NAME, className, context); |
65 |
|
} |
66 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
67 |
3 |
@Override... |
68 |
|
public void init(XWikiContext context) |
69 |
|
{ |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
3 |
RightsManagerListener rightsManagerListener = RightsManagerListener.getInstance(); |
75 |
3 |
ObservationManager observationManager = Utils.getComponent(ObservationManager.class); |
76 |
3 |
if (observationManager.getListener(rightsManagerListener.getName()) == null) { |
77 |
3 |
observationManager.addListener(rightsManagerListener); |
78 |
|
} |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
22 |
@Override... |
82 |
|
public com.xpn.xwiki.api.Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context) |
83 |
|
{ |
84 |
22 |
return new RightsManagerPluginApi((RightsManagerPlugin) plugin, context); |
85 |
|
} |
86 |
|
} |