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  import com.liferay.portal.service.UserLocalService;
34  import com.liferay.portal.service.UserService;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.announcements.model.AnnouncementsDelivery;
39  import com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService;
40  import com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService;
41  import com.liferay.portlet.announcements.service.AnnouncementsEntryService;
42  import com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService;
43  import com.liferay.portlet.announcements.service.AnnouncementsFlagService;
44  import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
45  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFinder;
46  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryPersistence;
47  import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
48  
49  import java.util.List;
50  
51  /**
52   * <a href="AnnouncementsDeliveryLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   */
57  public abstract class AnnouncementsDeliveryLocalServiceBaseImpl
58      implements AnnouncementsDeliveryLocalService, InitializingBean {
59      public AnnouncementsDelivery addAnnouncementsDelivery(
60          AnnouncementsDelivery announcementsDelivery) throws SystemException {
61          announcementsDelivery.setNew(true);
62  
63          return announcementsDeliveryPersistence.update(announcementsDelivery,
64              false);
65      }
66  
67      public void deleteAnnouncementsDelivery(long deliveryId)
68          throws PortalException, SystemException {
69          announcementsDeliveryPersistence.remove(deliveryId);
70      }
71  
72      public void deleteAnnouncementsDelivery(
73          AnnouncementsDelivery announcementsDelivery) throws SystemException {
74          announcementsDeliveryPersistence.remove(announcementsDelivery);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
78          throws SystemException {
79          return announcementsDeliveryPersistence.findWithDynamicQuery(dynamicQuery);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
83          int end) throws SystemException {
84          return announcementsDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
85              start, end);
86      }
87  
88      public AnnouncementsDelivery getAnnouncementsDelivery(long deliveryId)
89          throws PortalException, SystemException {
90          return announcementsDeliveryPersistence.findByPrimaryKey(deliveryId);
91      }
92  
93      public List<AnnouncementsDelivery> getAnnouncementsDeliveries(int start,
94          int end) throws SystemException {
95          return announcementsDeliveryPersistence.findAll(start, end);
96      }
97  
98      public int getAnnouncementsDeliveriesCount() throws SystemException {
99          return announcementsDeliveryPersistence.countAll();
100     }
101 
102     public AnnouncementsDelivery updateAnnouncementsDelivery(
103         AnnouncementsDelivery announcementsDelivery) throws SystemException {
104         announcementsDelivery.setNew(false);
105 
106         return announcementsDeliveryPersistence.update(announcementsDelivery,
107             true);
108     }
109 
110     public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
111         return announcementsDeliveryPersistence;
112     }
113 
114     public void setAnnouncementsDeliveryPersistence(
115         AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
116         this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
117     }
118 
119     public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
120         return announcementsEntryLocalService;
121     }
122 
123     public void setAnnouncementsEntryLocalService(
124         AnnouncementsEntryLocalService announcementsEntryLocalService) {
125         this.announcementsEntryLocalService = announcementsEntryLocalService;
126     }
127 
128     public AnnouncementsEntryService getAnnouncementsEntryService() {
129         return announcementsEntryService;
130     }
131 
132     public void setAnnouncementsEntryService(
133         AnnouncementsEntryService announcementsEntryService) {
134         this.announcementsEntryService = announcementsEntryService;
135     }
136 
137     public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
138         return announcementsEntryPersistence;
139     }
140 
141     public void setAnnouncementsEntryPersistence(
142         AnnouncementsEntryPersistence announcementsEntryPersistence) {
143         this.announcementsEntryPersistence = announcementsEntryPersistence;
144     }
145 
146     public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
147         return announcementsEntryFinder;
148     }
149 
150     public void setAnnouncementsEntryFinder(
151         AnnouncementsEntryFinder announcementsEntryFinder) {
152         this.announcementsEntryFinder = announcementsEntryFinder;
153     }
154 
155     public AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
156         return announcementsFlagLocalService;
157     }
158 
159     public void setAnnouncementsFlagLocalService(
160         AnnouncementsFlagLocalService announcementsFlagLocalService) {
161         this.announcementsFlagLocalService = announcementsFlagLocalService;
162     }
163 
164     public AnnouncementsFlagService getAnnouncementsFlagService() {
165         return announcementsFlagService;
166     }
167 
168     public void setAnnouncementsFlagService(
169         AnnouncementsFlagService announcementsFlagService) {
170         this.announcementsFlagService = announcementsFlagService;
171     }
172 
173     public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
174         return announcementsFlagPersistence;
175     }
176 
177     public void setAnnouncementsFlagPersistence(
178         AnnouncementsFlagPersistence announcementsFlagPersistence) {
179         this.announcementsFlagPersistence = announcementsFlagPersistence;
180     }
181 
182     public CounterLocalService getCounterLocalService() {
183         return counterLocalService;
184     }
185 
186     public void setCounterLocalService(CounterLocalService counterLocalService) {
187         this.counterLocalService = counterLocalService;
188     }
189 
190     public CounterService getCounterService() {
191         return counterService;
192     }
193 
194     public void setCounterService(CounterService counterService) {
195         this.counterService = counterService;
196     }
197 
198     public UserLocalService getUserLocalService() {
199         return userLocalService;
200     }
201 
202     public void setUserLocalService(UserLocalService userLocalService) {
203         this.userLocalService = userLocalService;
204     }
205 
206     public UserService getUserService() {
207         return userService;
208     }
209 
210     public void setUserService(UserService userService) {
211         this.userService = userService;
212     }
213 
214     public UserPersistence getUserPersistence() {
215         return userPersistence;
216     }
217 
218     public void setUserPersistence(UserPersistence userPersistence) {
219         this.userPersistence = userPersistence;
220     }
221 
222     public UserFinder getUserFinder() {
223         return userFinder;
224     }
225 
226     public void setUserFinder(UserFinder userFinder) {
227         this.userFinder = userFinder;
228     }
229 
230     public void afterPropertiesSet() {
231         if (announcementsDeliveryPersistence == null) {
232             announcementsDeliveryPersistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName() +
233                     ".impl");
234         }
235 
236         if (announcementsEntryLocalService == null) {
237             announcementsEntryLocalService = (AnnouncementsEntryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsEntryLocalService.class.getName() +
238                     ".impl");
239         }
240 
241         if (announcementsEntryService == null) {
242             announcementsEntryService = (AnnouncementsEntryService)PortalBeanLocatorUtil.locate(AnnouncementsEntryService.class.getName() +
243                     ".impl");
244         }
245 
246         if (announcementsEntryPersistence == null) {
247             announcementsEntryPersistence = (AnnouncementsEntryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsEntryPersistence.class.getName() +
248                     ".impl");
249         }
250 
251         if (announcementsEntryFinder == null) {
252             announcementsEntryFinder = (AnnouncementsEntryFinder)PortalBeanLocatorUtil.locate(AnnouncementsEntryFinder.class.getName() +
253                     ".impl");
254         }
255 
256         if (announcementsFlagLocalService == null) {
257             announcementsFlagLocalService = (AnnouncementsFlagLocalService)PortalBeanLocatorUtil.locate(AnnouncementsFlagLocalService.class.getName() +
258                     ".impl");
259         }
260 
261         if (announcementsFlagService == null) {
262             announcementsFlagService = (AnnouncementsFlagService)PortalBeanLocatorUtil.locate(AnnouncementsFlagService.class.getName() +
263                     ".impl");
264         }
265 
266         if (announcementsFlagPersistence == null) {
267             announcementsFlagPersistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName() +
268                     ".impl");
269         }
270 
271         if (counterLocalService == null) {
272             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
273                     ".impl");
274         }
275 
276         if (counterService == null) {
277             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
278                     ".impl");
279         }
280 
281         if (userLocalService == null) {
282             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
283                     ".impl");
284         }
285 
286         if (userService == null) {
287             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
288                     ".impl");
289         }
290 
291         if (userPersistence == null) {
292             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
293                     ".impl");
294         }
295 
296         if (userFinder == null) {
297             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
298                     ".impl");
299         }
300     }
301 
302     protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
303     protected AnnouncementsEntryLocalService announcementsEntryLocalService;
304     protected AnnouncementsEntryService announcementsEntryService;
305     protected AnnouncementsEntryPersistence announcementsEntryPersistence;
306     protected AnnouncementsEntryFinder announcementsEntryFinder;
307     protected AnnouncementsFlagLocalService announcementsFlagLocalService;
308     protected AnnouncementsFlagService announcementsFlagService;
309     protected AnnouncementsFlagPersistence announcementsFlagPersistence;
310     protected CounterLocalService counterLocalService;
311     protected CounterService counterService;
312     protected UserLocalService userLocalService;
313     protected UserService userService;
314     protected UserPersistence userPersistence;
315     protected UserFinder userFinder;
316 }