View Javadoc
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 org.kuali.mobility.news.dao.NewsCache;
18  import org.kuali.mobility.news.dao.NewsDao;
19  import org.kuali.mobility.news.entity.NewsArticle;
20  import org.kuali.mobility.news.entity.NewsSource;
21  
22  import javax.jws.WebService;
23  import java.util.List;
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      @Deprecated
40      public List<? extends NewsSource> getAllNewsSources();
41      public List<? extends NewsSource> getAllNewsSources(Boolean compact);
42  
43      /**
44       * @return a list of all active NewsSource objects sorted on
45       * NewsSource.order from least to greatest
46       */
47      @Deprecated
48      public List<? extends NewsSource> getAllActiveNewsSources();
49      public List<? extends NewsSource> getAllActiveNewsSources(Boolean compact);
50  
51      @Deprecated
52      public List<? extends NewsSource> getAllActiveNewsSources(Long parentId);
53      public List<? extends NewsSource> getAllActiveNewsSources(Long parentId,Boolean compact);
54  
55      /**
56       * Retrieve a NewsSource object
57       *
58       * @param id the id of the NewsSource to retrieve
59       * @return the found NewsSource if it exists, null otherwise
60       */
61      public NewsSource getNewsSourceById(Long id);
62  
63      /**
64       * Retrieve the details of an article
65       *
66       * @param articleId the id of the article to retrieve
67       * @param sourceId the id of the NewsSource to which the article belongs.
68       * @return a NewsArticle object
69       */
70      public NewsArticle getNewsArticle(String articleId, long sourceId);
71  
72      public NewsArticle getNewsArticle(String articleId);
73  
74      public void setDao(NewsDao dao);
75  
76      public NewsDao getDao();
77  
78      public void setCache(NewsCache cache);
79  
80      public NewsCache getCache();
81  }