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.messageboards.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.messageboards.model.MBStatsUser;
35  import com.liferay.portlet.messageboards.service.MBBanLocalService;
36  import com.liferay.portlet.messageboards.service.MBBanService;
37  import com.liferay.portlet.messageboards.service.MBCategoryLocalService;
38  import com.liferay.portlet.messageboards.service.MBCategoryService;
39  import com.liferay.portlet.messageboards.service.MBMessageFlagLocalService;
40  import com.liferay.portlet.messageboards.service.MBMessageLocalService;
41  import com.liferay.portlet.messageboards.service.MBMessageService;
42  import com.liferay.portlet.messageboards.service.MBStatsUserLocalService;
43  import com.liferay.portlet.messageboards.service.MBThreadLocalService;
44  import com.liferay.portlet.messageboards.service.MBThreadService;
45  import com.liferay.portlet.messageboards.service.persistence.MBBanPersistence;
46  import com.liferay.portlet.messageboards.service.persistence.MBCategoryFinder;
47  import com.liferay.portlet.messageboards.service.persistence.MBCategoryPersistence;
48  import com.liferay.portlet.messageboards.service.persistence.MBDiscussionPersistence;
49  import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
50  import com.liferay.portlet.messageboards.service.persistence.MBMessageFlagFinder;
51  import com.liferay.portlet.messageboards.service.persistence.MBMessageFlagPersistence;
52  import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
53  import com.liferay.portlet.messageboards.service.persistence.MBStatsUserPersistence;
54  import com.liferay.portlet.messageboards.service.persistence.MBThreadFinder;
55  import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
56  
57  import java.util.List;
58  
59  /**
60   * <a href="MBStatsUserLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
61   *
62   * @author Brian Wing Shun Chan
63   *
64   */
65  public abstract class MBStatsUserLocalServiceBaseImpl
66      implements MBStatsUserLocalService, InitializingBean {
67      public MBStatsUser addMBStatsUser(MBStatsUser mbStatsUser)
68          throws SystemException {
69          mbStatsUser.setNew(true);
70  
71          return mbStatsUserPersistence.update(mbStatsUser, false);
72      }
73  
74      public void deleteMBStatsUser(long statsUserId)
75          throws PortalException, SystemException {
76          mbStatsUserPersistence.remove(statsUserId);
77      }
78  
79      public void deleteMBStatsUser(MBStatsUser mbStatsUser)
80          throws SystemException {
81          mbStatsUserPersistence.remove(mbStatsUser);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
85          throws SystemException {
86          return mbStatsUserPersistence.findWithDynamicQuery(dynamicQuery);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
90          int end) throws SystemException {
91          return mbStatsUserPersistence.findWithDynamicQuery(dynamicQuery, start,
92              end);
93      }
94  
95      public MBStatsUser getMBStatsUser(long statsUserId)
96          throws PortalException, SystemException {
97          return mbStatsUserPersistence.findByPrimaryKey(statsUserId);
98      }
99  
100     public List<MBStatsUser> getMBStatsUsers(int start, int end)
101         throws SystemException {
102         return mbStatsUserPersistence.findAll(start, end);
103     }
104 
105     public int getMBStatsUsersCount() throws SystemException {
106         return mbStatsUserPersistence.countAll();
107     }
108 
109     public MBStatsUser updateMBStatsUser(MBStatsUser mbStatsUser)
110         throws SystemException {
111         mbStatsUser.setNew(false);
112 
113         return mbStatsUserPersistence.update(mbStatsUser, true);
114     }
115 
116     public MBBanLocalService getMBBanLocalService() {
117         return mbBanLocalService;
118     }
119 
120     public void setMBBanLocalService(MBBanLocalService mbBanLocalService) {
121         this.mbBanLocalService = mbBanLocalService;
122     }
123 
124     public MBBanService getMBBanService() {
125         return mbBanService;
126     }
127 
128     public void setMBBanService(MBBanService mbBanService) {
129         this.mbBanService = mbBanService;
130     }
131 
132     public MBBanPersistence getMBBanPersistence() {
133         return mbBanPersistence;
134     }
135 
136     public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
137         this.mbBanPersistence = mbBanPersistence;
138     }
139 
140     public MBCategoryLocalService getMBCategoryLocalService() {
141         return mbCategoryLocalService;
142     }
143 
144     public void setMBCategoryLocalService(
145         MBCategoryLocalService mbCategoryLocalService) {
146         this.mbCategoryLocalService = mbCategoryLocalService;
147     }
148 
149     public MBCategoryService getMBCategoryService() {
150         return mbCategoryService;
151     }
152 
153     public void setMBCategoryService(MBCategoryService mbCategoryService) {
154         this.mbCategoryService = mbCategoryService;
155     }
156 
157     public MBCategoryPersistence getMBCategoryPersistence() {
158         return mbCategoryPersistence;
159     }
160 
161     public void setMBCategoryPersistence(
162         MBCategoryPersistence mbCategoryPersistence) {
163         this.mbCategoryPersistence = mbCategoryPersistence;
164     }
165 
166     public MBCategoryFinder getMBCategoryFinder() {
167         return mbCategoryFinder;
168     }
169 
170     public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
171         this.mbCategoryFinder = mbCategoryFinder;
172     }
173 
174     public MBDiscussionPersistence getMBDiscussionPersistence() {
175         return mbDiscussionPersistence;
176     }
177 
178     public void setMBDiscussionPersistence(
179         MBDiscussionPersistence mbDiscussionPersistence) {
180         this.mbDiscussionPersistence = mbDiscussionPersistence;
181     }
182 
183     public MBMessageLocalService getMBMessageLocalService() {
184         return mbMessageLocalService;
185     }
186 
187     public void setMBMessageLocalService(
188         MBMessageLocalService mbMessageLocalService) {
189         this.mbMessageLocalService = mbMessageLocalService;
190     }
191 
192     public MBMessageService getMBMessageService() {
193         return mbMessageService;
194     }
195 
196     public void setMBMessageService(MBMessageService mbMessageService) {
197         this.mbMessageService = mbMessageService;
198     }
199 
200     public MBMessagePersistence getMBMessagePersistence() {
201         return mbMessagePersistence;
202     }
203 
204     public void setMBMessagePersistence(
205         MBMessagePersistence mbMessagePersistence) {
206         this.mbMessagePersistence = mbMessagePersistence;
207     }
208 
209     public MBMessageFinder getMBMessageFinder() {
210         return mbMessageFinder;
211     }
212 
213     public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
214         this.mbMessageFinder = mbMessageFinder;
215     }
216 
217     public MBMessageFlagLocalService getMBMessageFlagLocalService() {
218         return mbMessageFlagLocalService;
219     }
220 
221     public void setMBMessageFlagLocalService(
222         MBMessageFlagLocalService mbMessageFlagLocalService) {
223         this.mbMessageFlagLocalService = mbMessageFlagLocalService;
224     }
225 
226     public MBMessageFlagPersistence getMBMessageFlagPersistence() {
227         return mbMessageFlagPersistence;
228     }
229 
230     public void setMBMessageFlagPersistence(
231         MBMessageFlagPersistence mbMessageFlagPersistence) {
232         this.mbMessageFlagPersistence = mbMessageFlagPersistence;
233     }
234 
235     public MBMessageFlagFinder getMBMessageFlagFinder() {
236         return mbMessageFlagFinder;
237     }
238 
239     public void setMBMessageFlagFinder(MBMessageFlagFinder mbMessageFlagFinder) {
240         this.mbMessageFlagFinder = mbMessageFlagFinder;
241     }
242 
243     public MBStatsUserPersistence getMBStatsUserPersistence() {
244         return mbStatsUserPersistence;
245     }
246 
247     public void setMBStatsUserPersistence(
248         MBStatsUserPersistence mbStatsUserPersistence) {
249         this.mbStatsUserPersistence = mbStatsUserPersistence;
250     }
251 
252     public MBThreadLocalService getMBThreadLocalService() {
253         return mbThreadLocalService;
254     }
255 
256     public void setMBThreadLocalService(
257         MBThreadLocalService mbThreadLocalService) {
258         this.mbThreadLocalService = mbThreadLocalService;
259     }
260 
261     public MBThreadService getMBThreadService() {
262         return mbThreadService;
263     }
264 
265     public void setMBThreadService(MBThreadService mbThreadService) {
266         this.mbThreadService = mbThreadService;
267     }
268 
269     public MBThreadPersistence getMBThreadPersistence() {
270         return mbThreadPersistence;
271     }
272 
273     public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
274         this.mbThreadPersistence = mbThreadPersistence;
275     }
276 
277     public MBThreadFinder getMBThreadFinder() {
278         return mbThreadFinder;
279     }
280 
281     public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
282         this.mbThreadFinder = mbThreadFinder;
283     }
284 
285     public CounterLocalService getCounterLocalService() {
286         return counterLocalService;
287     }
288 
289     public void setCounterLocalService(CounterLocalService counterLocalService) {
290         this.counterLocalService = counterLocalService;
291     }
292 
293     public CounterService getCounterService() {
294         return counterService;
295     }
296 
297     public void setCounterService(CounterService counterService) {
298         this.counterService = counterService;
299     }
300 
301     public void afterPropertiesSet() {
302         if (mbBanLocalService == null) {
303             mbBanLocalService = (MBBanLocalService)PortalBeanLocatorUtil.locate(MBBanLocalService.class.getName() +
304                     ".impl");
305         }
306 
307         if (mbBanService == null) {
308             mbBanService = (MBBanService)PortalBeanLocatorUtil.locate(MBBanService.class.getName() +
309                     ".impl");
310         }
311 
312         if (mbBanPersistence == null) {
313             mbBanPersistence = (MBBanPersistence)PortalBeanLocatorUtil.locate(MBBanPersistence.class.getName() +
314                     ".impl");
315         }
316 
317         if (mbCategoryLocalService == null) {
318             mbCategoryLocalService = (MBCategoryLocalService)PortalBeanLocatorUtil.locate(MBCategoryLocalService.class.getName() +
319                     ".impl");
320         }
321 
322         if (mbCategoryService == null) {
323             mbCategoryService = (MBCategoryService)PortalBeanLocatorUtil.locate(MBCategoryService.class.getName() +
324                     ".impl");
325         }
326 
327         if (mbCategoryPersistence == null) {
328             mbCategoryPersistence = (MBCategoryPersistence)PortalBeanLocatorUtil.locate(MBCategoryPersistence.class.getName() +
329                     ".impl");
330         }
331 
332         if (mbCategoryFinder == null) {
333             mbCategoryFinder = (MBCategoryFinder)PortalBeanLocatorUtil.locate(MBCategoryFinder.class.getName() +
334                     ".impl");
335         }
336 
337         if (mbDiscussionPersistence == null) {
338             mbDiscussionPersistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName() +
339                     ".impl");
340         }
341 
342         if (mbMessageLocalService == null) {
343             mbMessageLocalService = (MBMessageLocalService)PortalBeanLocatorUtil.locate(MBMessageLocalService.class.getName() +
344                     ".impl");
345         }
346 
347         if (mbMessageService == null) {
348             mbMessageService = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName() +
349                     ".impl");
350         }
351 
352         if (mbMessagePersistence == null) {
353             mbMessagePersistence = (MBMessagePersistence)PortalBeanLocatorUtil.locate(MBMessagePersistence.class.getName() +
354                     ".impl");
355         }
356 
357         if (mbMessageFinder == null) {
358             mbMessageFinder = (MBMessageFinder)PortalBeanLocatorUtil.locate(MBMessageFinder.class.getName() +
359                     ".impl");
360         }
361 
362         if (mbMessageFlagLocalService == null) {
363             mbMessageFlagLocalService = (MBMessageFlagLocalService)PortalBeanLocatorUtil.locate(MBMessageFlagLocalService.class.getName() +
364                     ".impl");
365         }
366 
367         if (mbMessageFlagPersistence == null) {
368             mbMessageFlagPersistence = (MBMessageFlagPersistence)PortalBeanLocatorUtil.locate(MBMessageFlagPersistence.class.getName() +
369                     ".impl");
370         }
371 
372         if (mbMessageFlagFinder == null) {
373             mbMessageFlagFinder = (MBMessageFlagFinder)PortalBeanLocatorUtil.locate(MBMessageFlagFinder.class.getName() +
374                     ".impl");
375         }
376 
377         if (mbStatsUserPersistence == null) {
378             mbStatsUserPersistence = (MBStatsUserPersistence)PortalBeanLocatorUtil.locate(MBStatsUserPersistence.class.getName() +
379                     ".impl");
380         }
381 
382         if (mbThreadLocalService == null) {
383             mbThreadLocalService = (MBThreadLocalService)PortalBeanLocatorUtil.locate(MBThreadLocalService.class.getName() +
384                     ".impl");
385         }
386 
387         if (mbThreadService == null) {
388             mbThreadService = (MBThreadService)PortalBeanLocatorUtil.locate(MBThreadService.class.getName() +
389                     ".impl");
390         }
391 
392         if (mbThreadPersistence == null) {
393             mbThreadPersistence = (MBThreadPersistence)PortalBeanLocatorUtil.locate(MBThreadPersistence.class.getName() +
394                     ".impl");
395         }
396 
397         if (mbThreadFinder == null) {
398             mbThreadFinder = (MBThreadFinder)PortalBeanLocatorUtil.locate(MBThreadFinder.class.getName() +
399                     ".impl");
400         }
401 
402         if (counterLocalService == null) {
403             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
404                     ".impl");
405         }
406 
407         if (counterService == null) {
408             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
409                     ".impl");
410         }
411     }
412 
413     protected MBBanLocalService mbBanLocalService;
414     protected MBBanService mbBanService;
415     protected MBBanPersistence mbBanPersistence;
416     protected MBCategoryLocalService mbCategoryLocalService;
417     protected MBCategoryService mbCategoryService;
418     protected MBCategoryPersistence mbCategoryPersistence;
419     protected MBCategoryFinder mbCategoryFinder;
420     protected MBDiscussionPersistence mbDiscussionPersistence;
421     protected MBMessageLocalService mbMessageLocalService;
422     protected MBMessageService mbMessageService;
423     protected MBMessagePersistence mbMessagePersistence;
424     protected MBMessageFinder mbMessageFinder;
425     protected MBMessageFlagLocalService mbMessageFlagLocalService;
426     protected MBMessageFlagPersistence mbMessageFlagPersistence;
427     protected MBMessageFlagFinder mbMessageFlagFinder;
428     protected MBStatsUserPersistence mbStatsUserPersistence;
429     protected MBThreadLocalService mbThreadLocalService;
430     protected MBThreadService mbThreadService;
431     protected MBThreadPersistence mbThreadPersistence;
432     protected MBThreadFinder mbThreadFinder;
433     protected CounterLocalService counterLocalService;
434     protected CounterService counterService;
435 }