1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.announcements.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.bean.InitializingBean;
31  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33  
34  import com.liferay.portlet.announcements.model.AnnouncementsFlag;
35  import com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService;
36  import com.liferay.portlet.announcements.service.AnnouncementsDeliveryService;
37  import com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService;
38  import com.liferay.portlet.announcements.service.AnnouncementsEntryService;
39  import com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService;
40  import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
41  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFinder;
42  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryPersistence;
43  import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
44  
45  import java.util.List;
46  
47  /**
48   * <a href="AnnouncementsFlagLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
49   *
50   * @author Brian Wing Shun Chan
51   *
52   */
53  public abstract class AnnouncementsFlagLocalServiceBaseImpl
54      implements AnnouncementsFlagLocalService, InitializingBean {
55      public AnnouncementsFlag addAnnouncementsFlag(
56          AnnouncementsFlag announcementsFlag) throws SystemException {
57          announcementsFlag.setNew(true);
58  
59          return announcementsFlagPersistence.update(announcementsFlag, false);
60      }
61  
62      public void deleteAnnouncementsFlag(long flagId)
63          throws PortalException, SystemException {
64          announcementsFlagPersistence.remove(flagId);
65      }
66  
67      public void deleteAnnouncementsFlag(AnnouncementsFlag announcementsFlag)
68          throws SystemException {
69          announcementsFlagPersistence.remove(announcementsFlag);
70      }
71  
72      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
73          throws SystemException {
74          return announcementsFlagPersistence.findWithDynamicQuery(dynamicQuery);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
78          int end) throws SystemException {
79          return announcementsFlagPersistence.findWithDynamicQuery(dynamicQuery,
80              start, end);
81      }
82  
83      public AnnouncementsFlag getAnnouncementsFlag(long flagId)
84          throws PortalException, SystemException {
85          return announcementsFlagPersistence.findByPrimaryKey(flagId);
86      }
87  
88      public List<AnnouncementsFlag> getAnnouncementsFlags(int start, int end)
89          throws SystemException {
90          return announcementsFlagPersistence.findAll(start, end);
91      }
92  
93      public int getAnnouncementsFlagsCount() throws SystemException {
94          return announcementsFlagPersistence.countAll();
95      }
96  
97      public AnnouncementsFlag updateAnnouncementsFlag(
98          AnnouncementsFlag announcementsFlag) throws SystemException {
99          announcementsFlag.setNew(false);
100 
101         return announcementsFlagPersistence.update(announcementsFlag, true);
102     }
103 
104     public AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
105         return announcementsDeliveryLocalService;
106     }
107 
108     public void setAnnouncementsDeliveryLocalService(
109         AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
110         this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
111     }
112 
113     public AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
114         return announcementsDeliveryService;
115     }
116 
117     public void setAnnouncementsDeliveryService(
118         AnnouncementsDeliveryService announcementsDeliveryService) {
119         this.announcementsDeliveryService = announcementsDeliveryService;
120     }
121 
122     public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
123         return announcementsDeliveryPersistence;
124     }
125 
126     public void setAnnouncementsDeliveryPersistence(
127         AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
128         this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
129     }
130 
131     public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
132         return announcementsEntryLocalService;
133     }
134 
135     public void setAnnouncementsEntryLocalService(
136         AnnouncementsEntryLocalService announcementsEntryLocalService) {
137         this.announcementsEntryLocalService = announcementsEntryLocalService;
138     }
139 
140     public AnnouncementsEntryService getAnnouncementsEntryService() {
141         return announcementsEntryService;
142     }
143 
144     public void setAnnouncementsEntryService(
145         AnnouncementsEntryService announcementsEntryService) {
146         this.announcementsEntryService = announcementsEntryService;
147     }
148 
149     public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
150         return announcementsEntryPersistence;
151     }
152 
153     public void setAnnouncementsEntryPersistence(
154         AnnouncementsEntryPersistence announcementsEntryPersistence) {
155         this.announcementsEntryPersistence = announcementsEntryPersistence;
156     }
157 
158     public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
159         return announcementsEntryFinder;
160     }
161 
162     public void setAnnouncementsEntryFinder(
163         AnnouncementsEntryFinder announcementsEntryFinder) {
164         this.announcementsEntryFinder = announcementsEntryFinder;
165     }
166 
167     public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
168         return announcementsFlagPersistence;
169     }
170 
171     public void setAnnouncementsFlagPersistence(
172         AnnouncementsFlagPersistence announcementsFlagPersistence) {
173         this.announcementsFlagPersistence = announcementsFlagPersistence;
174     }
175 
176     public CounterLocalService getCounterLocalService() {
177         return counterLocalService;
178     }
179 
180     public void setCounterLocalService(CounterLocalService counterLocalService) {
181         this.counterLocalService = counterLocalService;
182     }
183 
184     public CounterService getCounterService() {
185         return counterService;
186     }
187 
188     public void setCounterService(CounterService counterService) {
189         this.counterService = counterService;
190     }
191 
192     public void afterPropertiesSet() {
193         if (announcementsDeliveryLocalService == null) {
194             announcementsDeliveryLocalService = (AnnouncementsDeliveryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryLocalService.class.getName() +
195                     ".impl");
196         }
197 
198         if (announcementsDeliveryService == null) {
199             announcementsDeliveryService = (AnnouncementsDeliveryService)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryService.class.getName() +
200                     ".impl");
201         }
202 
203         if (announcementsDeliveryPersistence == null) {
204             announcementsDeliveryPersistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName() +
205                     ".impl");
206         }
207 
208         if (announcementsEntryLocalService == null) {
209             announcementsEntryLocalService = (AnnouncementsEntryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsEntryLocalService.class.getName() +
210                     ".impl");
211         }
212 
213         if (announcementsEntryService == null) {
214             announcementsEntryService = (AnnouncementsEntryService)PortalBeanLocatorUtil.locate(AnnouncementsEntryService.class.getName() +
215                     ".impl");
216         }
217 
218         if (announcementsEntryPersistence == null) {
219             announcementsEntryPersistence = (AnnouncementsEntryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsEntryPersistence.class.getName() +
220                     ".impl");
221         }
222 
223         if (announcementsEntryFinder == null) {
224             announcementsEntryFinder = (AnnouncementsEntryFinder)PortalBeanLocatorUtil.locate(AnnouncementsEntryFinder.class.getName() +
225                     ".impl");
226         }
227 
228         if (announcementsFlagPersistence == null) {
229             announcementsFlagPersistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName() +
230                     ".impl");
231         }
232 
233         if (counterLocalService == null) {
234             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
235                     ".impl");
236         }
237 
238         if (counterService == null) {
239             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
240                     ".impl");
241         }
242     }
243 
244     protected AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
245     protected AnnouncementsDeliveryService announcementsDeliveryService;
246     protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
247     protected AnnouncementsEntryLocalService announcementsEntryLocalService;
248     protected AnnouncementsEntryService announcementsEntryService;
249     protected AnnouncementsEntryPersistence announcementsEntryPersistence;
250     protected AnnouncementsEntryFinder announcementsEntryFinder;
251     protected AnnouncementsFlagPersistence announcementsFlagPersistence;
252     protected CounterLocalService counterLocalService;
253     protected CounterService counterService;
254 }