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.blogs.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.SystemException;
31  import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
32  import com.liferay.portal.service.GroupLocalService;
33  import com.liferay.portal.service.GroupLocalServiceFactory;
34  import com.liferay.portal.service.GroupService;
35  import com.liferay.portal.service.GroupServiceFactory;
36  import com.liferay.portal.service.persistence.GroupFinder;
37  import com.liferay.portal.service.persistence.GroupFinderUtil;
38  import com.liferay.portal.service.persistence.GroupPersistence;
39  import com.liferay.portal.service.persistence.GroupUtil;
40  
41  import com.liferay.portlet.blogs.model.BlogsStatsUser;
42  import com.liferay.portlet.blogs.model.impl.BlogsStatsUserImpl;
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.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  
57  import org.springframework.beans.factory.InitializingBean;
58  
59  import java.util.List;
60  
61  /**
62   * <a href="BlogsStatsUserLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
63   *
64   * @author Brian Wing Shun Chan
65   *
66   */
67  public abstract class BlogsStatsUserLocalServiceBaseImpl
68      implements BlogsStatsUserLocalService, InitializingBean {
69      public BlogsStatsUser addBlogsStatsUser(BlogsStatsUser model)
70          throws SystemException {
71          BlogsStatsUser blogsStatsUser = new BlogsStatsUserImpl();
72  
73          blogsStatsUser.setNew(true);
74  
75          blogsStatsUser.setStatsUserId(model.getStatsUserId());
76          blogsStatsUser.setGroupId(model.getGroupId());
77          blogsStatsUser.setCompanyId(model.getCompanyId());
78          blogsStatsUser.setUserId(model.getUserId());
79          blogsStatsUser.setEntryCount(model.getEntryCount());
80          blogsStatsUser.setLastPostDate(model.getLastPostDate());
81          blogsStatsUser.setRatingsTotalEntries(model.getRatingsTotalEntries());
82          blogsStatsUser.setRatingsTotalScore(model.getRatingsTotalScore());
83          blogsStatsUser.setRatingsAverageScore(model.getRatingsAverageScore());
84  
85          return blogsStatsUserPersistence.update(blogsStatsUser);
86      }
87  
88      public List dynamicQuery(DynamicQueryInitializer queryInitializer)
89          throws SystemException {
90          return blogsStatsUserPersistence.findWithDynamicQuery(queryInitializer);
91      }
92  
93      public List dynamicQuery(DynamicQueryInitializer queryInitializer,
94          int begin, int end) throws SystemException {
95          return blogsStatsUserPersistence.findWithDynamicQuery(queryInitializer,
96              begin, end);
97      }
98  
99      public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser model)
100         throws SystemException {
101         BlogsStatsUser blogsStatsUser = new BlogsStatsUserImpl();
102 
103         blogsStatsUser.setNew(false);
104 
105         blogsStatsUser.setStatsUserId(model.getStatsUserId());
106         blogsStatsUser.setGroupId(model.getGroupId());
107         blogsStatsUser.setCompanyId(model.getCompanyId());
108         blogsStatsUser.setUserId(model.getUserId());
109         blogsStatsUser.setEntryCount(model.getEntryCount());
110         blogsStatsUser.setLastPostDate(model.getLastPostDate());
111         blogsStatsUser.setRatingsTotalEntries(model.getRatingsTotalEntries());
112         blogsStatsUser.setRatingsTotalScore(model.getRatingsTotalScore());
113         blogsStatsUser.setRatingsAverageScore(model.getRatingsAverageScore());
114 
115         return blogsStatsUserPersistence.update(blogsStatsUser);
116     }
117 
118     public BlogsEntryLocalService getBlogsEntryLocalService() {
119         return blogsEntryLocalService;
120     }
121 
122     public void setBlogsEntryLocalService(
123         BlogsEntryLocalService blogsEntryLocalService) {
124         this.blogsEntryLocalService = blogsEntryLocalService;
125     }
126 
127     public BlogsEntryService getBlogsEntryService() {
128         return blogsEntryService;
129     }
130 
131     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
132         this.blogsEntryService = blogsEntryService;
133     }
134 
135     public BlogsEntryPersistence getBlogsEntryPersistence() {
136         return blogsEntryPersistence;
137     }
138 
139     public void setBlogsEntryPersistence(
140         BlogsEntryPersistence blogsEntryPersistence) {
141         this.blogsEntryPersistence = blogsEntryPersistence;
142     }
143 
144     public BlogsEntryFinder getBlogsEntryFinder() {
145         return blogsEntryFinder;
146     }
147 
148     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
149         this.blogsEntryFinder = blogsEntryFinder;
150     }
151 
152     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
153         return blogsStatsUserPersistence;
154     }
155 
156     public void setBlogsStatsUserPersistence(
157         BlogsStatsUserPersistence blogsStatsUserPersistence) {
158         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
159     }
160 
161     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
162         return blogsStatsUserFinder;
163     }
164 
165     public void setBlogsStatsUserFinder(
166         BlogsStatsUserFinder blogsStatsUserFinder) {
167         this.blogsStatsUserFinder = blogsStatsUserFinder;
168     }
169 
170     public CounterLocalService getCounterLocalService() {
171         return counterLocalService;
172     }
173 
174     public void setCounterLocalService(CounterLocalService counterLocalService) {
175         this.counterLocalService = counterLocalService;
176     }
177 
178     public CounterService getCounterService() {
179         return counterService;
180     }
181 
182     public void setCounterService(CounterService counterService) {
183         this.counterService = counterService;
184     }
185 
186     public GroupLocalService getGroupLocalService() {
187         return groupLocalService;
188     }
189 
190     public void setGroupLocalService(GroupLocalService groupLocalService) {
191         this.groupLocalService = groupLocalService;
192     }
193 
194     public GroupService getGroupService() {
195         return groupService;
196     }
197 
198     public void setGroupService(GroupService groupService) {
199         this.groupService = groupService;
200     }
201 
202     public GroupPersistence getGroupPersistence() {
203         return groupPersistence;
204     }
205 
206     public void setGroupPersistence(GroupPersistence groupPersistence) {
207         this.groupPersistence = groupPersistence;
208     }
209 
210     public GroupFinder getGroupFinder() {
211         return groupFinder;
212     }
213 
214     public void setGroupFinder(GroupFinder groupFinder) {
215         this.groupFinder = groupFinder;
216     }
217 
218     public void afterPropertiesSet() {
219         if (blogsEntryLocalService == null) {
220             blogsEntryLocalService = BlogsEntryLocalServiceFactory.getImpl();
221         }
222 
223         if (blogsEntryService == null) {
224             blogsEntryService = BlogsEntryServiceFactory.getImpl();
225         }
226 
227         if (blogsEntryPersistence == null) {
228             blogsEntryPersistence = BlogsEntryUtil.getPersistence();
229         }
230 
231         if (blogsEntryFinder == null) {
232             blogsEntryFinder = BlogsEntryFinderUtil.getFinder();
233         }
234 
235         if (blogsStatsUserPersistence == null) {
236             blogsStatsUserPersistence = BlogsStatsUserUtil.getPersistence();
237         }
238 
239         if (blogsStatsUserFinder == null) {
240             blogsStatsUserFinder = BlogsStatsUserFinderUtil.getFinder();
241         }
242 
243         if (counterLocalService == null) {
244             counterLocalService = CounterLocalServiceFactory.getImpl();
245         }
246 
247         if (counterService == null) {
248             counterService = CounterServiceFactory.getImpl();
249         }
250 
251         if (groupLocalService == null) {
252             groupLocalService = GroupLocalServiceFactory.getImpl();
253         }
254 
255         if (groupService == null) {
256             groupService = GroupServiceFactory.getImpl();
257         }
258 
259         if (groupPersistence == null) {
260             groupPersistence = GroupUtil.getPersistence();
261         }
262 
263         if (groupFinder == null) {
264             groupFinder = GroupFinderUtil.getFinder();
265         }
266     }
267 
268     protected BlogsEntryLocalService blogsEntryLocalService;
269     protected BlogsEntryService blogsEntryService;
270     protected BlogsEntryPersistence blogsEntryPersistence;
271     protected BlogsEntryFinder blogsEntryFinder;
272     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
273     protected BlogsStatsUserFinder blogsStatsUserFinder;
274     protected CounterLocalService counterLocalService;
275     protected CounterService counterService;
276     protected GroupLocalService groupLocalService;
277     protected GroupService groupService;
278     protected GroupPersistence groupPersistence;
279     protected GroupFinder groupFinder;
280 }