001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
022     * The utility for the cal event remote service. This utility wraps {@link com.liferay.portlet.calendar.service.impl.CalEventServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see CalEventService
030     * @see com.liferay.portlet.calendar.service.base.CalEventServiceBaseImpl
031     * @see com.liferay.portlet.calendar.service.impl.CalEventServiceImpl
032     * @generated
033     */
034    public class CalEventServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.calendar.service.impl.CalEventServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.calendar.model.CalEvent addEvent(
041                    java.lang.String title, java.lang.String description,
042                    java.lang.String location, int startDateMonth, int startDateDay,
043                    int startDateYear, int startDateHour, int startDateMinute,
044                    int endDateMonth, int endDateDay, int endDateYear, int durationHour,
045                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
046                    java.lang.String type, 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, location, startDateMonth,
054                            startDateDay, startDateYear, startDateHour, startDateMinute,
055                            endDateMonth, endDateDay, endDateYear, durationHour,
056                            durationMinute, allDay, timeZoneSensitive, type, repeating,
057                            recurrence, remindBy, 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.util.Calendar cal, java.lang.String[] types)
095                    throws com.liferay.portal.kernel.exception.PortalException,
096                            com.liferay.portal.kernel.exception.SystemException {
097                    return getService().getEvents(groupId, cal, types);
098            }
099    
100            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
101                    long groupId, java.lang.String type, int start, int end)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().getEvents(groupId, type, start, end);
104            }
105    
106            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
107                    long groupId, java.lang.String[] types, int start, int end)
108                    throws com.liferay.portal.kernel.exception.SystemException {
109                    return getService().getEvents(groupId, types, start, end);
110            }
111    
112            public static int getEventsCount(long groupId, java.lang.String type)
113                    throws com.liferay.portal.kernel.exception.SystemException {
114                    return getService().getEventsCount(groupId, type);
115            }
116    
117            public static int getEventsCount(long groupId, java.lang.String[] types)
118                    throws com.liferay.portal.kernel.exception.SystemException {
119                    return getService().getEventsCount(groupId, types);
120            }
121    
122            public static boolean hasEvents(long groupId, java.util.Calendar cal)
123                    throws com.liferay.portal.kernel.exception.PortalException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getService().hasEvents(groupId, cal);
126            }
127    
128            public static boolean hasEvents(long groupId, java.util.Calendar cal,
129                    java.lang.String type)
130                    throws com.liferay.portal.kernel.exception.PortalException,
131                            com.liferay.portal.kernel.exception.SystemException {
132                    return getService().hasEvents(groupId, cal, type);
133            }
134    
135            public static boolean hasEvents(long groupId, java.util.Calendar cal,
136                    java.lang.String[] types)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException {
139                    return getService().hasEvents(groupId, cal, types);
140            }
141    
142            public static void importICal4j(long groupId,
143                    java.io.InputStream inputStream)
144                    throws com.liferay.portal.kernel.exception.PortalException,
145                            com.liferay.portal.kernel.exception.SystemException {
146                    getService().importICal4j(groupId, inputStream);
147            }
148    
149            public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
150                    long eventId, java.lang.String title, java.lang.String description,
151                    java.lang.String location, int startDateMonth, int startDateDay,
152                    int startDateYear, int startDateHour, int startDateMinute,
153                    int endDateMonth, int endDateDay, int endDateYear, int durationHour,
154                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
155                    java.lang.String type, boolean repeating,
156                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
157                    int firstReminder, int secondReminder,
158                    com.liferay.portal.service.ServiceContext serviceContext)
159                    throws com.liferay.portal.kernel.exception.PortalException,
160                            com.liferay.portal.kernel.exception.SystemException {
161                    return getService()
162                                       .updateEvent(eventId, title, description, location,
163                            startDateMonth, startDateDay, startDateYear, startDateHour,
164                            startDateMinute, endDateMonth, endDateDay, endDateYear,
165                            durationHour, durationMinute, allDay, timeZoneSensitive, type,
166                            repeating, recurrence, remindBy, firstReminder, secondReminder,
167                            serviceContext);
168            }
169    
170            public static CalEventService getService() {
171                    if (_service == null) {
172                            _service = (CalEventService)PortalBeanLocatorUtil.locate(CalEventService.class.getName());
173    
174                            ReferenceRegistry.registerReference(CalEventServiceUtil.class,
175                                    "_service");
176                            MethodCache.remove(CalEventService.class);
177                    }
178    
179                    return _service;
180            }
181    
182            public void setService(CalEventService service) {
183                    MethodCache.remove(CalEventService.class);
184    
185                    _service = service;
186    
187                    ReferenceRegistry.registerReference(CalEventServiceUtil.class,
188                            "_service");
189                    MethodCache.remove(CalEventService.class);
190            }
191    
192            private static CalEventService _service;
193    }