1 /** 2 * Copyright 2011-2012 The Kuali Foundation Licensed under the Educational 3 * Community License, Version 2.0 (the "License"); you may not use this file 4 * except in compliance with the License. You may obtain a copy of the License 5 * at 6 * 7 * http://www.osedu.org/licenses/ECL-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 * License for the specific language governing permissions and limitations under 13 * the License. 14 */ 15 package org.kuali.mobility.news.service; 16 17 import java.util.List; 18 import javax.jws.WebService; 19 20 import org.kuali.mobility.news.dao.NewsCache; 21 import org.kuali.mobility.news.dao.NewsDao; 22 import org.kuali.mobility.news.entity.NewsArticle; 23 import org.kuali.mobility.news.entity.NewsSource; 24 25 /** 26 * An interface for a contract for interacting with the news entity objects. 27 * 28 * @author Kuali Mobility Team (mobility.dev@kuali.org) 29 */ 30 @WebService 31 public interface NewsService { 32 33 public List<? extends NewsSource> getNewsSources(Long parentId, Boolean isActive); 34 35 /** 36 * @return a list of all NewsSource objects sorted on NewsSource.order from 37 * least to greatest 38 */ 39 public List<? extends NewsSource> getAllNewsSources(); 40 41 /** 42 * @return a list of all active NewsSource objects sorted on 43 * NewsSource.order from least to greatest 44 */ 45 public List<? extends NewsSource> getAllActiveNewsSources(); 46 47 public List<? extends NewsSource> getAllActiveNewsSources(Long parentId); 48 49 /** 50 * Retrieve a NewsSource object 51 * 52 * @param id the id of the NewsSource to retrieve 53 * @return the found NewsSource if it exists, null otherwise 54 */ 55 public NewsSource getNewsSourceById(Long id); 56 57 /** 58 * Retrieve the details of an article 59 * 60 * @param articleId the id of the article to retrieve 61 * @param sourceId the id of the NewsSource to which the article belongs. 62 * @return a NewsArticle object 63 */ 64 public NewsArticle getNewsArticle(String articleId, long sourceId); 65 66 public NewsArticle getNewsArticle(String articleId); 67 68 public void setDao(NewsDao dao); 69 70 public NewsDao getDao(); 71 72 public void setCache(NewsCache cache); 73 74 public NewsCache getCache(); 75 }