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.ratings.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterLocalServiceFactory;
27  import com.liferay.counter.service.CounterService;
28  import com.liferay.counter.service.CounterServiceFactory;
29  
30  import com.liferay.portal.PortalException;
31  import com.liferay.portal.SystemException;
32  import com.liferay.portal.kernel.bean.InitializingBean;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.UserLocalService;
35  import com.liferay.portal.service.UserLocalServiceFactory;
36  import com.liferay.portal.service.UserService;
37  import com.liferay.portal.service.UserServiceFactory;
38  import com.liferay.portal.service.persistence.UserFinder;
39  import com.liferay.portal.service.persistence.UserFinderUtil;
40  import com.liferay.portal.service.persistence.UserPersistence;
41  import com.liferay.portal.service.persistence.UserUtil;
42  
43  import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
44  import com.liferay.portlet.blogs.service.BlogsEntryLocalServiceFactory;
45  import com.liferay.portlet.blogs.service.BlogsEntryService;
46  import com.liferay.portlet.blogs.service.BlogsEntryServiceFactory;
47  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
48  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalServiceFactory;
49  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
50  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinderUtil;
51  import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
52  import com.liferay.portlet.blogs.service.persistence.BlogsEntryUtil;
53  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
54  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinderUtil;
55  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
56  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserUtil;
57  import com.liferay.portlet.ratings.model.RatingsEntry;
58  import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
59  import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
60  import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceFactory;
61  import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
62  import com.liferay.portlet.ratings.service.persistence.RatingsEntryUtil;
63  import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
64  import com.liferay.portlet.ratings.service.persistence.RatingsStatsUtil;
65  
66  import java.util.List;
67  
68  /**
69   * <a href="RatingsEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
70   *
71   * @author Brian Wing Shun Chan
72   *
73   */
74  public abstract class RatingsEntryLocalServiceBaseImpl
75      implements RatingsEntryLocalService, InitializingBean {
76      public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry)
77          throws SystemException {
78          ratingsEntry.setNew(true);
79  
80          return ratingsEntryPersistence.update(ratingsEntry, false);
81      }
82  
83      public void deleteRatingsEntry(long entryId)
84          throws PortalException, SystemException {
85          ratingsEntryPersistence.remove(entryId);
86      }
87  
88      public void deleteRatingsEntry(RatingsEntry ratingsEntry)
89          throws SystemException {
90          ratingsEntryPersistence.remove(ratingsEntry);
91      }
92  
93      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
94          throws SystemException {
95          return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery);
96      }
97  
98      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
99          int end) throws SystemException {
100         return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
101             start, end);
102     }
103 
104     public RatingsEntry getRatingsEntry(long entryId)
105         throws PortalException, SystemException {
106         return ratingsEntryPersistence.findByPrimaryKey(entryId);
107     }
108 
109     public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry)
110         throws SystemException {
111         ratingsEntry.setNew(false);
112 
113         return ratingsEntryPersistence.update(ratingsEntry, true);
114     }
115 
116     public RatingsEntryPersistence getRatingsEntryPersistence() {
117         return ratingsEntryPersistence;
118     }
119 
120     public void setRatingsEntryPersistence(
121         RatingsEntryPersistence ratingsEntryPersistence) {
122         this.ratingsEntryPersistence = ratingsEntryPersistence;
123     }
124 
125     public RatingsStatsLocalService getRatingsStatsLocalService() {
126         return ratingsStatsLocalService;
127     }
128 
129     public void setRatingsStatsLocalService(
130         RatingsStatsLocalService ratingsStatsLocalService) {
131         this.ratingsStatsLocalService = ratingsStatsLocalService;
132     }
133 
134     public RatingsStatsPersistence getRatingsStatsPersistence() {
135         return ratingsStatsPersistence;
136     }
137 
138     public void setRatingsStatsPersistence(
139         RatingsStatsPersistence ratingsStatsPersistence) {
140         this.ratingsStatsPersistence = ratingsStatsPersistence;
141     }
142 
143     public CounterLocalService getCounterLocalService() {
144         return counterLocalService;
145     }
146 
147     public void setCounterLocalService(CounterLocalService counterLocalService) {
148         this.counterLocalService = counterLocalService;
149     }
150 
151     public CounterService getCounterService() {
152         return counterService;
153     }
154 
155     public void setCounterService(CounterService counterService) {
156         this.counterService = counterService;
157     }
158 
159     public UserLocalService getUserLocalService() {
160         return userLocalService;
161     }
162 
163     public void setUserLocalService(UserLocalService userLocalService) {
164         this.userLocalService = userLocalService;
165     }
166 
167     public UserService getUserService() {
168         return userService;
169     }
170 
171     public void setUserService(UserService userService) {
172         this.userService = userService;
173     }
174 
175     public UserPersistence getUserPersistence() {
176         return userPersistence;
177     }
178 
179     public void setUserPersistence(UserPersistence userPersistence) {
180         this.userPersistence = userPersistence;
181     }
182 
183     public UserFinder getUserFinder() {
184         return userFinder;
185     }
186 
187     public void setUserFinder(UserFinder userFinder) {
188         this.userFinder = userFinder;
189     }
190 
191     public BlogsEntryLocalService getBlogsEntryLocalService() {
192         return blogsEntryLocalService;
193     }
194 
195     public void setBlogsEntryLocalService(
196         BlogsEntryLocalService blogsEntryLocalService) {
197         this.blogsEntryLocalService = blogsEntryLocalService;
198     }
199 
200     public BlogsEntryService getBlogsEntryService() {
201         return blogsEntryService;
202     }
203 
204     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
205         this.blogsEntryService = blogsEntryService;
206     }
207 
208     public BlogsEntryPersistence getBlogsEntryPersistence() {
209         return blogsEntryPersistence;
210     }
211 
212     public void setBlogsEntryPersistence(
213         BlogsEntryPersistence blogsEntryPersistence) {
214         this.blogsEntryPersistence = blogsEntryPersistence;
215     }
216 
217     public BlogsEntryFinder getBlogsEntryFinder() {
218         return blogsEntryFinder;
219     }
220 
221     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
222         this.blogsEntryFinder = blogsEntryFinder;
223     }
224 
225     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
226         return blogsStatsUserLocalService;
227     }
228 
229     public void setBlogsStatsUserLocalService(
230         BlogsStatsUserLocalService blogsStatsUserLocalService) {
231         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
232     }
233 
234     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
235         return blogsStatsUserPersistence;
236     }
237 
238     public void setBlogsStatsUserPersistence(
239         BlogsStatsUserPersistence blogsStatsUserPersistence) {
240         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
241     }
242 
243     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
244         return blogsStatsUserFinder;
245     }
246 
247     public void setBlogsStatsUserFinder(
248         BlogsStatsUserFinder blogsStatsUserFinder) {
249         this.blogsStatsUserFinder = blogsStatsUserFinder;
250     }
251 
252     public void afterPropertiesSet() {
253         if (ratingsEntryPersistence == null) {
254             ratingsEntryPersistence = RatingsEntryUtil.getPersistence();
255         }
256 
257         if (ratingsStatsLocalService == null) {
258             ratingsStatsLocalService = RatingsStatsLocalServiceFactory.getImpl();
259         }
260 
261         if (ratingsStatsPersistence == null) {
262             ratingsStatsPersistence = RatingsStatsUtil.getPersistence();
263         }
264 
265         if (counterLocalService == null) {
266             counterLocalService = CounterLocalServiceFactory.getImpl();
267         }
268 
269         if (counterService == null) {
270             counterService = CounterServiceFactory.getImpl();
271         }
272 
273         if (userLocalService == null) {
274             userLocalService = UserLocalServiceFactory.getImpl();
275         }
276 
277         if (userService == null) {
278             userService = UserServiceFactory.getImpl();
279         }
280 
281         if (userPersistence == null) {
282             userPersistence = UserUtil.getPersistence();
283         }
284 
285         if (userFinder == null) {
286             userFinder = UserFinderUtil.getFinder();
287         }
288 
289         if (blogsEntryLocalService == null) {
290             blogsEntryLocalService = BlogsEntryLocalServiceFactory.getImpl();
291         }
292 
293         if (blogsEntryService == null) {
294             blogsEntryService = BlogsEntryServiceFactory.getImpl();
295         }
296 
297         if (blogsEntryPersistence == null) {
298             blogsEntryPersistence = BlogsEntryUtil.getPersistence();
299         }
300 
301         if (blogsEntryFinder == null) {
302             blogsEntryFinder = BlogsEntryFinderUtil.getFinder();
303         }
304 
305         if (blogsStatsUserLocalService == null) {
306             blogsStatsUserLocalService = BlogsStatsUserLocalServiceFactory.getImpl();
307         }
308 
309         if (blogsStatsUserPersistence == null) {
310             blogsStatsUserPersistence = BlogsStatsUserUtil.getPersistence();
311         }
312 
313         if (blogsStatsUserFinder == null) {
314             blogsStatsUserFinder = BlogsStatsUserFinderUtil.getFinder();
315         }
316     }
317 
318     protected RatingsEntryPersistence ratingsEntryPersistence;
319     protected RatingsStatsLocalService ratingsStatsLocalService;
320     protected RatingsStatsPersistence ratingsStatsPersistence;
321     protected CounterLocalService counterLocalService;
322     protected CounterService counterService;
323     protected UserLocalService userLocalService;
324     protected UserService userService;
325     protected UserPersistence userPersistence;
326     protected UserFinder userFinder;
327     protected BlogsEntryLocalService blogsEntryLocalService;
328     protected BlogsEntryService blogsEntryService;
329     protected BlogsEntryPersistence blogsEntryPersistence;
330     protected BlogsEntryFinder blogsEntryFinder;
331     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
332     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
333     protected BlogsStatsUserFinder blogsStatsUserFinder;
334 }