001/*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005package org.kuali.rice.krms.impl.repository.mock;
006
007import org.kuali.rice.krms.api.repository.RuleManagementService;
008import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage;
009
010/**
011 *
012 * @author nwright
013 */
014public class KrmsNaturalLanguageUsageLoader {
015
016    private RuleManagementService ruleManagementService = null;
017
018    public RuleManagementService getRuleManagementService() {
019        return ruleManagementService;
020    }
021
022    public void setRuleManagementService(RuleManagementService ruleManagementService) {
023        this.ruleManagementService = ruleManagementService;
024    }
025    
026    
027    public void loadNlUsage(String id, String name, String nameSpace, String description) {
028        NaturalLanguageUsage.Builder bldr = NaturalLanguageUsage.Builder.create(name, nameSpace);
029        bldr.setId(id);
030        bldr.setActive(true);
031        bldr.setDescription(description);
032        this.getRuleManagementService().createNaturalLanguageUsage(bldr.build());
033    }
034
035    public void load() {
036        loadNlUsage("10000", "kuali.krms.edit", "KS-SYS", "Kuali Rule Edit");
037        loadNlUsage("10001", "kuali.krms.composition", "KS-SYS", "Kuali Rule Composition");
038        loadNlUsage("10002", "kuali.krms.example", "KS-SYS", "Kuali Rule Example");
039        loadNlUsage("10003", "kuali.krms.preview", "KS-SYS", "Kuali Rule Preview");
040        loadNlUsage("10004", "kuali.krms.type.description", "KS-SYS", "Kuali Rule Type Description");
041        loadNlUsage("10005", "kuali.krms.catalog", "KS-SYS", "Kuali Rule Catalog");
042        loadNlUsage("10006", "kuali.krms.type.instruction", "KS-SYS", "Kuali Rule Type Instructions");
043    }
044
045
046}