View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.impl.repository;
17  
18  import org.kuali.rice.krms.api.repository.language.NaturalLanguageTemplate;
19  import java.util.List;
20  import java.util.Map;
21  
22  /**
23   * This is the interface for accessing repository {@link NaturalLanguageTemplateBo} related business objects.
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   * 
27   */
28  public interface NaturalLanguageTemplateBoService {
29  
30  
31      /**
32       * This will create a {@link NaturalLanguageTemplate} exactly like the parameter passed in.
33       * 
34       * @param naturalLanguageTemplate  The NaturalLanguageTemplate to create.
35       * @throws IllegalArgumentException if the NaturalLanguageTemplate is null.
36       * @throws IllegalStateException if the NaturalLanguageTemplate already exists in the system.
37       * @return a {@link NaturalLanguageTemplate} exactly like the parameter passed in.
38       * 
39       */
40      public NaturalLanguageTemplate createNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate);
41  
42      /**
43       * Retrieves a NaturalLanguageTemplate from the repository based on the given id.
44       * 
45       * @param naturalLanguageTemplateId to retrieve.
46       * @return a {@link NaturalLanguageTemplate} identified by the given id.  
47       * A null reference is returned if an invalid or non-existent id is supplied.
48       * 
49       */
50      public NaturalLanguageTemplate getNaturalLanguageTemplate(String naturalLanguageTemplateId);
51  
52      /**
53       * This will update an existing {@link NaturalLanguageTemplate}.
54       * 
55       * @param naturalLanguageTemplate  The NaturalLanguageTemplate to update.
56       * @throws IllegalArgumentException if the NaturalLanguageTemplate is null.
57       * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system.
58       * 
59       */
60      public void updateNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate);
61  
62      /**
63       * Delete the {@link NaturalLanguageTemplate} with the given id.
64       * 
65       * @param naturalLanguageTemplateId to delete.
66       * @throws IllegalArgumentException if the NaturalLanguageTemplate is null.
67       * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system
68       * 
69       */
70      public void deleteNaturalLanguageTemplate(String naturalLanguageTemplateId);
71  
72      public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByAttributes(Map attributes);
73  
74      public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(String languageCode);
75  
76      public NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(String languageCode, String typeId, String naturalLanguageUsageId);
77  
78      public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(String naturalLanguageUsageId);
79  
80      public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(String typeId);
81  
82      public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(String template);
83  
84      /**
85       * Converts a mutable {@link NaturalLanguageTemplateBo} to its immutable counterpart, {@link NaturalLanguageTemplate}.
86       * @param naturalLanguageTemplateBo the mutable business object.
87       * @return a {@link NaturalLanguageTemplate} the immutable object.
88       * 
89       */
90      public NaturalLanguageTemplate to(NaturalLanguageTemplateBo naturalLanguageTemplateBo);
91  
92      /**
93       * Converts a immutable {@link NaturalLanguageTemplate} to its mutable {@link NaturalLanguageTemplateBo} counterpart.
94       * @param naturalLanguageTemplate the immutable object.
95       * @return a {@link NaturalLanguageTemplateBo} the mutable NaturalLanguageTemplateBo.
96       * 
97       */
98      public NaturalLanguageTemplateBo from(NaturalLanguageTemplate naturalLanguageTemplate);
99  
100     public String template(NaturalLanguageTemplate naturalLanguageTemplate);
101 }