View Javadoc

1   /**
2    * Copyright 2013 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   *
15   * Created by christoff on 2013/02/26
16   */
17  package org.kuali.student.krms.naturallanguage.service.impl;
18  
19  import org.kuali.rice.krms.api.repository.category.CategoryDefinitionContract;
20  import org.kuali.rice.krms.api.repository.term.TermDefinition;
21  import org.kuali.rice.krms.api.repository.term.TermDefinitionContract;
22  import org.kuali.rice.krms.api.repository.term.TermParameterDefinitionContract;
23  import org.kuali.rice.krms.api.repository.term.TermResolverDefinition;
24  import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition;
25  import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinitionContract;
26  import org.kuali.rice.krms.impl.repository.TermBoService;
27  import org.kuali.student.krms.naturallanguage.KRMSDataGenerator;
28  import org.kuali.student.r2.core.krms.naturallanguage.TermParameterTypes;
29  
30  import java.util.ArrayList;
31  import java.util.List;
32  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
33  
34  /**
35   * This class is a Mock implementation of the TermBoService
36   *
37   * @author Kuali Student Team
38   */
39  public class TermBoMockService implements TermBoService {
40      public TermDefinitionContract termDefinitionContract;
41  
42      @Override
43      public TermSpecificationDefinition getTermSpecificationById(String id) {
44          return null;  //TODO implement auto generated
45      }
46  
47      @Override
48      public TermSpecificationDefinition createTermSpecification(TermSpecificationDefinition termSpec) {
49          return null;  //TODO implement auto generated
50      }
51  
52      @Override
53      public TermDefinition getTerm(String id) {
54          TermSpecificationDefinitionContract termSpec = KRMSDataGenerator.createTermSpecificationDefinition("completedCourses","KS-SYS","java.lang.Boolean","Completed Courses",new ArrayList<CategoryDefinitionContract>(),null,"termSpec-1",true,0L);
55          List<TermParameterDefinitionContract> parameterList = new ArrayList<TermParameterDefinitionContract>();
56          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.CLU_KEY.getId(),"CLU-1",null,0L));
57          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.COURSE_CLU_KEY.getId(),"CLU-1",null,0L));
58          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.PROGRAM_CLU_KEY.getId(),"CLU-1",null,0L));
59          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.TEST_CLU_KEY.getId(),"CLU-1",null,0L));
60          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.CLUSET_KEY.getId(),"CLUSET-1",null,0L));
61          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.COURSE_CLUSET_KEY.getId(),"CLUSET-1",null,0L));
62          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.PROGRAM_CLUSET_KEY.getId(),"CLUSET-1",null,0L));
63          parameterList.add(KRMSDataGenerator.createTermParameterDefinition(null,TermParameterTypes.TEST_CLUSET_KEY.getId(),"CLUSET-1",null,0L));
64          termDefinitionContract = KRMSDataGenerator.createTermDefinition(termSpec,null,parameterList,null,0L);
65          return TermDefinition.Builder.create(termDefinitionContract).build();
66      }
67  
68      @Override
69      public TermDefinition createTerm(TermDefinition termDef) {
70          return null;  //TODO implement auto generated
71      }
72  
73      @Override
74      public TermResolverDefinition getTermResolverById(String id) {
75          return null;  //TODO implement auto generated
76      }
77  
78      /**
79       * Get the {@link org.kuali.rice.krms.api.repository.term.TermResolverDefinition}s for any term resolvers in the specified namespace that have the given
80       * term specification as their output.
81       *
82       * @param id        the id for the term specification
83       * @param namespace the namespace to search
84       * @return the List of term resolvers found.  If none are found, an empty list will be returned.
85       */
86      @Override
87      public List<TermResolverDefinition> findTermResolversByOutputId(String id, String namespace) {
88          return null;  //TODO implement auto generated
89      }
90  
91      @Override
92      public List<TermResolverDefinition> findTermResolversByNamespace(String namespace) {
93          return null;  //TODO implement auto generated
94      }
95  
96      @Override
97      public TermResolverDefinition createTermResolver(TermResolverDefinition termResolver) {
98          return null;  //TODO implement auto generated
99      }
100 
101     @Override
102     public void updateTermSpecification(TermSpecificationDefinition termSpec) throws RiceIllegalArgumentException {
103         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
104     }
105 
106     @Override
107     public void deleteTermSpecification(String id) throws RiceIllegalArgumentException {
108         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
109     }
110 
111     @Override
112     public void updateTerm(TermDefinition termDef) throws RiceIllegalArgumentException {
113         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
114     }
115 
116     @Override
117     public void deleteTerm(String id) throws RiceIllegalArgumentException {
118         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
119     }
120 
121     @Override
122     public void updateTermResolver(TermResolverDefinition termResolver) throws RiceIllegalArgumentException {
123         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
124     }
125 
126     @Override
127     public void deleteTermResolver(String id) throws RiceIllegalArgumentException {
128         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
129     }
130 
131     @Override
132     public TermResolverDefinition getTermResolverByNameAndNamespace(String name, String namespace) throws RiceIllegalArgumentException {
133         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
134     }
135 
136     @Override
137     public TermSpecificationDefinition getTermSpecificationByNameAndNamespace(String name, String namespace) throws RiceIllegalArgumentException {
138         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
139     }
140     
141     
142 }