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