01: package ie.beaumont.epilepsy;
02:
03: import java.net.URL;
04: import net.xoetrope.optional.data.pojo.XPojoContext;
05: import net.xoetrope.xui.XProject;
06:
07: /**
08: * A dummy class to instantiate a connection to a data source
09: */
10: public class ClinicInstance extends XPojoContext {
11: private XProject currentProject;
12: private String clinicName;
13: private ClinicDAO root;
14:
15: /**
16: * Creates a new instance of ClinicInstance
17: */
18: public ClinicInstance() {
19: clinicName = "Beaumont";
20: }
21:
22: public void setProject(XProject project) {
23: currentProject = project;
24: }
25:
26: /**
27: * Configure the root and therefore the context for the POJO hierarchy
28: * @param configFileURL the URL of the configuration file
29: */
30: public void configure(URL configFileURL) {
31: }
32:
33: /**
34: * Return the root element in the pojo hierarchy or null if there is no single
35: * root, or if the XML configuration defines the root object
36: */
37: public Object getRoot() {
38: if (root == null) {
39: root = new ClinicDAO();
40: root.setClinicName(clinicName);
41: }
42: return root;
43: }
44:
45: public String getClinicName() {
46: return clinicName;
47: }
48: }
|