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;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="CalEventServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link CalEventService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       CalEventService
39   * @generated
40   */
41  public class CalEventServiceUtil {
42      public static com.liferay.portlet.calendar.model.CalEvent addEvent(
43          java.lang.String title, java.lang.String description,
44          int startDateMonth, int startDateDay, int startDateYear,
45          int startDateHour, int startDateMinute, int endDateMonth,
46          int endDateDay, int endDateYear, int durationHour, int durationMinute,
47          boolean allDay, boolean timeZoneSensitive, java.lang.String type,
48          boolean repeating,
49          com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
50          int firstReminder, int secondReminder,
51          com.liferay.portal.service.ServiceContext serviceContext)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          return getService()
55                     .addEvent(title, description, startDateMonth, startDateDay,
56              startDateYear, startDateHour, startDateMinute, endDateMonth,
57              endDateDay, endDateYear, durationHour, durationMinute, allDay,
58              timeZoneSensitive, type, repeating, recurrence, remindBy,
59              firstReminder, secondReminder, serviceContext);
60      }
61  
62      public static void deleteEvent(long eventId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          getService().deleteEvent(eventId);
66      }
67  
68      public static java.io.File exportEvent(long eventId)
69          throws com.liferay.portal.PortalException,
70              com.liferay.portal.SystemException {
71          return getService().exportEvent(eventId);
72      }
73  
74      public static java.io.File exportGroupEvents(long groupId,
75          java.lang.String fileName)
76          throws com.liferay.portal.PortalException,
77              com.liferay.portal.SystemException {
78          return getService().exportGroupEvents(groupId, fileName);
79      }
80  
81      public static com.liferay.portlet.calendar.model.CalEvent getEvent(
82          long eventId)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          return getService().getEvent(eventId);
86      }
87  
88      public static void importICal4j(long groupId, java.io.File file)
89          throws com.liferay.portal.PortalException,
90              com.liferay.portal.SystemException {
91          getService().importICal4j(groupId, file);
92      }
93  
94      public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
95          long eventId, java.lang.String title, java.lang.String description,
96          int startDateMonth, int startDateDay, int startDateYear,
97          int startDateHour, int startDateMinute, int endDateMonth,
98          int endDateDay, int endDateYear, int durationHour, int durationMinute,
99          boolean allDay, boolean timeZoneSensitive, java.lang.String type,
100         boolean repeating,
101         com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
102         int firstReminder, int secondReminder,
103         com.liferay.portal.service.ServiceContext serviceContext)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         return getService()
107                    .updateEvent(eventId, title, description, startDateMonth,
108             startDateDay, startDateYear, startDateHour, startDateMinute,
109             endDateMonth, endDateDay, endDateYear, durationHour,
110             durationMinute, allDay, timeZoneSensitive, type, repeating,
111             recurrence, remindBy, firstReminder, secondReminder, serviceContext);
112     }
113 
114     public static CalEventService getService() {
115         if (_service == null) {
116             _service = (CalEventService)PortalBeanLocatorUtil.locate(CalEventService.class.getName());
117 
118             ReferenceRegistry.registerReference(CalEventServiceUtil.class,
119                 "_service");
120             MethodCache.remove(CalEventService.class);
121         }
122 
123         return _service;
124     }
125 
126     public void setService(CalEventService service) {
127         MethodCache.remove(CalEventService.class);
128 
129         _service = service;
130 
131         ReferenceRegistry.registerReference(CalEventServiceUtil.class,
132             "_service");
133         MethodCache.remove(CalEventService.class);
134     }
135 
136     private static CalEventService _service;
137 }