01: /**
02: *
03: */package nl.hippo.cms.wizard.aspects;
04:
05: import nl.hippo.cms.wizard.Constants;
06: import nl.hippo.cms.wizard.WizardResult;
07: import nl.hippo.cms.wizard.components.Configuration;
08:
09: /**
10: * @author a.bogaart@hippo.nl
11: *
12: */
13: public class PropertyAspect extends AbstractComponentAspect {
14:
15: private String namespace = "";
16: private String name = "";
17:
18: public void configure(Configuration config) throws Exception {
19: super .configure(config);
20: if (config.get(Constants.NAME_ATTRIBUTE_NAME) == null)
21: throw new Exception(
22: "PropertyAspect configuration problem: @"
23: + Constants.NAME_ATTRIBUTE_NAME
24: + " is required and cannot be empty");
25: this .name = config.get(Constants.NAME_ATTRIBUTE_NAME);
26:
27: if (config.get(Constants.NAMESPACE_ATTRIBUTE_NAME) != null) {
28: namespace = config.get(Constants.NAMESPACE_ATTRIBUTE_NAME);
29: } else {
30: namespace = nl.hippo.cms.contentmodel.Constants.HIPPO_NAMESPACE;
31: }
32: }
33:
34: public String getName() {
35: return name;
36: }
37:
38: public String getNameSpace() {
39: return namespace;
40: }
41:
42: public void fillResult(WizardResult result) {
43: result.addProperty(this);
44: }
45: }
|