01: package nl.hippo.cms.wizard.widgets;
02:
03: import nl.hippo.cms.wizard.Constants;
04: import nl.hippo.cms.wizard.components.Configuration;
05: import nl.hippo.util.NameUtil;
06:
07: public class ItemWidget extends AbstractContainerWidget implements
08: Unionable {
09:
10: public static final String TYPE = "item";
11: protected String value;
12:
13: //@Override
14: public void configure(Configuration config) throws Exception {
15: super .configure(config);
16:
17: String value = config.get(Constants.VALUE_ATTRIBUTE_NAME);
18: if (value == null || value.equals(""))
19: throw new Exception("ItemWidget/@"
20: + Constants.VALUE_ATTRIBUTE_NAME
21: + " is required and cannot be empty");
22: this .value = value;
23: }
24:
25: public boolean hasUnions() {
26: return components.size() > 0;
27: }
28:
29: public Object getValue() {
30: return value;
31: }
32:
33: public String getURIValue() {
34: return new NameUtil().convertToValidName(value);
35: }
36:
37: public String getType() {
38: return TYPE;
39: }
40: }
|