001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krms.impl.repository; 017 018import org.kuali.rice.krms.api.repository.language.NaturalLanguageTemplate; 019import java.util.List; 020import java.util.Map; 021 022/** 023 * This is the interface for accessing repository {@link NaturalLanguageTemplateBo} related business objects. 024 * 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 * 027 */ 028public interface NaturalLanguageTemplateBoService { 029 030 031 /** 032 * This will create a {@link NaturalLanguageTemplate} exactly like the 033 * parameter passed in except the id will be assigned and create date/user 034 * will be set. 035 * 036 * @param naturalLanguageTemplate The NaturalLanguageTemplate to create. 037 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 038 * @throws IllegalStateException if the NaturalLanguageTemplate already exists in the system. 039 * @return a {@link NaturalLanguageTemplate} exactly like the parameter passed in. 040 * 041 */ 042 public NaturalLanguageTemplate createNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate); 043 044 /** 045 * Retrieves a NaturalLanguageTemplate from the repository based on the given id. 046 * 047 * @param naturalLanguageTemplateId to retrieve. 048 * @return a {@link NaturalLanguageTemplate} identified by the given id. 049 * A null reference is returned if an invalid or non-existent id is supplied. 050 * 051 */ 052 public NaturalLanguageTemplate getNaturalLanguageTemplate(String naturalLanguageTemplateId); 053 054 /** 055 * This will update an existing {@link NaturalLanguageTemplate}. 056 * 057 * @param naturalLanguageTemplate The NaturalLanguageTemplate to update. 058 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 059 * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system. 060 * 061 */ 062 public NaturalLanguageTemplate updateNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate); 063 064 /** 065 * Delete the {@link NaturalLanguageTemplate} with the given id. 066 * 067 * @param naturalLanguageTemplateId to delete. 068 * @throws IllegalArgumentException if the NaturalLanguageTemplate is null. 069 * @throws IllegalStateException if the NaturalLanguageTemplate does not exists in the system 070 * 071 */ 072 public void deleteNaturalLanguageTemplate(String naturalLanguageTemplateId); 073 074 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByAttributes(Map attributes); 075 076 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(String languageCode); 077 078 public NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(String languageCode, String typeId, String naturalLanguageUsageId); 079 080 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(String naturalLanguageUsageId); 081 082 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(String typeId); 083 084 public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(String template); 085 086 /** 087 * Converts a mutable {@link NaturalLanguageTemplateBo} to its immutable counterpart, {@link NaturalLanguageTemplate}. 088 * @param naturalLanguageTemplateBo the mutable business object. 089 * @return a {@link NaturalLanguageTemplate} the immutable object. 090 * 091 */ 092 public NaturalLanguageTemplate to(NaturalLanguageTemplateBo naturalLanguageTemplateBo); 093 094 /** 095 * Converts a immutable {@link NaturalLanguageTemplate} to its mutable {@link NaturalLanguageTemplateBo} counterpart. 096 * @param naturalLanguageTemplate the immutable object. 097 * @return a {@link NaturalLanguageTemplateBo} the mutable NaturalLanguageTemplateBo. 098 * 099 */ 100 public NaturalLanguageTemplateBo from(NaturalLanguageTemplate naturalLanguageTemplate); 101 102}