1
2
3
4
5 package org.kuali.rice.krms.impl.repository.mock;
6
7 import org.kuali.rice.krms.api.repository.term.TermRepositoryService;
8 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition;
9
10
11
12
13
14 public class KrmsTermSpecificationLoader {
15
16 private TermRepositoryService termRepositoryService = null;
17
18 public TermRepositoryService getTermRepositoryService() {
19 return termRepositoryService;
20 }
21
22 public void setTermRepositoryService(TermRepositoryService termRepositoryService) {
23 this.termRepositoryService = termRepositoryService;
24 }
25
26 public void loadTermSpec(String id, String name, String type, String description, String namespace) {
27 TermSpecificationDefinition.Builder bldr = TermSpecificationDefinition.Builder.create(id, name, namespace, type);
28 bldr.setDescription(description);
29 bldr.setId(id);
30 bldr.setActive(true);
31 this.getTermRepositoryService().createTermSpecification(bldr.build());
32 }
33
34 public void load() {
35 loadTermSpec("10000", "CompletedCourse", "java.lang.Boolean", "Completed course", "KS-SYS");
36 loadTermSpec("10001", "CompletedCourses", "java.lang.Boolean", "Completed courses", "KS-SYS");
37 loadTermSpec("10002", "NumberOfCompletedCourses", "java.lang.Integer", " Number of completed courses", "KS-SYS");
38 loadTermSpec("10003", "NumberOfCreditsFromCompletedCourses", "java.lang.Integer", "Number of credits from completed courses", "KS-SYS");
39 loadTermSpec("10004", "EnrolledCourses", "java.lang.Integer", "Enrolled courses", "KS-SYS");
40 loadTermSpec("10005", "GPAForCourses", "java.lang.Integer", "GPA for courses", "KS-SYS");
41 loadTermSpec("10006", "GradeTypeForCourses", "java.lang.Integer", "Grade type for courses", "KS-SYS");
42 loadTermSpec("10007", "NumberOfCredits", "java.lang.Integer", "Number of credits", "KS-SYS");
43 loadTermSpec("10008", "NumberOfCreditsFromOrganization", "java.lang.Integer", "Number of credits from organization", "KS-SYS");
44 loadTermSpec("10009", "AdminOrganizationPermissionRequired", "java.lang.Boolean", "Admin organization permission required", "KS-SYS");
45 loadTermSpec("10010", "ScoreOnTest", "java.lang.Integer", "Score on test", "KS-SYS");
46 loadTermSpec("10011", "AdmittedToProgram", "java.lang.Boolean", "Admitted to program", "KS-SYS");
47 loadTermSpec("10012", "AdmittedToProgramLimitCoursesInOrgForDuration", "java.lang.Integer", "Admitted to program limit courses in organization for duration", "KS-SYS");
48 loadTermSpec("10013", "FreeFormText", "java.lang.Boolean", "Free Form Text", "KS-SYS");
49 }
50 }