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