1 /** 2 * Copyright 2005-2015 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 33 * parameter passed in except the id will be assigned and create date/user 34 * will be set. 35 * 36 * @param naturalLanguageTemplate The NaturalLanguageTemplate to create. 37 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 38 * @throws IllegalStateException if the NaturalLanguageTemplate already exists in the system. 39 * @return a {@link NaturalLanguageTemplate} exactly like the parameter passed in. 40 * 41 */ 42 public NaturalLanguageTemplate createNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate); 43 44 /** 45 * Retrieves a NaturalLanguageTemplate from the repository based on the given id. 46 * 47 * @param naturalLanguageTemplateId to retrieve. 48 * @return a {@link NaturalLanguageTemplate} identified by the given id. 49 * A null reference is returned if an invalid or non-existent id is supplied. 50 * 51 */ 52 public NaturalLanguageTemplate getNaturalLanguageTemplate(String naturalLanguageTemplateId); 53 54 /** 55 * This will update an existing {@link NaturalLanguageTemplate}. 56 * 57 * @param naturalLanguageTemplate The NaturalLanguageTemplate to update. 58 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 59 * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system. 60 * 61 */ 62 public void updateNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate); 63 64 /** 65 * Delete the {@link NaturalLanguageTemplate} with the given id. 66 * 67 * @param naturalLanguageTemplateId to delete. 68 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 69 * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system 70 * 71 */ 72 public void deleteNaturalLanguageTemplate(String naturalLanguageTemplateId); 73 74 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByAttributes(Map attributes); 75 76 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(String languageCode); 77 78 public NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(String languageCode, String typeId, String naturalLanguageUsageId); 79 80 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(String naturalLanguageUsageId); 81 82 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(String typeId); 83 84 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(String template); 85 86 /** 87 * Converts a mutable {@link NaturalLanguageTemplateBo} to its immutable counterpart, {@link NaturalLanguageTemplate}. 88 * @param naturalLanguageTemplateBo the mutable business object. 89 * @return a {@link NaturalLanguageTemplate} the immutable object. 90 * 91 */ 92 public NaturalLanguageTemplate to(NaturalLanguageTemplateBo naturalLanguageTemplateBo); 93 94 /** 95 * Converts a immutable {@link NaturalLanguageTemplate} to its mutable {@link NaturalLanguageTemplateBo} counterpart. 96 * @param naturalLanguageTemplate the immutable object. 97 * @return a {@link NaturalLanguageTemplateBo} the mutable NaturalLanguageTemplateBo. 98 * 99 */ 100 public NaturalLanguageTemplateBo from(NaturalLanguageTemplate naturalLanguageTemplate); 101 102 }