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