001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for CalEvent. This utility wraps
024     * {@link com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see CalEventLocalService
032     * @see com.liferay.portlet.calendar.service.base.CalEventLocalServiceBaseImpl
033     * @see com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl
034     * @deprecated As of 7.0.0, with no direct replacement
035     * @generated
036     */
037    @Deprecated
038    @ProviderType
039    public class CalEventLocalServiceUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047            * Adds the cal event to the database. Also notifies the appropriate model listeners.
048            *
049            * @param calEvent the cal event
050            * @return the cal event that was added
051            */
052            public static com.liferay.portlet.calendar.model.CalEvent addCalEvent(
053                    com.liferay.portlet.calendar.model.CalEvent calEvent) {
054                    return getService().addCalEvent(calEvent);
055            }
056    
057            public static com.liferay.portlet.calendar.model.CalEvent addEvent(
058                    long userId, java.lang.String title, java.lang.String description,
059                    java.lang.String location, int startDateMonth, int startDateDay,
060                    int startDateYear, int startDateHour, int startDateMinute,
061                    int durationHour, int durationMinute, boolean allDay,
062                    boolean timeZoneSensitive, java.lang.String type, boolean repeating,
063                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
064                    int firstReminder, int secondReminder,
065                    com.liferay.portal.service.ServiceContext serviceContext)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService()
068                                       .addEvent(userId, title, description, location,
069                            startDateMonth, startDateDay, startDateYear, startDateHour,
070                            startDateMinute, durationHour, durationMinute, allDay,
071                            timeZoneSensitive, type, repeating, recurrence, remindBy,
072                            firstReminder, secondReminder, serviceContext);
073            }
074    
075            public static void addEventResources(
076                    com.liferay.portlet.calendar.model.CalEvent event,
077                    boolean addGroupPermissions, boolean addGuestPermissions)
078                    throws com.liferay.portal.kernel.exception.PortalException {
079                    getService()
080                            .addEventResources(event, addGroupPermissions, addGuestPermissions);
081            }
082    
083            public static void addEventResources(
084                    com.liferay.portlet.calendar.model.CalEvent event,
085                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
086                    throws com.liferay.portal.kernel.exception.PortalException {
087                    getService().addEventResources(event, modelPermissions);
088            }
089    
090            public static void addEventResources(long eventId,
091                    boolean addGroupPermissions, boolean addGuestPermissions)
092                    throws com.liferay.portal.kernel.exception.PortalException {
093                    getService()
094                            .addEventResources(eventId, addGroupPermissions, addGuestPermissions);
095            }
096    
097            public static void addEventResources(long eventId,
098                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    getService().addEventResources(eventId, modelPermissions);
101            }
102    
103            public static void checkEvents() {
104                    getService().checkEvents();
105            }
106    
107            /**
108            * Creates a new cal event with the primary key. Does not add the cal event to the database.
109            *
110            * @param eventId the primary key for the new cal event
111            * @return the new cal event
112            */
113            public static com.liferay.portlet.calendar.model.CalEvent createCalEvent(
114                    long eventId) {
115                    return getService().createCalEvent(eventId);
116            }
117    
118            /**
119            * Deletes the cal event from the database. Also notifies the appropriate model listeners.
120            *
121            * @param calEvent the cal event
122            * @return the cal event that was removed
123            */
124            public static com.liferay.portlet.calendar.model.CalEvent deleteCalEvent(
125                    com.liferay.portlet.calendar.model.CalEvent calEvent) {
126                    return getService().deleteCalEvent(calEvent);
127            }
128    
129            /**
130            * Deletes the cal event with the primary key from the database. Also notifies the appropriate model listeners.
131            *
132            * @param eventId the primary key of the cal event
133            * @return the cal event that was removed
134            * @throws PortalException if a cal event with the primary key could not be found
135            */
136            public static com.liferay.portlet.calendar.model.CalEvent deleteCalEvent(
137                    long eventId)
138                    throws com.liferay.portal.kernel.exception.PortalException {
139                    return getService().deleteCalEvent(eventId);
140            }
141    
142            public static com.liferay.portlet.calendar.model.CalEvent deleteEvent(
143                    com.liferay.portlet.calendar.model.CalEvent event)
144                    throws com.liferay.portal.kernel.exception.PortalException {
145                    return getService().deleteEvent(event);
146            }
147    
148            public static com.liferay.portlet.calendar.model.CalEvent deleteEvent(
149                    long eventId)
150                    throws com.liferay.portal.kernel.exception.PortalException {
151                    return getService().deleteEvent(eventId);
152            }
153    
154            public static void deleteEvents(long groupId)
155                    throws com.liferay.portal.kernel.exception.PortalException {
156                    getService().deleteEvents(groupId);
157            }
158    
159            /**
160            * @throws PortalException
161            */
162            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
163                    com.liferay.portal.model.PersistedModel persistedModel)
164                    throws com.liferay.portal.kernel.exception.PortalException {
165                    return getService().deletePersistedModel(persistedModel);
166            }
167    
168            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
169                    return getService().dynamicQuery();
170            }
171    
172            /**
173            * Performs a dynamic query on the database and returns the matching rows.
174            *
175            * @param dynamicQuery the dynamic query
176            * @return the matching rows
177            */
178            public static <T> java.util.List<T> dynamicQuery(
179                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
180                    return getService().dynamicQuery(dynamicQuery);
181            }
182    
183            /**
184            * Performs a dynamic query on the database and returns a range of the matching rows.
185            *
186            * <p>
187            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.calendar.model.impl.CalEventModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
188            * </p>
189            *
190            * @param dynamicQuery the dynamic query
191            * @param start the lower bound of the range of model instances
192            * @param end the upper bound of the range of model instances (not inclusive)
193            * @return the range of matching rows
194            */
195            public static <T> java.util.List<T> dynamicQuery(
196                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
197                    int end) {
198                    return getService().dynamicQuery(dynamicQuery, start, end);
199            }
200    
201            /**
202            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
203            *
204            * <p>
205            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.calendar.model.impl.CalEventModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
206            * </p>
207            *
208            * @param dynamicQuery the dynamic query
209            * @param start the lower bound of the range of model instances
210            * @param end the upper bound of the range of model instances (not inclusive)
211            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
212            * @return the ordered range of matching rows
213            */
214            public static <T> java.util.List<T> dynamicQuery(
215                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
216                    int end,
217                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
218                    return getService()
219                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
220            }
221    
222            /**
223            * Returns the number of rows matching the dynamic query.
224            *
225            * @param dynamicQuery the dynamic query
226            * @return the number of rows matching the dynamic query
227            */
228            public static long dynamicQueryCount(
229                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
230                    return getService().dynamicQueryCount(dynamicQuery);
231            }
232    
233            /**
234            * Returns the number of rows matching the dynamic query.
235            *
236            * @param dynamicQuery the dynamic query
237            * @param projection the projection to apply to the query
238            * @return the number of rows matching the dynamic query
239            */
240            public static long dynamicQueryCount(
241                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
242                    com.liferay.portal.kernel.dao.orm.Projection projection) {
243                    return getService().dynamicQueryCount(dynamicQuery, projection);
244            }
245    
246            public static java.io.File exportEvent(long userId, long eventId)
247                    throws com.liferay.portal.kernel.exception.PortalException {
248                    return getService().exportEvent(userId, eventId);
249            }
250    
251            public static java.io.File exportEvents(long userId,
252                    java.util.List<com.liferay.portlet.calendar.model.CalEvent> events,
253                    java.lang.String fileName)
254                    throws com.liferay.portal.kernel.exception.PortalException {
255                    return getService().exportEvents(userId, events, fileName);
256            }
257    
258            public static java.io.File exportGroupEvents(long userId, long groupId,
259                    java.lang.String fileName)
260                    throws com.liferay.portal.kernel.exception.PortalException {
261                    return getService().exportGroupEvents(userId, groupId, fileName);
262            }
263    
264            public static com.liferay.portlet.calendar.model.CalEvent fetchCalEvent(
265                    long eventId) {
266                    return getService().fetchCalEvent(eventId);
267            }
268    
269            /**
270            * Returns the cal event matching the UUID and group.
271            *
272            * @param uuid the cal event's UUID
273            * @param groupId the primary key of the group
274            * @return the matching cal event, or <code>null</code> if a matching cal event could not be found
275            */
276            public static com.liferay.portlet.calendar.model.CalEvent fetchCalEventByUuidAndGroupId(
277                    java.lang.String uuid, long groupId) {
278                    return getService().fetchCalEventByUuidAndGroupId(uuid, groupId);
279            }
280    
281            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
282                    return getService().getActionableDynamicQuery();
283            }
284    
285            /**
286            * Returns the cal event with the primary key.
287            *
288            * @param eventId the primary key of the cal event
289            * @return the cal event
290            * @throws PortalException if a cal event with the primary key could not be found
291            */
292            public static com.liferay.portlet.calendar.model.CalEvent getCalEvent(
293                    long eventId)
294                    throws com.liferay.portal.kernel.exception.PortalException {
295                    return getService().getCalEvent(eventId);
296            }
297    
298            /**
299            * Returns the cal event matching the UUID and group.
300            *
301            * @param uuid the cal event's UUID
302            * @param groupId the primary key of the group
303            * @return the matching cal event
304            * @throws PortalException if a matching cal event could not be found
305            */
306            public static com.liferay.portlet.calendar.model.CalEvent getCalEventByUuidAndGroupId(
307                    java.lang.String uuid, long groupId)
308                    throws com.liferay.portal.kernel.exception.PortalException {
309                    return getService().getCalEventByUuidAndGroupId(uuid, groupId);
310            }
311    
312            /**
313            * Returns a range of all the cal events.
314            *
315            * <p>
316            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.calendar.model.impl.CalEventModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
317            * </p>
318            *
319            * @param start the lower bound of the range of cal events
320            * @param end the upper bound of the range of cal events (not inclusive)
321            * @return the range of cal events
322            */
323            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCalEvents(
324                    int start, int end) {
325                    return getService().getCalEvents(start, end);
326            }
327    
328            /**
329            * Returns all the cal events matching the UUID and company.
330            *
331            * @param uuid the UUID of the cal events
332            * @param companyId the primary key of the company
333            * @return the matching cal events, or an empty list if no matches were found
334            */
335            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCalEventsByUuidAndCompanyId(
336                    java.lang.String uuid, long companyId) {
337                    return getService().getCalEventsByUuidAndCompanyId(uuid, companyId);
338            }
339    
340            /**
341            * Returns a range of cal events matching the UUID and company.
342            *
343            * @param uuid the UUID of the cal events
344            * @param companyId the primary key of the company
345            * @param start the lower bound of the range of cal events
346            * @param end the upper bound of the range of cal events (not inclusive)
347            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
348            * @return the range of matching cal events, or an empty list if no matches were found
349            */
350            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCalEventsByUuidAndCompanyId(
351                    java.lang.String uuid, long companyId, int start, int end,
352                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.calendar.model.CalEvent> orderByComparator) {
353                    return getService()
354                                       .getCalEventsByUuidAndCompanyId(uuid, companyId, start, end,
355                            orderByComparator);
356            }
357    
358            /**
359            * Returns the number of cal events.
360            *
361            * @return the number of cal events
362            */
363            public static int getCalEventsCount() {
364                    return getService().getCalEventsCount();
365            }
366    
367            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCompanyEvents(
368                    long companyId, int start, int end) {
369                    return getService().getCompanyEvents(companyId, start, end);
370            }
371    
372            public static int getCompanyEventsCount(long companyId) {
373                    return getService().getCompanyEventsCount(companyId);
374            }
375    
376            public static com.liferay.portlet.calendar.model.CalEvent getEvent(
377                    long eventId)
378                    throws com.liferay.portal.kernel.exception.PortalException {
379                    return getService().getEvent(eventId);
380            }
381    
382            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
383                    long groupId, java.util.Calendar cal) {
384                    return getService().getEvents(groupId, cal);
385            }
386    
387            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
388                    long groupId, java.util.Calendar cal, java.lang.String type) {
389                    return getService().getEvents(groupId, cal, type);
390            }
391    
392            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
393                    long groupId, java.util.Calendar cal, java.lang.String[] types) {
394                    return getService().getEvents(groupId, cal, types);
395            }
396    
397            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
398                    long groupId, java.lang.String type, int start, int end) {
399                    return getService().getEvents(groupId, type, start, end);
400            }
401    
402            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
403                    long groupId, java.lang.String[] types, int start, int end) {
404                    return getService().getEvents(groupId, types, start, end);
405            }
406    
407            public static int getEventsCount(long groupId, java.lang.String type) {
408                    return getService().getEventsCount(groupId, type);
409            }
410    
411            public static int getEventsCount(long groupId, java.lang.String[] types) {
412                    return getService().getEventsCount(groupId, types);
413            }
414    
415            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
416                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
417                    return getService().getExportActionableDynamicQuery(portletDataContext);
418            }
419    
420            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
421                    return getService().getIndexableActionableDynamicQuery();
422            }
423    
424            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getNoAssetEvents() {
425                    return getService().getNoAssetEvents();
426            }
427    
428            /**
429            * Returns the OSGi service identifier.
430            *
431            * @return the OSGi service identifier
432            */
433            public static java.lang.String getOSGiServiceIdentifier() {
434                    return getService().getOSGiServiceIdentifier();
435            }
436    
437            public static com.liferay.portal.model.PersistedModel getPersistedModel(
438                    java.io.Serializable primaryKeyObj)
439                    throws com.liferay.portal.kernel.exception.PortalException {
440                    return getService().getPersistedModel(primaryKeyObj);
441            }
442    
443            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getRepeatingEvents(
444                    long groupId) {
445                    return getService().getRepeatingEvents(groupId);
446            }
447    
448            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getRepeatingEvents(
449                    long groupId, java.util.Calendar cal, java.lang.String[] types) {
450                    return getService().getRepeatingEvents(groupId, cal, types);
451            }
452    
453            public static boolean hasEvents(long groupId, java.util.Calendar cal) {
454                    return getService().hasEvents(groupId, cal);
455            }
456    
457            public static boolean hasEvents(long groupId, java.util.Calendar cal,
458                    java.lang.String type) {
459                    return getService().hasEvents(groupId, cal, type);
460            }
461    
462            public static boolean hasEvents(long groupId, java.util.Calendar cal,
463                    java.lang.String[] types) {
464                    return getService().hasEvents(groupId, cal, types);
465            }
466    
467            public static void importICal4j(long userId, long groupId,
468                    java.io.InputStream inputStream)
469                    throws com.liferay.portal.kernel.exception.PortalException {
470                    getService().importICal4j(userId, groupId, inputStream);
471            }
472    
473            public static void updateAsset(long userId,
474                    com.liferay.portlet.calendar.model.CalEvent event,
475                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
476                    long[] assetLinkEntryIds)
477                    throws com.liferay.portal.kernel.exception.PortalException {
478                    getService()
479                            .updateAsset(userId, event, assetCategoryIds, assetTagNames,
480                            assetLinkEntryIds);
481            }
482    
483            /**
484            * Updates the cal event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
485            *
486            * @param calEvent the cal event
487            * @return the cal event that was updated
488            */
489            public static com.liferay.portlet.calendar.model.CalEvent updateCalEvent(
490                    com.liferay.portlet.calendar.model.CalEvent calEvent) {
491                    return getService().updateCalEvent(calEvent);
492            }
493    
494            public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
495                    long userId, long eventId, java.lang.String title,
496                    java.lang.String description, java.lang.String location,
497                    int startDateMonth, int startDateDay, int startDateYear,
498                    int startDateHour, int startDateMinute, int durationHour,
499                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
500                    java.lang.String type, boolean repeating,
501                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
502                    int firstReminder, int secondReminder,
503                    com.liferay.portal.service.ServiceContext serviceContext)
504                    throws com.liferay.portal.kernel.exception.PortalException {
505                    return getService()
506                                       .updateEvent(userId, eventId, title, description, location,
507                            startDateMonth, startDateDay, startDateYear, startDateHour,
508                            startDateMinute, durationHour, durationMinute, allDay,
509                            timeZoneSensitive, type, repeating, recurrence, remindBy,
510                            firstReminder, secondReminder, serviceContext);
511            }
512    
513            public static CalEventLocalService getService() {
514                    if (_service == null) {
515                            _service = (CalEventLocalService)PortalBeanLocatorUtil.locate(CalEventLocalService.class.getName());
516    
517                            ReferenceRegistry.registerReference(CalEventLocalServiceUtil.class,
518                                    "_service");
519                    }
520    
521                    return _service;
522            }
523    
524            private static CalEventLocalService _service;
525    }