1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.kuali.rice.krms.impl.repository.mock;
21
22 import org.kuali.rice.krms.api.repository.RuleManagementService;
23 import org.kuali.rice.krms.api.repository.term.TermRepositoryService;
24 import org.kuali.rice.krms.api.repository.type.KrmsTypeRepositoryService;
25
26
27
28
29
30 public class KrmsConfigurationLoader {
31
32 private KrmsTypeRepositoryService krmsTypeRepositoryService = null;
33 private RuleManagementService ruleManagementService = null;
34 private TermRepositoryService termRepositoryService = null;
35
36 public KrmsTypeRepositoryService getKrmsTypeRepositoryService() {
37
38 return krmsTypeRepositoryService;
39 }
40
41 public void setKrmsTypeRepositoryService(KrmsTypeRepositoryService krmsTypeRepositoryService) {
42 this.krmsTypeRepositoryService = krmsTypeRepositoryService;
43 }
44
45 public RuleManagementService getRuleManagementService() {
46 return ruleManagementService;
47 }
48
49 public void setRuleManagementService(RuleManagementService ruleManagementService) {
50 this.ruleManagementService = ruleManagementService;
51 }
52
53 public TermRepositoryService getTermRepositoryService() {
54 return termRepositoryService;
55 }
56
57 public void setTermRepositoryService(TermRepositoryService termRepositoryService) {
58 this.termRepositoryService = termRepositoryService;
59 }
60
61 public void loadConfiguration() {
62 this.loadTypes();
63 this.loadTypeRelations();
64 this.loadNlUsages();
65 this.loadNaturalLanguateTemplates();
66 this.loadTermSpecs();
67 this.loadTermResolvers();
68 this.loadContexts();
69 }
70
71 private void loadTypes() {
72 KrmsTypeLoader loader = new KrmsTypeLoader();
73 loader.setKrmsTypeRepositoryService(krmsTypeRepositoryService);
74 loader.load();
75 }
76
77 private void loadTypeRelations() {
78 KrmsTypeRelationLoader loader = new KrmsTypeRelationLoader();
79 loader.setKrmsTypeRepositoryService(krmsTypeRepositoryService);
80 loader.load();
81 }
82
83 private void loadNlUsages() {
84 KrmsNaturalLanguageUsageLoader loader = new KrmsNaturalLanguageUsageLoader();
85 loader.setRuleManagementService(this.ruleManagementService);
86 loader.load();
87 }
88
89 private void loadNaturalLanguateTemplates() {
90 KrmsNaturalLanguageTemplateLoader loader = new KrmsNaturalLanguageTemplateLoader();
91 loader.setRuleManagementService(this.ruleManagementService);
92 loader.load();
93 }
94
95 private void loadTermSpecs() {
96 KrmsTermSpecificationLoader loader = new KrmsTermSpecificationLoader();
97 loader.setTermRepositoryService(this.termRepositoryService);
98 loader.load();
99 }
100
101 private void loadTermResolvers() {
102 KrmsTermResolverLoader loader = new KrmsTermResolverLoader();
103 loader.setTermRepositoryService(this.termRepositoryService);
104 loader.load();
105 }
106
107
108 private void loadContexts() {
109 KrmsContextLoader loader = new KrmsContextLoader();
110 loader.setRuleManagementService(this.ruleManagementService);
111 loader.load();
112 }
113 }