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.script; |
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 |
|
import org.xwiki.container.Container; |
29 |
|
import org.xwiki.context.Execution; |
30 |
|
import org.xwiki.context.ExecutionContext; |
31 |
|
import org.xwiki.job.event.status.JobProgress; |
32 |
|
import org.xwiki.script.service.ScriptService; |
33 |
|
|
34 |
|
import com.xpn.xwiki.web.XWikiAction; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
@version |
40 |
|
@since |
41 |
|
|
42 |
|
@Component |
43 |
|
@Singleton |
44 |
|
@Named("debug") |
|
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 5 |
Complexity Density: 0.56 |
|
45 |
|
public class DebugInternalScriptService implements ScriptService |
46 |
|
{ |
47 |
|
@Inject |
48 |
|
private Execution execution; |
49 |
|
|
50 |
|
@Inject |
51 |
|
@Named("xwikiproperties") |
52 |
|
private ConfigurationSource properties; |
53 |
|
|
54 |
|
@Inject |
55 |
|
private Container container; |
56 |
|
|
57 |
|
|
58 |
|
@return |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
1061 |
public boolean isEnabled()... |
61 |
|
{ |
62 |
1058 |
return getActionProgress() != null; |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
@return |
67 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
68 |
1058 |
public JobProgress getActionProgress()... |
69 |
|
{ |
70 |
1060 |
ExecutionContext econtext = this.execution.getContext(); |
71 |
|
|
72 |
1061 |
if (econtext != null) { |
73 |
1059 |
return (JobProgress) econtext.getProperty(XWikiAction.ACTION_PROGRESS); |
74 |
|
} |
75 |
|
|
76 |
0 |
return null; |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
@return |
81 |
|
@since |
82 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
83 |
2127 |
public boolean isMinify()... |
84 |
|
{ |
85 |
2126 |
String minifyString = (String) this.container.getRequest().getProperty("minify"); |
86 |
2127 |
if (minifyString != null) { |
87 |
0 |
return Boolean.valueOf(minifyString); |
88 |
|
} |
89 |
|
|
90 |
2127 |
return this.properties.getProperty("debug.minify", true); |
91 |
|
} |
92 |
|
} |