1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.module.blossom.view; |
35 |
|
|
36 |
|
import info.magnolia.objectfactory.Components; |
37 |
|
import info.magnolia.rendering.renderer.ContextAttributeConfiguration; |
38 |
|
|
39 |
|
import java.util.HashMap; |
40 |
|
import java.util.Map; |
41 |
|
|
42 |
|
import org.springframework.beans.factory.config.AbstractFactoryBean; |
43 |
|
|
44 |
|
|
45 |
|
@link |
46 |
|
|
47 |
|
@see |
48 |
|
@since |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 3 |
Complexity Density: 0.3 |
|
50 |
|
public class SiteAwareFreemarkerTemplateViewRendererFactoryBean extends AbstractFactoryBean<SiteAwareFreemarkerTemplateViewRenderer> { |
51 |
|
|
52 |
|
private Map<String, ContextAttributeConfiguration> contextAttributes = new HashMap<String, ContextAttributeConfiguration>(); |
53 |
|
private boolean exposeModelAsRequestAttributes = true; |
54 |
|
private boolean exposeSpringMacroHelpers = true; |
55 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
56 |
|
public Map<String, ContextAttributeConfiguration> getContextAttributes() {... |
57 |
|
return contextAttributes; |
58 |
|
} |
59 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
60 |
|
public void setContextAttributes(Map<String, ContextAttributeConfiguration> contextAttributes) {... |
61 |
|
this.contextAttributes = contextAttributes; |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
0 |
public void addContextAttribute(String name, ContextAttributeConfiguration contextAttributeConfiguration) {... |
65 |
0 |
this.contextAttributes.put(name, contextAttributeConfiguration); |
66 |
|
} |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
68 |
0 |
public void addContextAttribute(String name, Class<?> componentClass) {... |
69 |
0 |
ContextAttributeConfiguration attributeConfiguration = new ContextAttributeConfiguration(); |
70 |
0 |
attributeConfiguration.setName(name); |
71 |
0 |
attributeConfiguration.setComponentClass(componentClass); |
72 |
0 |
addContextAttribute(name, attributeConfiguration); |
73 |
|
} |
74 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
75 |
|
public boolean isExposeModelAsRequestAttributes() {... |
76 |
|
return exposeModelAsRequestAttributes; |
77 |
|
} |
78 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
79 |
|
public void setExposeModelAsRequestAttributes(boolean exposeModelAsRequestAttributes) {... |
80 |
|
this.exposeModelAsRequestAttributes = exposeModelAsRequestAttributes; |
81 |
|
} |
82 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
83 |
|
public boolean isExposeSpringMacroHelpers() {... |
84 |
|
return exposeSpringMacroHelpers; |
85 |
|
} |
86 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
87 |
|
public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) {... |
88 |
|
this.exposeSpringMacroHelpers = exposeSpringMacroHelpers; |
89 |
|
} |
90 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
91 |
|
@Override... |
92 |
|
public Class<?> getObjectType() { |
93 |
|
return SiteAwareFreemarkerTemplateViewRenderer.class; |
94 |
|
} |
95 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
96 |
0 |
@Override... |
97 |
|
protected SiteAwareFreemarkerTemplateViewRenderer createInstance() throws Exception { |
98 |
0 |
SiteAwareFreemarkerTemplateViewRenderer renderer = Components.newInstance(SiteAwareFreemarkerTemplateViewRenderer.class); |
99 |
0 |
renderer.setExposeModelAsRequestAttributes(exposeModelAsRequestAttributes); |
100 |
0 |
renderer.setExposeSpringMacroHelpers(exposeSpringMacroHelpers); |
101 |
0 |
renderer.setContextAttributes(contextAttributes); |
102 |
0 |
return renderer; |
103 |
|
} |
104 |
|
} |