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
35 package info.magnolia.rendering.template.configured;
36
37 import info.magnolia.rendering.template.AreaDefinition;
38 import info.magnolia.rendering.template.ComponentAvailability;
39 import info.magnolia.rendering.template.InheritanceConfiguration;
40 import info.magnolia.rendering.template.TemplateAvailability;
41
42 import java.util.LinkedHashMap;
43 import java.util.Map;
44
45 import com.google.inject.Inject;
46
47
48
49
50 public class ConfiguredAreaDefinition extends ConfiguredTemplateDefinition implements AreaDefinition {
51
52 private Map<String, ComponentAvailability> availableComponents = new LinkedHashMap<String, ComponentAvailability>();
53
54
55 private Boolean enabled;
56 private Boolean optional;
57 private String type;
58 private String contentStructure;
59 private InheritanceConfiguration inheritance;
60 private Integer maxComponents;
61 private Boolean createAreaNode;
62
63
64
65
66 public ConfiguredAreaDefinition() {
67 }
68
69 @Inject
70 public ConfiguredAreaDefinition(TemplateAvailability templateAvailability) {
71 super(templateAvailability);
72 }
73
74 @Override
75 public Map<String, ComponentAvailability> getAvailableComponents() {
76 return availableComponents;
77 }
78
79 public void setAvailableComponents(Map<String, ComponentAvailability> availableComponents) {
80 this.availableComponents = availableComponents;
81 }
82
83 public void addAvailableComponent(String name, ComponentAvailability configuredComponentAvailability) {
84 this.availableComponents.put(name, configuredComponentAvailability);
85 }
86
87 @Override
88 public Boolean getEnabled() {
89 return enabled;
90 }
91
92 public void setEnabled(Boolean enabled) {
93 this.enabled = enabled;
94 }
95
96 @Override
97 public String getType() {
98 return type;
99 }
100
101 @Override
102 public void setType(String type) {
103 this.type = type;
104 }
105
106 @Override
107 public String getContentStructure() {
108 return contentStructure;
109 }
110
111 public void setContentStructure(String contentStructure) {
112 this.contentStructure = contentStructure;
113 }
114
115 @Override
116 public InheritanceConfiguration getInheritance() {
117 return inheritance;
118 }
119
120 public void setInheritance(InheritanceConfiguration inheritanceConfiguration) {
121 this.inheritance = inheritanceConfiguration;
122 }
123
124 @Override
125 public Boolean isOptional() {
126 return optional;
127 }
128
129 @Override
130 public Boolean isEnabled() {
131 return enabled;
132 }
133
134 @Override
135 public Boolean getOptional() {
136 return optional;
137 }
138
139 public void setOptional(Boolean optional) {
140 this.optional = optional;
141 }
142
143 @Override
144 public Integer getMaxComponents() {
145 return maxComponents;
146 }
147
148
149 public void setCreateAreaNode(Boolean createAreaNode) {
150 this.createAreaNode = createAreaNode;
151 }
152
153 @Override
154 public Boolean getCreateAreaNode() {
155 return createAreaNode;
156 }
157
158 public void setMaxComponents(Integer maxComponents) {
159 this.maxComponents = maxComponents;
160 }
161
162 }