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         return blogsStatsUserPersistence.update(model, true);
102     }
103 
104     public BlogsEntryLocalService getBlogsEntryLocalService() {
105         return blogsEntryLocalService;
106     }
107 
108     public void setBlogsEntryLocalService(
109         BlogsEntryLocalService blogsEntryLocalService) {
110         this.blogsEntryLocalService = blogsEntryLocalService;
111     }
112 
113     public BlogsEntryService getBlogsEntryService() {
114         return blogsEntryService;
115     }
116 
117     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
118         this.blogsEntryService = blogsEntryService;
119     }
120 
121     public BlogsEntryPersistence getBlogsEntryPersistence() {
122         return blogsEntryPersistence;
123     }
124 
125     public void setBlogsEntryPersistence(
126         BlogsEntryPersistence blogsEntryPersistence) {
127         this.blogsEntryPersistence = blogsEntryPersistence;
128     }
129 
130     public BlogsEntryFinder getBlogsEntryFinder() {
131         return blogsEntryFinder;
132     }
133 
134     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
135         this.blogsEntryFinder = blogsEntryFinder;
136     }
137 
138     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
139         return blogsStatsUserPersistence;
140     }
141 
142     public void setBlogsStatsUserPersistence(
143         BlogsStatsUserPersistence blogsStatsUserPersistence) {
144         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
145     }
146 
147     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
148         return blogsStatsUserFinder;
149     }
150 
151     public void setBlogsStatsUserFinder(
152         BlogsStatsUserFinder blogsStatsUserFinder) {
153         this.blogsStatsUserFinder = blogsStatsUserFinder;
154     }
155 
156     public CounterLocalService getCounterLocalService() {
157         return counterLocalService;
158     }
159 
160     public void setCounterLocalService(CounterLocalService counterLocalService) {
161         this.counterLocalService = counterLocalService;
162     }
163 
164     public CounterService getCounterService() {
165         return counterService;
166     }
167 
168     public void setCounterService(CounterService counterService) {
169         this.counterService = counterService;
170     }
171 
172     public GroupLocalService getGroupLocalService() {
173         return groupLocalService;
174     }
175 
176     public void setGroupLocalService(GroupLocalService groupLocalService) {
177         this.groupLocalService = groupLocalService;
178     }
179 
180     public GroupService getGroupService() {
181         return groupService;
182     }
183 
184     public void setGroupService(GroupService groupService) {
185         this.groupService = groupService;
186     }
187 
188     public GroupPersistence getGroupPersistence() {
189         return groupPersistence;
190     }
191 
192     public void setGroupPersistence(GroupPersistence groupPersistence) {
193         this.groupPersistence = groupPersistence;
194     }
195 
196     public GroupFinder getGroupFinder() {
197         return groupFinder;
198     }
199 
200     public void setGroupFinder(GroupFinder groupFinder) {
201         this.groupFinder = groupFinder;
202     }
203 
204     public void afterPropertiesSet() {
205         if (blogsEntryLocalService == null) {
206             blogsEntryLocalService = BlogsEntryLocalServiceFactory.getImpl();
207         }
208 
209         if (blogsEntryService == null) {
210             blogsEntryService = BlogsEntryServiceFactory.getImpl();
211         }
212 
213         if (blogsEntryPersistence == null) {
214             blogsEntryPersistence = BlogsEntryUtil.getPersistence();
215         }
216 
217         if (blogsEntryFinder == null) {
218             blogsEntryFinder = BlogsEntryFinderUtil.getFinder();
219         }
220 
221         if (blogsStatsUserPersistence == null) {
222             blogsStatsUserPersistence = BlogsStatsUserUtil.getPersistence();
223         }
224 
225         if (blogsStatsUserFinder == null) {
226             blogsStatsUserFinder = BlogsStatsUserFinderUtil.getFinder();
227         }
228 
229         if (counterLocalService == null) {
230             counterLocalService = CounterLocalServiceFactory.getImpl();
231         }
232 
233         if (counterService == null) {
234             counterService = CounterServiceFactory.getImpl();
235         }
236 
237         if (groupLocalService == null) {
238             groupLocalService = GroupLocalServiceFactory.getImpl();
239         }
240 
241         if (groupService == null) {
242             groupService = GroupServiceFactory.getImpl();
243         }
244 
245         if (groupPersistence == null) {
246             groupPersistence = GroupUtil.getPersistence();
247         }
248 
249         if (groupFinder == null) {
250             groupFinder = GroupFinderUtil.getFinder();
251         }
252     }
253 
254     protected BlogsEntryLocalService blogsEntryLocalService;
255     protected BlogsEntryService blogsEntryService;
256     protected BlogsEntryPersistence blogsEntryPersistence;
257     protected BlogsEntryFinder blogsEntryFinder;
258     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
259     protected BlogsStatsUserFinder blogsStatsUserFinder;
260     protected CounterLocalService counterLocalService;
261     protected CounterService counterService;
262     protected GroupLocalService groupLocalService;
263     protected GroupService groupService;
264     protected GroupPersistence groupPersistence;
265     protected GroupFinder groupFinder;
266 }