001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/web/tags/sakai_2-4-1/news-api/api/src/java/org/sakaiproject/news/cover/NewsService.java $
003: * $Id: NewsService.java 14985 2006-09-20 09:25:55Z joshua.ryan@asu.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.news.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * NewsService is a static Cover for the {@link org.sakaiproject.news.api.NewsService NewsService}; see that interface for usage details.
027: * </p>
028: *
029: * @author University of Michigan, Sakai Software Development Team
030: * @version $Revision: 14985 $
031: */
032: public class NewsService {
033: /**
034: * Access the component instance: special cover only method.
035: *
036: * @return the component instance.
037: */
038: public static org.sakaiproject.news.api.NewsService getInstance() {
039: if (ComponentManager.CACHE_COMPONENTS) {
040: if (m_instance == null)
041: m_instance = (org.sakaiproject.news.api.NewsService) ComponentManager
042: .get(org.sakaiproject.news.api.NewsService.class);
043: return m_instance;
044: } else {
045: return (org.sakaiproject.news.api.NewsService) ComponentManager
046: .get(org.sakaiproject.news.api.NewsService.class);
047: }
048: }
049:
050: private static org.sakaiproject.news.api.NewsService m_instance = null;
051:
052: public static final java.lang.String SERVICE_NAME = org.sakaiproject.news.api.NewsService.SERVICE_NAME;
053:
054: public static final java.lang.String REFERENCE_ROOT = org.sakaiproject.news.api.NewsService.REFERENCE_ROOT;
055:
056: public static java.util.List getChannels() {
057: org.sakaiproject.news.api.NewsService service = getInstance();
058: if (service == null)
059: return null;
060:
061: return service.getChannels();
062: }
063:
064: public static void removeChannel(java.lang.String param0) {
065: org.sakaiproject.news.api.NewsService service = getInstance();
066: if (service == null)
067: return;
068:
069: service.removeChannel(param0);
070: }
071:
072: public static java.util.List getNewsitems(java.lang.String param0)
073: throws org.sakaiproject.news.api.NewsConnectionException,
074: org.sakaiproject.news.api.NewsFormatException {
075: org.sakaiproject.news.api.NewsService service = getInstance();
076: if (service == null)
077: return null;
078:
079: return service.getNewsitems(param0);
080: }
081:
082: public static java.util.List getNewsitems(java.lang.String param0,
083: org.sakaiproject.javax.Filter param1)
084: throws org.sakaiproject.news.api.NewsConnectionException,
085: org.sakaiproject.news.api.NewsFormatException {
086: org.sakaiproject.news.api.NewsService service = getInstance();
087: if (service == null)
088: return null;
089:
090: return service.getNewsitems(param0, param1);
091: }
092:
093: public static boolean isUpdateAvailable(java.lang.String param0) {
094: org.sakaiproject.news.api.NewsService service = getInstance();
095: if (service == null)
096: return false;
097:
098: return service.isUpdateAvailable(param0);
099: }
100:
101: public static org.sakaiproject.news.api.NewsChannel getChannel(
102: java.lang.String param0)
103: throws org.sakaiproject.news.api.NewsConnectionException,
104: org.sakaiproject.news.api.NewsFormatException {
105: org.sakaiproject.news.api.NewsService service = getInstance();
106: if (service == null)
107: return null;
108:
109: return service.getChannel(param0);
110: }
111: }
|