View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   package org.kuali.rice.krms.impl.repository.mock;
6   
7   import org.kuali.rice.krms.api.repository.RuleManagementService;
8   import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage;
9   
10  /**
11   *
12   * @author nwright
13   */
14  public class KrmsNaturalLanguageUsageLoader {
15  
16      private RuleManagementService ruleManagementService = null;
17  
18      public RuleManagementService getRuleManagementService() {
19          return ruleManagementService;
20      }
21  
22      public void setRuleManagementService(RuleManagementService ruleManagementService) {
23          this.ruleManagementService = ruleManagementService;
24      }
25      
26      
27      public void loadNlUsage(String id, String name, String nameSpace, String description) {
28          NaturalLanguageUsage.Builder bldr = NaturalLanguageUsage.Builder.create(name, nameSpace);
29          bldr.setId(id);
30          bldr.setActive(true);
31          bldr.setDescription(description);
32          this.getRuleManagementService().createNaturalLanguageUsage(bldr.build());
33      }
34  
35      public void load() {
36          loadNlUsage("10000", "kuali.krms.edit", "KS-SYS", "Kuali Rule Edit");
37          loadNlUsage("10001", "kuali.krms.composition", "KS-SYS", "Kuali Rule Composition");
38          loadNlUsage("10002", "kuali.krms.example", "KS-SYS", "Kuali Rule Example");
39          loadNlUsage("10003", "kuali.krms.preview", "KS-SYS", "Kuali Rule Preview");
40          loadNlUsage("10004", "kuali.krms.type.description", "KS-SYS", "Kuali Rule Type Description");
41          loadNlUsage("10005", "kuali.krms.catalog", "KS-SYS", "Kuali Rule Catalog");
42          loadNlUsage("10006", "kuali.krms.type.instruction", "KS-SYS", "Kuali Rule Type Instructions");
43      }
44  
45  
46  }