001
014
015 package com.liferay.portlet.calendar.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class CalEventServiceUtil {
035
040 public static com.liferay.portlet.calendar.model.CalEvent addEvent(
041 java.lang.String title, java.lang.String description,
042 int startDateMonth, int startDateDay, int startDateYear,
043 int startDateHour, int startDateMinute, int endDateMonth,
044 int endDateDay, int endDateYear, int durationHour, int durationMinute,
045 boolean allDay, boolean timeZoneSensitive, java.lang.String type,
046 boolean repeating,
047 com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
048 int firstReminder, int secondReminder,
049 com.liferay.portal.service.ServiceContext serviceContext)
050 throws com.liferay.portal.kernel.exception.PortalException,
051 com.liferay.portal.kernel.exception.SystemException {
052 return getService()
053 .addEvent(title, description, startDateMonth, startDateDay,
054 startDateYear, startDateHour, startDateMinute, endDateMonth,
055 endDateDay, endDateYear, durationHour, durationMinute, allDay,
056 timeZoneSensitive, type, repeating, recurrence, remindBy,
057 firstReminder, secondReminder, serviceContext);
058 }
059
060 public static void deleteEvent(long eventId)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 getService().deleteEvent(eventId);
064 }
065
066 public static java.io.File exportEvent(long eventId)
067 throws com.liferay.portal.kernel.exception.PortalException,
068 com.liferay.portal.kernel.exception.SystemException {
069 return getService().exportEvent(eventId);
070 }
071
072 public static java.io.File exportGroupEvents(long groupId,
073 java.lang.String fileName)
074 throws com.liferay.portal.kernel.exception.PortalException,
075 com.liferay.portal.kernel.exception.SystemException {
076 return getService().exportGroupEvents(groupId, fileName);
077 }
078
079 public static com.liferay.portlet.calendar.model.CalEvent getEvent(
080 long eventId)
081 throws com.liferay.portal.kernel.exception.PortalException,
082 com.liferay.portal.kernel.exception.SystemException {
083 return getService().getEvent(eventId);
084 }
085
086 public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
087 long groupId, java.util.Calendar cal, java.lang.String type)
088 throws com.liferay.portal.kernel.exception.PortalException,
089 com.liferay.portal.kernel.exception.SystemException {
090 return getService().getEvents(groupId, cal, type);
091 }
092
093 public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
094 long groupId, java.lang.String type, int start, int end)
095 throws com.liferay.portal.kernel.exception.SystemException {
096 return getService().getEvents(groupId, type, start, end);
097 }
098
099 public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
100 long groupId, java.lang.String[] types, int start, int end)
101 throws com.liferay.portal.kernel.exception.SystemException {
102 return getService().getEvents(groupId, types, start, end);
103 }
104
105 public static int getEventsCount(long groupId, java.lang.String type)
106 throws com.liferay.portal.kernel.exception.SystemException {
107 return getService().getEventsCount(groupId, type);
108 }
109
110 public static int getEventsCount(long groupId, java.lang.String[] types)
111 throws com.liferay.portal.kernel.exception.SystemException {
112 return getService().getEventsCount(groupId, types);
113 }
114
115 public static boolean hasEvents(long groupId, java.util.Calendar cal)
116 throws com.liferay.portal.kernel.exception.PortalException,
117 com.liferay.portal.kernel.exception.SystemException {
118 return getService().hasEvents(groupId, cal);
119 }
120
121 public static boolean hasEvents(long groupId, java.util.Calendar cal,
122 java.lang.String type)
123 throws com.liferay.portal.kernel.exception.PortalException,
124 com.liferay.portal.kernel.exception.SystemException {
125 return getService().hasEvents(groupId, cal, type);
126 }
127
128 public static void importICal4j(long groupId, java.io.File file)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 getService().importICal4j(groupId, file);
132 }
133
134 public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
135 long eventId, java.lang.String title, java.lang.String description,
136 int startDateMonth, int startDateDay, int startDateYear,
137 int startDateHour, int startDateMinute, int endDateMonth,
138 int endDateDay, int endDateYear, int durationHour, int durationMinute,
139 boolean allDay, boolean timeZoneSensitive, java.lang.String type,
140 boolean repeating,
141 com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
142 int firstReminder, int secondReminder,
143 com.liferay.portal.service.ServiceContext serviceContext)
144 throws com.liferay.portal.kernel.exception.PortalException,
145 com.liferay.portal.kernel.exception.SystemException {
146 return getService()
147 .updateEvent(eventId, title, description, startDateMonth,
148 startDateDay, startDateYear, startDateHour, startDateMinute,
149 endDateMonth, endDateDay, endDateYear, durationHour,
150 durationMinute, allDay, timeZoneSensitive, type, repeating,
151 recurrence, remindBy, firstReminder, secondReminder, serviceContext);
152 }
153
154 public static CalEventService getService() {
155 if (_service == null) {
156 _service = (CalEventService)PortalBeanLocatorUtil.locate(CalEventService.class.getName());
157
158 ReferenceRegistry.registerReference(CalEventServiceUtil.class,
159 "_service");
160 MethodCache.remove(CalEventService.class);
161 }
162
163 return _service;
164 }
165
166 public void setService(CalEventService service) {
167 MethodCache.remove(CalEventService.class);
168
169 _service = service;
170
171 ReferenceRegistry.registerReference(CalEventServiceUtil.class,
172 "_service");
173 MethodCache.remove(CalEventService.class);
174 }
175
176 private static CalEventService _service;
177 }