1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.calendar.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.mail.service.MailService;
20  
21  import com.liferay.portal.kernel.annotation.BeanReference;
22  import com.liferay.portal.kernel.dao.db.DB;
23  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
24  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
25  import com.liferay.portal.kernel.exception.PortalException;
26  import com.liferay.portal.kernel.exception.SystemException;
27  import com.liferay.portal.kernel.util.OrderByComparator;
28  import com.liferay.portal.service.CompanyLocalService;
29  import com.liferay.portal.service.CompanyService;
30  import com.liferay.portal.service.GroupLocalService;
31  import com.liferay.portal.service.GroupService;
32  import com.liferay.portal.service.PortletPreferencesLocalService;
33  import com.liferay.portal.service.PortletPreferencesService;
34  import com.liferay.portal.service.ResourceLocalService;
35  import com.liferay.portal.service.ResourceService;
36  import com.liferay.portal.service.UserLocalService;
37  import com.liferay.portal.service.UserService;
38  import com.liferay.portal.service.persistence.CompanyPersistence;
39  import com.liferay.portal.service.persistence.GroupFinder;
40  import com.liferay.portal.service.persistence.GroupPersistence;
41  import com.liferay.portal.service.persistence.PortletPreferencesFinder;
42  import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
43  import com.liferay.portal.service.persistence.ResourceFinder;
44  import com.liferay.portal.service.persistence.ResourcePersistence;
45  import com.liferay.portal.service.persistence.UserFinder;
46  import com.liferay.portal.service.persistence.UserPersistence;
47  
48  import com.liferay.portlet.asset.service.AssetEntryLocalService;
49  import com.liferay.portlet.asset.service.AssetEntryService;
50  import com.liferay.portlet.asset.service.AssetTagLocalService;
51  import com.liferay.portlet.asset.service.AssetTagService;
52  import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
53  import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
54  import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
55  import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
56  import com.liferay.portlet.calendar.model.CalEvent;
57  import com.liferay.portlet.calendar.service.CalEventLocalService;
58  import com.liferay.portlet.calendar.service.CalEventService;
59  import com.liferay.portlet.calendar.service.persistence.CalEventFinder;
60  import com.liferay.portlet.calendar.service.persistence.CalEventPersistence;
61  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
62  import com.liferay.portlet.expando.service.ExpandoValueService;
63  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
64  import com.liferay.portlet.social.service.SocialActivityLocalService;
65  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
66  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
67  
68  import java.util.List;
69  
70  /**
71   * <a href="CalEventLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
72   * </a>
73   *
74   * @author Brian Wing Shun Chan
75   */
76  public abstract class CalEventLocalServiceBaseImpl
77      implements CalEventLocalService {
78      public CalEvent addCalEvent(CalEvent calEvent) throws SystemException {
79          calEvent.setNew(true);
80  
81          return calEventPersistence.update(calEvent, false);
82      }
83  
84      public CalEvent createCalEvent(long eventId) {
85          return calEventPersistence.create(eventId);
86      }
87  
88      public void deleteCalEvent(long eventId)
89          throws PortalException, SystemException {
90          calEventPersistence.remove(eventId);
91      }
92  
93      public void deleteCalEvent(CalEvent calEvent) throws SystemException {
94          calEventPersistence.remove(calEvent);
95      }
96  
97      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
98          throws SystemException {
99          return calEventPersistence.findWithDynamicQuery(dynamicQuery);
100     }
101 
102     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
103         int end) throws SystemException {
104         return calEventPersistence.findWithDynamicQuery(dynamicQuery, start, end);
105     }
106 
107     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
108         int end, OrderByComparator orderByComparator) throws SystemException {
109         return calEventPersistence.findWithDynamicQuery(dynamicQuery, start,
110             end, orderByComparator);
111     }
112 
113     public int dynamicQueryCount(DynamicQuery dynamicQuery)
114         throws SystemException {
115         return calEventPersistence.countWithDynamicQuery(dynamicQuery);
116     }
117 
118     public CalEvent getCalEvent(long eventId)
119         throws PortalException, SystemException {
120         return calEventPersistence.findByPrimaryKey(eventId);
121     }
122 
123     public List<CalEvent> getCalEvents(int start, int end)
124         throws SystemException {
125         return calEventPersistence.findAll(start, end);
126     }
127 
128     public int getCalEventsCount() throws SystemException {
129         return calEventPersistence.countAll();
130     }
131 
132     public CalEvent updateCalEvent(CalEvent calEvent) throws SystemException {
133         calEvent.setNew(false);
134 
135         return calEventPersistence.update(calEvent, true);
136     }
137 
138     public CalEvent updateCalEvent(CalEvent calEvent, boolean merge)
139         throws SystemException {
140         calEvent.setNew(false);
141 
142         return calEventPersistence.update(calEvent, merge);
143     }
144 
145     public CalEventLocalService getCalEventLocalService() {
146         return calEventLocalService;
147     }
148 
149     public void setCalEventLocalService(
150         CalEventLocalService calEventLocalService) {
151         this.calEventLocalService = calEventLocalService;
152     }
153 
154     public CalEventService getCalEventService() {
155         return calEventService;
156     }
157 
158     public void setCalEventService(CalEventService calEventService) {
159         this.calEventService = calEventService;
160     }
161 
162     public CalEventPersistence getCalEventPersistence() {
163         return calEventPersistence;
164     }
165 
166     public void setCalEventPersistence(CalEventPersistence calEventPersistence) {
167         this.calEventPersistence = calEventPersistence;
168     }
169 
170     public CalEventFinder getCalEventFinder() {
171         return calEventFinder;
172     }
173 
174     public void setCalEventFinder(CalEventFinder calEventFinder) {
175         this.calEventFinder = calEventFinder;
176     }
177 
178     public CounterLocalService getCounterLocalService() {
179         return counterLocalService;
180     }
181 
182     public void setCounterLocalService(CounterLocalService counterLocalService) {
183         this.counterLocalService = counterLocalService;
184     }
185 
186     public MailService getMailService() {
187         return mailService;
188     }
189 
190     public void setMailService(MailService mailService) {
191         this.mailService = mailService;
192     }
193 
194     public CompanyLocalService getCompanyLocalService() {
195         return companyLocalService;
196     }
197 
198     public void setCompanyLocalService(CompanyLocalService companyLocalService) {
199         this.companyLocalService = companyLocalService;
200     }
201 
202     public CompanyService getCompanyService() {
203         return companyService;
204     }
205 
206     public void setCompanyService(CompanyService companyService) {
207         this.companyService = companyService;
208     }
209 
210     public CompanyPersistence getCompanyPersistence() {
211         return companyPersistence;
212     }
213 
214     public void setCompanyPersistence(CompanyPersistence companyPersistence) {
215         this.companyPersistence = companyPersistence;
216     }
217 
218     public GroupLocalService getGroupLocalService() {
219         return groupLocalService;
220     }
221 
222     public void setGroupLocalService(GroupLocalService groupLocalService) {
223         this.groupLocalService = groupLocalService;
224     }
225 
226     public GroupService getGroupService() {
227         return groupService;
228     }
229 
230     public void setGroupService(GroupService groupService) {
231         this.groupService = groupService;
232     }
233 
234     public GroupPersistence getGroupPersistence() {
235         return groupPersistence;
236     }
237 
238     public void setGroupPersistence(GroupPersistence groupPersistence) {
239         this.groupPersistence = groupPersistence;
240     }
241 
242     public GroupFinder getGroupFinder() {
243         return groupFinder;
244     }
245 
246     public void setGroupFinder(GroupFinder groupFinder) {
247         this.groupFinder = groupFinder;
248     }
249 
250     public PortletPreferencesLocalService getPortletPreferencesLocalService() {
251         return portletPreferencesLocalService;
252     }
253 
254     public void setPortletPreferencesLocalService(
255         PortletPreferencesLocalService portletPreferencesLocalService) {
256         this.portletPreferencesLocalService = portletPreferencesLocalService;
257     }
258 
259     public PortletPreferencesService getPortletPreferencesService() {
260         return portletPreferencesService;
261     }
262 
263     public void setPortletPreferencesService(
264         PortletPreferencesService portletPreferencesService) {
265         this.portletPreferencesService = portletPreferencesService;
266     }
267 
268     public PortletPreferencesPersistence getPortletPreferencesPersistence() {
269         return portletPreferencesPersistence;
270     }
271 
272     public void setPortletPreferencesPersistence(
273         PortletPreferencesPersistence portletPreferencesPersistence) {
274         this.portletPreferencesPersistence = portletPreferencesPersistence;
275     }
276 
277     public PortletPreferencesFinder getPortletPreferencesFinder() {
278         return portletPreferencesFinder;
279     }
280 
281     public void setPortletPreferencesFinder(
282         PortletPreferencesFinder portletPreferencesFinder) {
283         this.portletPreferencesFinder = portletPreferencesFinder;
284     }
285 
286     public ResourceLocalService getResourceLocalService() {
287         return resourceLocalService;
288     }
289 
290     public void setResourceLocalService(
291         ResourceLocalService resourceLocalService) {
292         this.resourceLocalService = resourceLocalService;
293     }
294 
295     public ResourceService getResourceService() {
296         return resourceService;
297     }
298 
299     public void setResourceService(ResourceService resourceService) {
300         this.resourceService = resourceService;
301     }
302 
303     public ResourcePersistence getResourcePersistence() {
304         return resourcePersistence;
305     }
306 
307     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
308         this.resourcePersistence = resourcePersistence;
309     }
310 
311     public ResourceFinder getResourceFinder() {
312         return resourceFinder;
313     }
314 
315     public void setResourceFinder(ResourceFinder resourceFinder) {
316         this.resourceFinder = resourceFinder;
317     }
318 
319     public UserLocalService getUserLocalService() {
320         return userLocalService;
321     }
322 
323     public void setUserLocalService(UserLocalService userLocalService) {
324         this.userLocalService = userLocalService;
325     }
326 
327     public UserService getUserService() {
328         return userService;
329     }
330 
331     public void setUserService(UserService userService) {
332         this.userService = userService;
333     }
334 
335     public UserPersistence getUserPersistence() {
336         return userPersistence;
337     }
338 
339     public void setUserPersistence(UserPersistence userPersistence) {
340         this.userPersistence = userPersistence;
341     }
342 
343     public UserFinder getUserFinder() {
344         return userFinder;
345     }
346 
347     public void setUserFinder(UserFinder userFinder) {
348         this.userFinder = userFinder;
349     }
350 
351     public AssetEntryLocalService getAssetEntryLocalService() {
352         return assetEntryLocalService;
353     }
354 
355     public void setAssetEntryLocalService(
356         AssetEntryLocalService assetEntryLocalService) {
357         this.assetEntryLocalService = assetEntryLocalService;
358     }
359 
360     public AssetEntryService getAssetEntryService() {
361         return assetEntryService;
362     }
363 
364     public void setAssetEntryService(AssetEntryService assetEntryService) {
365         this.assetEntryService = assetEntryService;
366     }
367 
368     public AssetEntryPersistence getAssetEntryPersistence() {
369         return assetEntryPersistence;
370     }
371 
372     public void setAssetEntryPersistence(
373         AssetEntryPersistence assetEntryPersistence) {
374         this.assetEntryPersistence = assetEntryPersistence;
375     }
376 
377     public AssetEntryFinder getAssetEntryFinder() {
378         return assetEntryFinder;
379     }
380 
381     public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
382         this.assetEntryFinder = assetEntryFinder;
383     }
384 
385     public AssetTagLocalService getAssetTagLocalService() {
386         return assetTagLocalService;
387     }
388 
389     public void setAssetTagLocalService(
390         AssetTagLocalService assetTagLocalService) {
391         this.assetTagLocalService = assetTagLocalService;
392     }
393 
394     public AssetTagService getAssetTagService() {
395         return assetTagService;
396     }
397 
398     public void setAssetTagService(AssetTagService assetTagService) {
399         this.assetTagService = assetTagService;
400     }
401 
402     public AssetTagPersistence getAssetTagPersistence() {
403         return assetTagPersistence;
404     }
405 
406     public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
407         this.assetTagPersistence = assetTagPersistence;
408     }
409 
410     public AssetTagFinder getAssetTagFinder() {
411         return assetTagFinder;
412     }
413 
414     public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
415         this.assetTagFinder = assetTagFinder;
416     }
417 
418     public ExpandoValueLocalService getExpandoValueLocalService() {
419         return expandoValueLocalService;
420     }
421 
422     public void setExpandoValueLocalService(
423         ExpandoValueLocalService expandoValueLocalService) {
424         this.expandoValueLocalService = expandoValueLocalService;
425     }
426 
427     public ExpandoValueService getExpandoValueService() {
428         return expandoValueService;
429     }
430 
431     public void setExpandoValueService(ExpandoValueService expandoValueService) {
432         this.expandoValueService = expandoValueService;
433     }
434 
435     public ExpandoValuePersistence getExpandoValuePersistence() {
436         return expandoValuePersistence;
437     }
438 
439     public void setExpandoValuePersistence(
440         ExpandoValuePersistence expandoValuePersistence) {
441         this.expandoValuePersistence = expandoValuePersistence;
442     }
443 
444     public SocialActivityLocalService getSocialActivityLocalService() {
445         return socialActivityLocalService;
446     }
447 
448     public void setSocialActivityLocalService(
449         SocialActivityLocalService socialActivityLocalService) {
450         this.socialActivityLocalService = socialActivityLocalService;
451     }
452 
453     public SocialActivityPersistence getSocialActivityPersistence() {
454         return socialActivityPersistence;
455     }
456 
457     public void setSocialActivityPersistence(
458         SocialActivityPersistence socialActivityPersistence) {
459         this.socialActivityPersistence = socialActivityPersistence;
460     }
461 
462     public SocialActivityFinder getSocialActivityFinder() {
463         return socialActivityFinder;
464     }
465 
466     public void setSocialActivityFinder(
467         SocialActivityFinder socialActivityFinder) {
468         this.socialActivityFinder = socialActivityFinder;
469     }
470 
471     protected void runSQL(String sql) throws SystemException {
472         try {
473             DB db = DBFactoryUtil.getDB();
474 
475             db.runSQL(sql);
476         }
477         catch (Exception e) {
478             throw new SystemException(e);
479         }
480     }
481 
482     @BeanReference(type = CalEventLocalService.class)
483     protected CalEventLocalService calEventLocalService;
484     @BeanReference(type = CalEventService.class)
485     protected CalEventService calEventService;
486     @BeanReference(type = CalEventPersistence.class)
487     protected CalEventPersistence calEventPersistence;
488     @BeanReference(type = CalEventFinder.class)
489     protected CalEventFinder calEventFinder;
490     @BeanReference(type = CounterLocalService.class)
491     protected CounterLocalService counterLocalService;
492     @BeanReference(type = MailService.class)
493     protected MailService mailService;
494     @BeanReference(type = CompanyLocalService.class)
495     protected CompanyLocalService companyLocalService;
496     @BeanReference(type = CompanyService.class)
497     protected CompanyService companyService;
498     @BeanReference(type = CompanyPersistence.class)
499     protected CompanyPersistence companyPersistence;
500     @BeanReference(type = GroupLocalService.class)
501     protected GroupLocalService groupLocalService;
502     @BeanReference(type = GroupService.class)
503     protected GroupService groupService;
504     @BeanReference(type = GroupPersistence.class)
505     protected GroupPersistence groupPersistence;
506     @BeanReference(type = GroupFinder.class)
507     protected GroupFinder groupFinder;
508     @BeanReference(type = PortletPreferencesLocalService.class)
509     protected PortletPreferencesLocalService portletPreferencesLocalService;
510     @BeanReference(type = PortletPreferencesService.class)
511     protected PortletPreferencesService portletPreferencesService;
512     @BeanReference(type = PortletPreferencesPersistence.class)
513     protected PortletPreferencesPersistence portletPreferencesPersistence;
514     @BeanReference(type = PortletPreferencesFinder.class)
515     protected PortletPreferencesFinder portletPreferencesFinder;
516     @BeanReference(type = ResourceLocalService.class)
517     protected ResourceLocalService resourceLocalService;
518     @BeanReference(type = ResourceService.class)
519     protected ResourceService resourceService;
520     @BeanReference(type = ResourcePersistence.class)
521     protected ResourcePersistence resourcePersistence;
522     @BeanReference(type = ResourceFinder.class)
523     protected ResourceFinder resourceFinder;
524     @BeanReference(type = UserLocalService.class)
525     protected UserLocalService userLocalService;
526     @BeanReference(type = UserService.class)
527     protected UserService userService;
528     @BeanReference(type = UserPersistence.class)
529     protected UserPersistence userPersistence;
530     @BeanReference(type = UserFinder.class)
531     protected UserFinder userFinder;
532     @BeanReference(type = AssetEntryLocalService.class)
533     protected AssetEntryLocalService assetEntryLocalService;
534     @BeanReference(type = AssetEntryService.class)
535     protected AssetEntryService assetEntryService;
536     @BeanReference(type = AssetEntryPersistence.class)
537     protected AssetEntryPersistence assetEntryPersistence;
538     @BeanReference(type = AssetEntryFinder.class)
539     protected AssetEntryFinder assetEntryFinder;
540     @BeanReference(type = AssetTagLocalService.class)
541     protected AssetTagLocalService assetTagLocalService;
542     @BeanReference(type = AssetTagService.class)
543     protected AssetTagService assetTagService;
544     @BeanReference(type = AssetTagPersistence.class)
545     protected AssetTagPersistence assetTagPersistence;
546     @BeanReference(type = AssetTagFinder.class)
547     protected AssetTagFinder assetTagFinder;
548     @BeanReference(type = ExpandoValueLocalService.class)
549     protected ExpandoValueLocalService expandoValueLocalService;
550     @BeanReference(type = ExpandoValueService.class)
551     protected ExpandoValueService expandoValueService;
552     @BeanReference(type = ExpandoValuePersistence.class)
553     protected ExpandoValuePersistence expandoValuePersistence;
554     @BeanReference(type = SocialActivityLocalService.class)
555     protected SocialActivityLocalService socialActivityLocalService;
556     @BeanReference(type = SocialActivityPersistence.class)
557     protected SocialActivityPersistence socialActivityPersistence;
558     @BeanReference(type = SocialActivityFinder.class)
559     protected SocialActivityFinder socialActivityFinder;
560 }