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.resources.templates; |
35 |
|
|
36 |
|
import info.magnolia.rendering.template.TemplateAvailability; |
37 |
|
import info.magnolia.rendering.template.TemplateDefinition; |
38 |
|
import info.magnolia.rendering.template.configured.ConfiguredTemplateDefinition; |
39 |
|
|
40 |
|
import javax.jcr.Node; |
41 |
|
import javax.jcr.RepositoryException; |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
46 |
|
public class ResourceTemplate extends ConfiguredTemplateDefinition { |
47 |
|
|
48 |
|
private boolean processed; |
49 |
|
|
50 |
|
private String contentType; |
51 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
0 |
public ResourceTemplate() {... |
53 |
0 |
setTemplateAvailability(new TemplateAvailability() { |
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
54 |
0 |
@Override... |
55 |
|
public boolean isAvailable(Node node, TemplateDefinition templateDefinition) { |
56 |
0 |
try { |
57 |
0 |
return node.getSession().getWorkspace().getName().equals("resources"); |
58 |
|
} catch (RepositoryException e) { |
59 |
0 |
return false; |
60 |
|
} |
61 |
|
} |
62 |
|
}); |
63 |
|
} |
64 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
65 |
|
public String getContentType() {... |
66 |
|
return this.contentType; |
67 |
|
} |
68 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
69 |
|
public void setContentType(String contentType) {... |
70 |
|
this.contentType = contentType; |
71 |
|
} |
72 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
73 |
|
public boolean isProcessed() {... |
74 |
|
return this.processed; |
75 |
|
} |
76 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
77 |
|
public void setProcessed(boolean processed) {... |
78 |
|
this.processed = processed; |
79 |
|
} |
80 |
|
} |