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