001 /* 002 * To change this template, choose Tools | Templates 003 * and open the template in the editor. 004 */ 005 package org.kuali.rice.krms.impl.repository.mock; 006 007 import org.kuali.rice.krms.api.repository.term.TermRepositoryService; 008 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition; 009 010 /** 011 * 012 * @author nwright 013 */ 014 public class KrmsTermSpecificationLoader { 015 016 private TermRepositoryService termRepositoryService = null; 017 018 public TermRepositoryService getTermRepositoryService() { 019 return termRepositoryService; 020 } 021 022 public void setTermRepositoryService(TermRepositoryService termRepositoryService) { 023 this.termRepositoryService = termRepositoryService; 024 } 025 026 public void loadTermSpec(String id, String name, String type, String description, String namespace) { 027 TermSpecificationDefinition.Builder bldr = TermSpecificationDefinition.Builder.create(id, name, namespace, type); 028 bldr.setDescription(description); 029 bldr.setId(id); 030 bldr.setActive(true); 031 this.getTermRepositoryService().createTermSpecification(bldr.build()); 032 } 033 034 public void load() { 035 loadTermSpec("10000", "CompletedCourse", "java.lang.Boolean", "Completed course", "KS-SYS"); 036 loadTermSpec("10001", "CompletedCourses", "java.lang.Boolean", "Completed courses", "KS-SYS"); 037 loadTermSpec("10002", "NumberOfCompletedCourses", "java.lang.Integer", " Number of completed courses", "KS-SYS"); 038 loadTermSpec("10003", "NumberOfCreditsFromCompletedCourses", "java.lang.Integer", "Number of credits from completed courses", "KS-SYS"); 039 loadTermSpec("10004", "EnrolledCourses", "java.lang.Integer", "Enrolled courses", "KS-SYS"); 040 loadTermSpec("10005", "GPAForCourses", "java.lang.Integer", "GPA for courses", "KS-SYS"); 041 loadTermSpec("10006", "GradeTypeForCourses", "java.lang.Integer", "Grade type for courses", "KS-SYS"); 042 loadTermSpec("10007", "NumberOfCredits", "java.lang.Integer", "Number of credits", "KS-SYS"); 043 loadTermSpec("10008", "NumberOfCreditsFromOrganization", "java.lang.Integer", "Number of credits from organization", "KS-SYS"); 044 loadTermSpec("10009", "AdminOrganizationPermissionRequired", "java.lang.Boolean", "Admin organization permission required", "KS-SYS"); 045 loadTermSpec("10010", "ScoreOnTest", "java.lang.Integer", "Score on test", "KS-SYS"); 046 loadTermSpec("10011", "AdmittedToProgram", "java.lang.Boolean", "Admitted to program", "KS-SYS"); 047 loadTermSpec("10012", "AdmittedToProgramLimitCoursesInOrgForDuration", "java.lang.Integer", "Admitted to program limit courses in organization for duration", "KS-SYS"); 048 loadTermSpec("10013", "FreeFormText", "java.lang.Boolean", "Free Form Text", "KS-SYS"); 049 } 050 }