1   /**
2    * Copyright (c) 2000-2009 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.social.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.annotation.BeanReference;
31  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
32  import com.liferay.portal.service.UserLocalService;
33  import com.liferay.portal.service.UserService;
34  import com.liferay.portal.service.persistence.UserFinder;
35  import com.liferay.portal.service.persistence.UserPersistence;
36  import com.liferay.portal.util.PortalUtil;
37  
38  import com.liferay.portlet.social.model.SocialActivity;
39  import com.liferay.portlet.social.service.SocialActivityInterpreterLocalService;
40  import com.liferay.portlet.social.service.SocialActivityLocalService;
41  import com.liferay.portlet.social.service.SocialRelationLocalService;
42  import com.liferay.portlet.social.service.SocialRequestInterpreterLocalService;
43  import com.liferay.portlet.social.service.SocialRequestLocalService;
44  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
45  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
46  import com.liferay.portlet.social.service.persistence.SocialRelationPersistence;
47  import com.liferay.portlet.social.service.persistence.SocialRequestPersistence;
48  
49  import java.util.List;
50  
51  /**
52   * <a href="SocialActivityLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   */
57  public abstract class SocialActivityLocalServiceBaseImpl
58      implements SocialActivityLocalService {
59      public SocialActivity addSocialActivity(SocialActivity socialActivity)
60          throws SystemException {
61          socialActivity.setNew(true);
62  
63          return socialActivityPersistence.update(socialActivity, false);
64      }
65  
66      public SocialActivity createSocialActivity(long activityId) {
67          return socialActivityPersistence.create(activityId);
68      }
69  
70      public void deleteSocialActivity(long activityId)
71          throws PortalException, SystemException {
72          socialActivityPersistence.remove(activityId);
73      }
74  
75      public void deleteSocialActivity(SocialActivity socialActivity)
76          throws SystemException {
77          socialActivityPersistence.remove(socialActivity);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
81          throws SystemException {
82          return socialActivityPersistence.findWithDynamicQuery(dynamicQuery);
83      }
84  
85      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
86          int end) throws SystemException {
87          return socialActivityPersistence.findWithDynamicQuery(dynamicQuery,
88              start, end);
89      }
90  
91      public SocialActivity getSocialActivity(long activityId)
92          throws PortalException, SystemException {
93          return socialActivityPersistence.findByPrimaryKey(activityId);
94      }
95  
96      public List<SocialActivity> getSocialActivities(int start, int end)
97          throws SystemException {
98          return socialActivityPersistence.findAll(start, end);
99      }
100 
101     public int getSocialActivitiesCount() throws SystemException {
102         return socialActivityPersistence.countAll();
103     }
104 
105     public SocialActivity updateSocialActivity(SocialActivity socialActivity)
106         throws SystemException {
107         socialActivity.setNew(false);
108 
109         return socialActivityPersistence.update(socialActivity, true);
110     }
111 
112     public SocialActivity updateSocialActivity(SocialActivity socialActivity,
113         boolean merge) throws SystemException {
114         socialActivity.setNew(false);
115 
116         return socialActivityPersistence.update(socialActivity, merge);
117     }
118 
119     public SocialActivityLocalService getSocialActivityLocalService() {
120         return socialActivityLocalService;
121     }
122 
123     public void setSocialActivityLocalService(
124         SocialActivityLocalService socialActivityLocalService) {
125         this.socialActivityLocalService = socialActivityLocalService;
126     }
127 
128     public SocialActivityPersistence getSocialActivityPersistence() {
129         return socialActivityPersistence;
130     }
131 
132     public void setSocialActivityPersistence(
133         SocialActivityPersistence socialActivityPersistence) {
134         this.socialActivityPersistence = socialActivityPersistence;
135     }
136 
137     public SocialActivityFinder getSocialActivityFinder() {
138         return socialActivityFinder;
139     }
140 
141     public void setSocialActivityFinder(
142         SocialActivityFinder socialActivityFinder) {
143         this.socialActivityFinder = socialActivityFinder;
144     }
145 
146     public SocialActivityInterpreterLocalService getSocialActivityInterpreterLocalService() {
147         return socialActivityInterpreterLocalService;
148     }
149 
150     public void setSocialActivityInterpreterLocalService(
151         SocialActivityInterpreterLocalService socialActivityInterpreterLocalService) {
152         this.socialActivityInterpreterLocalService = socialActivityInterpreterLocalService;
153     }
154 
155     public SocialRelationLocalService getSocialRelationLocalService() {
156         return socialRelationLocalService;
157     }
158 
159     public void setSocialRelationLocalService(
160         SocialRelationLocalService socialRelationLocalService) {
161         this.socialRelationLocalService = socialRelationLocalService;
162     }
163 
164     public SocialRelationPersistence getSocialRelationPersistence() {
165         return socialRelationPersistence;
166     }
167 
168     public void setSocialRelationPersistence(
169         SocialRelationPersistence socialRelationPersistence) {
170         this.socialRelationPersistence = socialRelationPersistence;
171     }
172 
173     public SocialRequestLocalService getSocialRequestLocalService() {
174         return socialRequestLocalService;
175     }
176 
177     public void setSocialRequestLocalService(
178         SocialRequestLocalService socialRequestLocalService) {
179         this.socialRequestLocalService = socialRequestLocalService;
180     }
181 
182     public SocialRequestPersistence getSocialRequestPersistence() {
183         return socialRequestPersistence;
184     }
185 
186     public void setSocialRequestPersistence(
187         SocialRequestPersistence socialRequestPersistence) {
188         this.socialRequestPersistence = socialRequestPersistence;
189     }
190 
191     public SocialRequestInterpreterLocalService getSocialRequestInterpreterLocalService() {
192         return socialRequestInterpreterLocalService;
193     }
194 
195     public void setSocialRequestInterpreterLocalService(
196         SocialRequestInterpreterLocalService socialRequestInterpreterLocalService) {
197         this.socialRequestInterpreterLocalService = socialRequestInterpreterLocalService;
198     }
199 
200     public CounterLocalService getCounterLocalService() {
201         return counterLocalService;
202     }
203 
204     public void setCounterLocalService(CounterLocalService counterLocalService) {
205         this.counterLocalService = counterLocalService;
206     }
207 
208     public CounterService getCounterService() {
209         return counterService;
210     }
211 
212     public void setCounterService(CounterService counterService) {
213         this.counterService = counterService;
214     }
215 
216     public UserLocalService getUserLocalService() {
217         return userLocalService;
218     }
219 
220     public void setUserLocalService(UserLocalService userLocalService) {
221         this.userLocalService = userLocalService;
222     }
223 
224     public UserService getUserService() {
225         return userService;
226     }
227 
228     public void setUserService(UserService userService) {
229         this.userService = userService;
230     }
231 
232     public UserPersistence getUserPersistence() {
233         return userPersistence;
234     }
235 
236     public void setUserPersistence(UserPersistence userPersistence) {
237         this.userPersistence = userPersistence;
238     }
239 
240     public UserFinder getUserFinder() {
241         return userFinder;
242     }
243 
244     public void setUserFinder(UserFinder userFinder) {
245         this.userFinder = userFinder;
246     }
247 
248     protected void runSQL(String sql) throws SystemException {
249         try {
250             PortalUtil.runSQL(sql);
251         }
252         catch (Exception e) {
253             throw new SystemException(e);
254         }
255     }
256 
257     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityLocalService.impl")
258     protected SocialActivityLocalService socialActivityLocalService;
259     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence.impl")
260     protected SocialActivityPersistence socialActivityPersistence;
261     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityFinder.impl")
262     protected SocialActivityFinder socialActivityFinder;
263     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityInterpreterLocalService.impl")
264     protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
265     @BeanReference(name = "com.liferay.portlet.social.service.SocialRelationLocalService.impl")
266     protected SocialRelationLocalService socialRelationLocalService;
267     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRelationPersistence.impl")
268     protected SocialRelationPersistence socialRelationPersistence;
269     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestLocalService.impl")
270     protected SocialRequestLocalService socialRequestLocalService;
271     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRequestPersistence.impl")
272     protected SocialRequestPersistence socialRequestPersistence;
273     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestInterpreterLocalService.impl")
274     protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
275     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
276     protected CounterLocalService counterLocalService;
277     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
278     protected CounterService counterService;
279     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
280     protected UserLocalService userLocalService;
281     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
282     protected UserService userService;
283     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
284     protected UserPersistence userPersistence;
285     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
286     protected UserFinder userFinder;
287 }