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.ResourceLocalService;
34  import com.liferay.portal.service.ResourceService;
35  import com.liferay.portal.service.UserLocalService;
36  import com.liferay.portal.service.UserService;
37  import com.liferay.portal.service.persistence.ResourceFinder;
38  import com.liferay.portal.service.persistence.ResourcePersistence;
39  import com.liferay.portal.service.persistence.UserFinder;
40  import com.liferay.portal.service.persistence.UserPersistence;
41  
42  import com.liferay.portlet.messageboards.service.MBMessageLocalService;
43  import com.liferay.portlet.messageboards.service.MBMessageService;
44  import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
45  import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
46  import com.liferay.portlet.social.service.SocialActivityLocalService;
47  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
48  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
49  import com.liferay.portlet.tasks.model.TasksProposal;
50  import com.liferay.portlet.tasks.service.TasksProposalLocalService;
51  import com.liferay.portlet.tasks.service.TasksReviewLocalService;
52  import com.liferay.portlet.tasks.service.TasksReviewService;
53  import com.liferay.portlet.tasks.service.persistence.TasksProposalFinder;
54  import com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence;
55  import com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence;
56  
57  import java.util.List;
58  
59  /**
60   * <a href="TasksProposalLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
61   *
62   * @author Brian Wing Shun Chan
63   *
64   */
65  public abstract class TasksProposalLocalServiceBaseImpl
66      implements TasksProposalLocalService, InitializingBean {
67      public TasksProposal addTasksProposal(TasksProposal tasksProposal)
68          throws SystemException {
69          tasksProposal.setNew(true);
70  
71          return tasksProposalPersistence.update(tasksProposal, false);
72      }
73  
74      public void deleteTasksProposal(long proposalId)
75          throws PortalException, SystemException {
76          tasksProposalPersistence.remove(proposalId);
77      }
78  
79      public void deleteTasksProposal(TasksProposal tasksProposal)
80          throws SystemException {
81          tasksProposalPersistence.remove(tasksProposal);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
85          throws SystemException {
86          return tasksProposalPersistence.findWithDynamicQuery(dynamicQuery);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
90          int end) throws SystemException {
91          return tasksProposalPersistence.findWithDynamicQuery(dynamicQuery,
92              start, end);
93      }
94  
95      public TasksProposal getTasksProposal(long proposalId)
96          throws PortalException, SystemException {
97          return tasksProposalPersistence.findByPrimaryKey(proposalId);
98      }
99  
100     public List<TasksProposal> getTasksProposals(int start, int end)
101         throws SystemException {
102         return tasksProposalPersistence.findAll(start, end);
103     }
104 
105     public int getTasksProposalsCount() throws SystemException {
106         return tasksProposalPersistence.countAll();
107     }
108 
109     public TasksProposal updateTasksProposal(TasksProposal tasksProposal)
110         throws SystemException {
111         tasksProposal.setNew(false);
112 
113         return tasksProposalPersistence.update(tasksProposal, true);
114     }
115 
116     public TasksReviewLocalService getTasksReviewLocalService() {
117         return tasksReviewLocalService;
118     }
119 
120     public void setTasksReviewLocalService(
121         TasksReviewLocalService tasksReviewLocalService) {
122         this.tasksReviewLocalService = tasksReviewLocalService;
123     }
124 
125     public TasksReviewService getTasksReviewService() {
126         return tasksReviewService;
127     }
128 
129     public void setTasksReviewService(TasksReviewService tasksReviewService) {
130         this.tasksReviewService = tasksReviewService;
131     }
132 
133     public TasksReviewPersistence getTasksReviewPersistence() {
134         return tasksReviewPersistence;
135     }
136 
137     public void setTasksReviewPersistence(
138         TasksReviewPersistence tasksReviewPersistence) {
139         this.tasksReviewPersistence = tasksReviewPersistence;
140     }
141 
142     public TasksProposalPersistence getTasksProposalPersistence() {
143         return tasksProposalPersistence;
144     }
145 
146     public void setTasksProposalPersistence(
147         TasksProposalPersistence tasksProposalPersistence) {
148         this.tasksProposalPersistence = tasksProposalPersistence;
149     }
150 
151     public TasksProposalFinder getTasksProposalFinder() {
152         return tasksProposalFinder;
153     }
154 
155     public void setTasksProposalFinder(TasksProposalFinder tasksProposalFinder) {
156         this.tasksProposalFinder = tasksProposalFinder;
157     }
158 
159     public CounterLocalService getCounterLocalService() {
160         return counterLocalService;
161     }
162 
163     public void setCounterLocalService(CounterLocalService counterLocalService) {
164         this.counterLocalService = counterLocalService;
165     }
166 
167     public CounterService getCounterService() {
168         return counterService;
169     }
170 
171     public void setCounterService(CounterService counterService) {
172         this.counterService = counterService;
173     }
174 
175     public ResourceLocalService getResourceLocalService() {
176         return resourceLocalService;
177     }
178 
179     public void setResourceLocalService(
180         ResourceLocalService resourceLocalService) {
181         this.resourceLocalService = resourceLocalService;
182     }
183 
184     public ResourceService getResourceService() {
185         return resourceService;
186     }
187 
188     public void setResourceService(ResourceService resourceService) {
189         this.resourceService = resourceService;
190     }
191 
192     public ResourcePersistence getResourcePersistence() {
193         return resourcePersistence;
194     }
195 
196     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
197         this.resourcePersistence = resourcePersistence;
198     }
199 
200     public ResourceFinder getResourceFinder() {
201         return resourceFinder;
202     }
203 
204     public void setResourceFinder(ResourceFinder resourceFinder) {
205         this.resourceFinder = resourceFinder;
206     }
207 
208     public UserLocalService getUserLocalService() {
209         return userLocalService;
210     }
211 
212     public void setUserLocalService(UserLocalService userLocalService) {
213         this.userLocalService = userLocalService;
214     }
215 
216     public UserService getUserService() {
217         return userService;
218     }
219 
220     public void setUserService(UserService userService) {
221         this.userService = userService;
222     }
223 
224     public UserPersistence getUserPersistence() {
225         return userPersistence;
226     }
227 
228     public void setUserPersistence(UserPersistence userPersistence) {
229         this.userPersistence = userPersistence;
230     }
231 
232     public UserFinder getUserFinder() {
233         return userFinder;
234     }
235 
236     public void setUserFinder(UserFinder userFinder) {
237         this.userFinder = userFinder;
238     }
239 
240     public MBMessageLocalService getMBMessageLocalService() {
241         return mbMessageLocalService;
242     }
243 
244     public void setMBMessageLocalService(
245         MBMessageLocalService mbMessageLocalService) {
246         this.mbMessageLocalService = mbMessageLocalService;
247     }
248 
249     public MBMessageService getMBMessageService() {
250         return mbMessageService;
251     }
252 
253     public void setMBMessageService(MBMessageService mbMessageService) {
254         this.mbMessageService = mbMessageService;
255     }
256 
257     public MBMessagePersistence getMBMessagePersistence() {
258         return mbMessagePersistence;
259     }
260 
261     public void setMBMessagePersistence(
262         MBMessagePersistence mbMessagePersistence) {
263         this.mbMessagePersistence = mbMessagePersistence;
264     }
265 
266     public MBMessageFinder getMBMessageFinder() {
267         return mbMessageFinder;
268     }
269 
270     public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
271         this.mbMessageFinder = mbMessageFinder;
272     }
273 
274     public SocialActivityLocalService getSocialActivityLocalService() {
275         return socialActivityLocalService;
276     }
277 
278     public void setSocialActivityLocalService(
279         SocialActivityLocalService socialActivityLocalService) {
280         this.socialActivityLocalService = socialActivityLocalService;
281     }
282 
283     public SocialActivityPersistence getSocialActivityPersistence() {
284         return socialActivityPersistence;
285     }
286 
287     public void setSocialActivityPersistence(
288         SocialActivityPersistence socialActivityPersistence) {
289         this.socialActivityPersistence = socialActivityPersistence;
290     }
291 
292     public SocialActivityFinder getSocialActivityFinder() {
293         return socialActivityFinder;
294     }
295 
296     public void setSocialActivityFinder(
297         SocialActivityFinder socialActivityFinder) {
298         this.socialActivityFinder = socialActivityFinder;
299     }
300 
301     public void afterPropertiesSet() {
302         if (tasksReviewLocalService == null) {
303             tasksReviewLocalService = (TasksReviewLocalService)PortalBeanLocatorUtil.locate(TasksReviewLocalService.class.getName() +
304                     ".impl");
305         }
306 
307         if (tasksReviewService == null) {
308             tasksReviewService = (TasksReviewService)PortalBeanLocatorUtil.locate(TasksReviewService.class.getName() +
309                     ".impl");
310         }
311 
312         if (tasksReviewPersistence == null) {
313             tasksReviewPersistence = (TasksReviewPersistence)PortalBeanLocatorUtil.locate(TasksReviewPersistence.class.getName() +
314                     ".impl");
315         }
316 
317         if (tasksProposalPersistence == null) {
318             tasksProposalPersistence = (TasksProposalPersistence)PortalBeanLocatorUtil.locate(TasksProposalPersistence.class.getName() +
319                     ".impl");
320         }
321 
322         if (tasksProposalFinder == null) {
323             tasksProposalFinder = (TasksProposalFinder)PortalBeanLocatorUtil.locate(TasksProposalFinder.class.getName() +
324                     ".impl");
325         }
326 
327         if (counterLocalService == null) {
328             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
329                     ".impl");
330         }
331 
332         if (counterService == null) {
333             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
334                     ".impl");
335         }
336 
337         if (resourceLocalService == null) {
338             resourceLocalService = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName() +
339                     ".impl");
340         }
341 
342         if (resourceService == null) {
343             resourceService = (ResourceService)PortalBeanLocatorUtil.locate(ResourceService.class.getName() +
344                     ".impl");
345         }
346 
347         if (resourcePersistence == null) {
348             resourcePersistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName() +
349                     ".impl");
350         }
351 
352         if (resourceFinder == null) {
353             resourceFinder = (ResourceFinder)PortalBeanLocatorUtil.locate(ResourceFinder.class.getName() +
354                     ".impl");
355         }
356 
357         if (userLocalService == null) {
358             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
359                     ".impl");
360         }
361 
362         if (userService == null) {
363             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
364                     ".impl");
365         }
366 
367         if (userPersistence == null) {
368             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
369                     ".impl");
370         }
371 
372         if (userFinder == null) {
373             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
374                     ".impl");
375         }
376 
377         if (mbMessageLocalService == null) {
378             mbMessageLocalService = (MBMessageLocalService)PortalBeanLocatorUtil.locate(MBMessageLocalService.class.getName() +
379                     ".impl");
380         }
381 
382         if (mbMessageService == null) {
383             mbMessageService = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName() +
384                     ".impl");
385         }
386 
387         if (mbMessagePersistence == null) {
388             mbMessagePersistence = (MBMessagePersistence)PortalBeanLocatorUtil.locate(MBMessagePersistence.class.getName() +
389                     ".impl");
390         }
391 
392         if (mbMessageFinder == null) {
393             mbMessageFinder = (MBMessageFinder)PortalBeanLocatorUtil.locate(MBMessageFinder.class.getName() +
394                     ".impl");
395         }
396 
397         if (socialActivityLocalService == null) {
398             socialActivityLocalService = (SocialActivityLocalService)PortalBeanLocatorUtil.locate(SocialActivityLocalService.class.getName() +
399                     ".impl");
400         }
401 
402         if (socialActivityPersistence == null) {
403             socialActivityPersistence = (SocialActivityPersistence)PortalBeanLocatorUtil.locate(SocialActivityPersistence.class.getName() +
404                     ".impl");
405         }
406 
407         if (socialActivityFinder == null) {
408             socialActivityFinder = (SocialActivityFinder)PortalBeanLocatorUtil.locate(SocialActivityFinder.class.getName() +
409                     ".impl");
410         }
411     }
412 
413     protected TasksReviewLocalService tasksReviewLocalService;
414     protected TasksReviewService tasksReviewService;
415     protected TasksReviewPersistence tasksReviewPersistence;
416     protected TasksProposalPersistence tasksProposalPersistence;
417     protected TasksProposalFinder tasksProposalFinder;
418     protected CounterLocalService counterLocalService;
419     protected CounterService counterService;
420     protected ResourceLocalService resourceLocalService;
421     protected ResourceService resourceService;
422     protected ResourcePersistence resourcePersistence;
423     protected ResourceFinder resourceFinder;
424     protected UserLocalService userLocalService;
425     protected UserService userService;
426     protected UserPersistence userPersistence;
427     protected UserFinder userFinder;
428     protected MBMessageLocalService mbMessageLocalService;
429     protected MBMessageService mbMessageService;
430     protected MBMessagePersistence mbMessagePersistence;
431     protected MBMessageFinder mbMessageFinder;
432     protected SocialActivityLocalService socialActivityLocalService;
433     protected SocialActivityPersistence socialActivityPersistence;
434     protected SocialActivityFinder socialActivityFinder;
435 }