01: package nl.hippo.cms.wizard.components;
02:
03: import nl.hippo.cms.wizard.WizardResult;
04:
05: import org.springframework.web.context.WebApplicationContext;
06:
07: /**
08: * Base interface for all components in the wizard component model.
09: *
10: * @author a.bogaart@hippo.nl
11: *
12: */
13: public interface Component extends Configurable, Initializable {
14:
15: /**
16: * Return the value that will be used for the path of the new document.
17: * If starts with / it means the value will be used as the current root.
18: * @return value of path
19: */
20: String getPath();
21:
22: /**
23: * Return unique id
24: * @return value of id
25: */
26: String getId();
27:
28: /**
29: * Return component type, used to identify a component in the Cforms model/binding/template templates
30: * @return value of type
31: */
32: String getType();
33:
34: /**
35: * Return i18n key for Cforms labels
36: * @return value of label
37: */
38: String getLabel();
39:
40: /**
41: * Return i18n catalogue to provide easy extensibility of i18n keys
42: * @return value of label catalogue
43: */
44: String getLabelCatalogue();
45:
46: /**
47: * Flag component to skip adding it's path value to the WizardResult instance
48: */
49: void skipPath();
50:
51: /**
52: * Flag component to lowercase the path value to the WizardResult instance
53: */
54: void lowerCasePath();
55:
56: /**
57: * Fill the wizardResult instance with values that are required to create a new document.
58: * Every component will add it's path and id value by default (unless path value is set to skip).
59: * A Spring webApplicationContext is provided for lookup of external components like the types model.
60: * @param result Wizard result instance
61: * @param context Spring webAppContext
62: * @throws Exception
63: */
64: void fillResult(WizardResult result, WebApplicationContext context)
65: throws Exception;
66:
67: /**
68: * Reset the component state so that it can be reused.
69: */
70: void reset();
71: }
|