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.tasks.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.bean.InitializingBean;
31  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33  import com.liferay.portal.service.UserLocalService;
34  import com.liferay.portal.service.UserService;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.social.service.SocialActivityLocalService;
39  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
40  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
41  import com.liferay.portlet.tasks.model.TasksReview;
42  import com.liferay.portlet.tasks.service.TasksProposalLocalService;
43  import com.liferay.portlet.tasks.service.TasksProposalService;
44  import com.liferay.portlet.tasks.service.TasksReviewLocalService;
45  import com.liferay.portlet.tasks.service.persistence.TasksProposalFinder;
46  import com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence;
47  import com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence;
48  
49  import java.util.List;
50  
51  /**
52   * <a href="TasksReviewLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
56   */
57  public abstract class TasksReviewLocalServiceBaseImpl
58      implements TasksReviewLocalService, InitializingBean {
59      public TasksReview addTasksReview(TasksReview tasksReview)
60          throws SystemException {
61          tasksReview.setNew(true);
62  
63          return tasksReviewPersistence.update(tasksReview, false);
64      }
65  
66      public void deleteTasksReview(long reviewId)
67          throws PortalException, SystemException {
68          tasksReviewPersistence.remove(reviewId);
69      }
70  
71      public void deleteTasksReview(TasksReview tasksReview)
72          throws SystemException {
73          tasksReviewPersistence.remove(tasksReview);
74      }
75  
76      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
77          throws SystemException {
78          return tasksReviewPersistence.findWithDynamicQuery(dynamicQuery);
79      }
80  
81      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
82          int end) throws SystemException {
83          return tasksReviewPersistence.findWithDynamicQuery(dynamicQuery, start,
84              end);
85      }
86  
87      public TasksReview getTasksReview(long reviewId)
88          throws PortalException, SystemException {
89          return tasksReviewPersistence.findByPrimaryKey(reviewId);
90      }
91  
92      public List<TasksReview> getTasksReviews(int start, int end)
93          throws SystemException {
94          return tasksReviewPersistence.findAll(start, end);
95      }
96  
97      public int getTasksReviewsCount() throws SystemException {
98          return tasksReviewPersistence.countAll();
99      }
100 
101     public TasksReview updateTasksReview(TasksReview tasksReview)
102         throws SystemException {
103         tasksReview.setNew(false);
104 
105         return tasksReviewPersistence.update(tasksReview, true);
106     }
107 
108     public TasksReviewPersistence getTasksReviewPersistence() {
109         return tasksReviewPersistence;
110     }
111 
112     public void setTasksReviewPersistence(
113         TasksReviewPersistence tasksReviewPersistence) {
114         this.tasksReviewPersistence = tasksReviewPersistence;
115     }
116 
117     public TasksProposalLocalService getTasksProposalLocalService() {
118         return tasksProposalLocalService;
119     }
120 
121     public void setTasksProposalLocalService(
122         TasksProposalLocalService tasksProposalLocalService) {
123         this.tasksProposalLocalService = tasksProposalLocalService;
124     }
125 
126     public TasksProposalService getTasksProposalService() {
127         return tasksProposalService;
128     }
129 
130     public void setTasksProposalService(
131         TasksProposalService tasksProposalService) {
132         this.tasksProposalService = tasksProposalService;
133     }
134 
135     public TasksProposalPersistence getTasksProposalPersistence() {
136         return tasksProposalPersistence;
137     }
138 
139     public void setTasksProposalPersistence(
140         TasksProposalPersistence tasksProposalPersistence) {
141         this.tasksProposalPersistence = tasksProposalPersistence;
142     }
143 
144     public TasksProposalFinder getTasksProposalFinder() {
145         return tasksProposalFinder;
146     }
147 
148     public void setTasksProposalFinder(TasksProposalFinder tasksProposalFinder) {
149         this.tasksProposalFinder = tasksProposalFinder;
150     }
151 
152     public CounterLocalService getCounterLocalService() {
153         return counterLocalService;
154     }
155 
156     public void setCounterLocalService(CounterLocalService counterLocalService) {
157         this.counterLocalService = counterLocalService;
158     }
159 
160     public CounterService getCounterService() {
161         return counterService;
162     }
163 
164     public void setCounterService(CounterService counterService) {
165         this.counterService = counterService;
166     }
167 
168     public UserLocalService getUserLocalService() {
169         return userLocalService;
170     }
171 
172     public void setUserLocalService(UserLocalService userLocalService) {
173         this.userLocalService = userLocalService;
174     }
175 
176     public UserService getUserService() {
177         return userService;
178     }
179 
180     public void setUserService(UserService userService) {
181         this.userService = userService;
182     }
183 
184     public UserPersistence getUserPersistence() {
185         return userPersistence;
186     }
187 
188     public void setUserPersistence(UserPersistence userPersistence) {
189         this.userPersistence = userPersistence;
190     }
191 
192     public UserFinder getUserFinder() {
193         return userFinder;
194     }
195 
196     public void setUserFinder(UserFinder userFinder) {
197         this.userFinder = userFinder;
198     }
199 
200     public SocialActivityLocalService getSocialActivityLocalService() {
201         return socialActivityLocalService;
202     }
203 
204     public void setSocialActivityLocalService(
205         SocialActivityLocalService socialActivityLocalService) {
206         this.socialActivityLocalService = socialActivityLocalService;
207     }
208 
209     public SocialActivityPersistence getSocialActivityPersistence() {
210         return socialActivityPersistence;
211     }
212 
213     public void setSocialActivityPersistence(
214         SocialActivityPersistence socialActivityPersistence) {
215         this.socialActivityPersistence = socialActivityPersistence;
216     }
217 
218     public SocialActivityFinder getSocialActivityFinder() {
219         return socialActivityFinder;
220     }
221 
222     public void setSocialActivityFinder(
223         SocialActivityFinder socialActivityFinder) {
224         this.socialActivityFinder = socialActivityFinder;
225     }
226 
227     public void afterPropertiesSet() {
228         if (tasksReviewPersistence == null) {
229             tasksReviewPersistence = (TasksReviewPersistence)PortalBeanLocatorUtil.locate(TasksReviewPersistence.class.getName() +
230                     ".impl");
231         }
232 
233         if (tasksProposalLocalService == null) {
234             tasksProposalLocalService = (TasksProposalLocalService)PortalBeanLocatorUtil.locate(TasksProposalLocalService.class.getName() +
235                     ".impl");
236         }
237 
238         if (tasksProposalService == null) {
239             tasksProposalService = (TasksProposalService)PortalBeanLocatorUtil.locate(TasksProposalService.class.getName() +
240                     ".impl");
241         }
242 
243         if (tasksProposalPersistence == null) {
244             tasksProposalPersistence = (TasksProposalPersistence)PortalBeanLocatorUtil.locate(TasksProposalPersistence.class.getName() +
245                     ".impl");
246         }
247 
248         if (tasksProposalFinder == null) {
249             tasksProposalFinder = (TasksProposalFinder)PortalBeanLocatorUtil.locate(TasksProposalFinder.class.getName() +
250                     ".impl");
251         }
252 
253         if (counterLocalService == null) {
254             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
255                     ".impl");
256         }
257 
258         if (counterService == null) {
259             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
260                     ".impl");
261         }
262 
263         if (userLocalService == null) {
264             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
265                     ".impl");
266         }
267 
268         if (userService == null) {
269             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
270                     ".impl");
271         }
272 
273         if (userPersistence == null) {
274             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
275                     ".impl");
276         }
277 
278         if (userFinder == null) {
279             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
280                     ".impl");
281         }
282 
283         if (socialActivityLocalService == null) {
284             socialActivityLocalService = (SocialActivityLocalService)PortalBeanLocatorUtil.locate(SocialActivityLocalService.class.getName() +
285                     ".impl");
286         }
287 
288         if (socialActivityPersistence == null) {
289             socialActivityPersistence = (SocialActivityPersistence)PortalBeanLocatorUtil.locate(SocialActivityPersistence.class.getName() +
290                     ".impl");
291         }
292 
293         if (socialActivityFinder == null) {
294             socialActivityFinder = (SocialActivityFinder)PortalBeanLocatorUtil.locate(SocialActivityFinder.class.getName() +
295                     ".impl");
296         }
297     }
298 
299     protected TasksReviewPersistence tasksReviewPersistence;
300     protected TasksProposalLocalService tasksProposalLocalService;
301     protected TasksProposalService tasksProposalService;
302     protected TasksProposalPersistence tasksProposalPersistence;
303     protected TasksProposalFinder tasksProposalFinder;
304     protected CounterLocalService counterLocalService;
305     protected CounterService counterService;
306     protected UserLocalService userLocalService;
307     protected UserService userService;
308     protected UserPersistence userPersistence;
309     protected UserFinder userFinder;
310     protected SocialActivityLocalService socialActivityLocalService;
311     protected SocialActivityPersistence socialActivityPersistence;
312     protected SocialActivityFinder socialActivityFinder;
313 }