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