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 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            public static com.liferay.portlet.calendar.model.CalEvent fetchCalEvent(
162                    long eventId)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().fetchCalEvent(eventId);
165            }
166    
167            /**
168            * Returns the cal event with the primary key.
169            *
170            * @param eventId the primary key of the cal event
171            * @return the cal event
172            * @throws PortalException if a cal event with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.calendar.model.CalEvent getCalEvent(
176                    long eventId)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getCalEvent(eventId);
180            }
181    
182            public static com.liferay.portal.model.PersistedModel getPersistedModel(
183                    java.io.Serializable primaryKeyObj)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getPersistedModel(primaryKeyObj);
187            }
188    
189            /**
190            * Returns the cal event with the UUID in the group.
191            *
192            * @param uuid the UUID of cal event
193            * @param groupId the group id of the cal event
194            * @return the cal event
195            * @throws PortalException if a cal event with the UUID in the group could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public static com.liferay.portlet.calendar.model.CalEvent getCalEventByUuidAndGroupId(
199                    java.lang.String uuid, long groupId)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException {
202                    return getService().getCalEventByUuidAndGroupId(uuid, groupId);
203            }
204    
205            /**
206            * Returns a range of all the cal events.
207            *
208            * <p>
209            * 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.
210            * </p>
211            *
212            * @param start the lower bound of the range of cal events
213            * @param end the upper bound of the range of cal events (not inclusive)
214            * @return the range of cal events
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCalEvents(
218                    int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getService().getCalEvents(start, end);
221            }
222    
223            /**
224            * Returns the number of cal events.
225            *
226            * @return the number of cal events
227            * @throws SystemException if a system exception occurred
228            */
229            public static int getCalEventsCount()
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getService().getCalEventsCount();
232            }
233    
234            /**
235            * Updates the cal event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
236            *
237            * @param calEvent the cal event
238            * @return the cal event that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.calendar.model.CalEvent updateCalEvent(
242                    com.liferay.portlet.calendar.model.CalEvent calEvent)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updateCalEvent(calEvent);
245            }
246    
247            /**
248            * Updates the cal event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
249            *
250            * @param calEvent the cal event
251            * @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.
252            * @return the cal event that was updated
253            * @throws SystemException if a system exception occurred
254            */
255            public static com.liferay.portlet.calendar.model.CalEvent updateCalEvent(
256                    com.liferay.portlet.calendar.model.CalEvent calEvent, boolean merge)
257                    throws com.liferay.portal.kernel.exception.SystemException {
258                    return getService().updateCalEvent(calEvent, merge);
259            }
260    
261            /**
262            * Returns the Spring bean ID for this bean.
263            *
264            * @return the Spring bean ID for this bean
265            */
266            public static java.lang.String getBeanIdentifier() {
267                    return getService().getBeanIdentifier();
268            }
269    
270            /**
271            * Sets the Spring bean ID for this bean.
272            *
273            * @param beanIdentifier the Spring bean ID for this bean
274            */
275            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
276                    getService().setBeanIdentifier(beanIdentifier);
277            }
278    
279            public static com.liferay.portlet.calendar.model.CalEvent addEvent(
280                    long userId, java.lang.String title, java.lang.String description,
281                    java.lang.String location, int startDateMonth, int startDateDay,
282                    int startDateYear, int startDateHour, int startDateMinute,
283                    int endDateMonth, int endDateDay, int endDateYear, int durationHour,
284                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
285                    java.lang.String type, boolean repeating,
286                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
287                    int firstReminder, int secondReminder,
288                    com.liferay.portal.service.ServiceContext serviceContext)
289                    throws com.liferay.portal.kernel.exception.PortalException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getService()
292                                       .addEvent(userId, title, description, location,
293                            startDateMonth, startDateDay, startDateYear, startDateHour,
294                            startDateMinute, endDateMonth, endDateDay, endDateYear,
295                            durationHour, durationMinute, allDay, timeZoneSensitive, type,
296                            repeating, recurrence, remindBy, firstReminder, secondReminder,
297                            serviceContext);
298            }
299    
300            public static void addEventResources(
301                    com.liferay.portlet.calendar.model.CalEvent event,
302                    boolean addGroupPermissions, boolean addGuestPermissions)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    getService()
306                            .addEventResources(event, addGroupPermissions, addGuestPermissions);
307            }
308    
309            public static void addEventResources(
310                    com.liferay.portlet.calendar.model.CalEvent event,
311                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    getService().addEventResources(event, groupPermissions, guestPermissions);
315            }
316    
317            public static void addEventResources(long eventId,
318                    boolean addGroupPermissions, boolean addGuestPermissions)
319                    throws com.liferay.portal.kernel.exception.PortalException,
320                            com.liferay.portal.kernel.exception.SystemException {
321                    getService()
322                            .addEventResources(eventId, addGroupPermissions, addGuestPermissions);
323            }
324    
325            public static void addEventResources(long eventId,
326                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
327                    throws com.liferay.portal.kernel.exception.PortalException,
328                            com.liferay.portal.kernel.exception.SystemException {
329                    getService()
330                            .addEventResources(eventId, groupPermissions, guestPermissions);
331            }
332    
333            public static void checkEvents()
334                    throws com.liferay.portal.kernel.exception.PortalException,
335                            com.liferay.portal.kernel.exception.SystemException {
336                    getService().checkEvents();
337            }
338    
339            public static void deleteEvent(
340                    com.liferay.portlet.calendar.model.CalEvent event)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException {
343                    getService().deleteEvent(event);
344            }
345    
346            public static void deleteEvent(long eventId)
347                    throws com.liferay.portal.kernel.exception.PortalException,
348                            com.liferay.portal.kernel.exception.SystemException {
349                    getService().deleteEvent(eventId);
350            }
351    
352            public static void deleteEvents(long groupId)
353                    throws com.liferay.portal.kernel.exception.PortalException,
354                            com.liferay.portal.kernel.exception.SystemException {
355                    getService().deleteEvents(groupId);
356            }
357    
358            public static java.io.File exportEvent(long userId, long eventId)
359                    throws com.liferay.portal.kernel.exception.PortalException,
360                            com.liferay.portal.kernel.exception.SystemException {
361                    return getService().exportEvent(userId, eventId);
362            }
363    
364            public static java.io.File exportGroupEvents(long userId, long groupId,
365                    java.lang.String fileName)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    return getService().exportGroupEvents(userId, groupId, fileName);
369            }
370    
371            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCompanyEvents(
372                    long companyId, int start, int end)
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getCompanyEvents(companyId, start, end);
375            }
376    
377            public static int getCompanyEventsCount(long companyId)
378                    throws com.liferay.portal.kernel.exception.SystemException {
379                    return getService().getCompanyEventsCount(companyId);
380            }
381    
382            public static com.liferay.portlet.calendar.model.CalEvent getEvent(
383                    long eventId)
384                    throws com.liferay.portal.kernel.exception.PortalException,
385                            com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getEvent(eventId);
387            }
388    
389            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
390                    long groupId, java.util.Calendar cal)
391                    throws com.liferay.portal.kernel.exception.SystemException {
392                    return getService().getEvents(groupId, cal);
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 type)
397                    throws com.liferay.portal.kernel.exception.SystemException {
398                    return getService().getEvents(groupId, cal, type);
399            }
400    
401            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
402                    long groupId, java.util.Calendar cal, java.lang.String[] types)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getService().getEvents(groupId, cal, types);
405            }
406    
407            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
408                    long groupId, java.lang.String type, int start, int end)
409                    throws com.liferay.portal.kernel.exception.SystemException {
410                    return getService().getEvents(groupId, type, start, end);
411            }
412    
413            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
414                    long groupId, java.lang.String[] types, int start, int end)
415                    throws com.liferay.portal.kernel.exception.SystemException {
416                    return getService().getEvents(groupId, types, start, end);
417            }
418    
419            public static int getEventsCount(long groupId, java.lang.String type)
420                    throws com.liferay.portal.kernel.exception.SystemException {
421                    return getService().getEventsCount(groupId, type);
422            }
423    
424            public static int getEventsCount(long groupId, java.lang.String[] types)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    return getService().getEventsCount(groupId, types);
427            }
428    
429            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getNoAssetEvents()
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getService().getNoAssetEvents();
432            }
433    
434            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getRepeatingEvents(
435                    long groupId)
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    return getService().getRepeatingEvents(groupId);
438            }
439    
440            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getRepeatingEvents(
441                    long groupId, java.util.Calendar cal, java.lang.String[] types)
442                    throws com.liferay.portal.kernel.exception.SystemException {
443                    return getService().getRepeatingEvents(groupId, cal, types);
444            }
445    
446            public static boolean hasEvents(long groupId, java.util.Calendar cal)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    return getService().hasEvents(groupId, cal);
449            }
450    
451            public static boolean hasEvents(long groupId, java.util.Calendar cal,
452                    java.lang.String type)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getService().hasEvents(groupId, cal, type);
455            }
456    
457            public static boolean hasEvents(long groupId, java.util.Calendar cal,
458                    java.lang.String[] types)
459                    throws com.liferay.portal.kernel.exception.SystemException {
460                    return getService().hasEvents(groupId, cal, types);
461            }
462    
463            public static void importICal4j(long userId, long groupId,
464                    java.io.InputStream inputStream)
465                    throws com.liferay.portal.kernel.exception.PortalException,
466                            com.liferay.portal.kernel.exception.SystemException {
467                    getService().importICal4j(userId, groupId, inputStream);
468            }
469    
470            public static void updateAsset(long userId,
471                    com.liferay.portlet.calendar.model.CalEvent event,
472                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
473                    long[] assetLinkEntryIds)
474                    throws com.liferay.portal.kernel.exception.PortalException,
475                            com.liferay.portal.kernel.exception.SystemException {
476                    getService()
477                            .updateAsset(userId, event, assetCategoryIds, assetTagNames,
478                            assetLinkEntryIds);
479            }
480    
481            public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
482                    long userId, long eventId, java.lang.String title,
483                    java.lang.String description, java.lang.String location,
484                    int startDateMonth, int startDateDay, int startDateYear,
485                    int startDateHour, int startDateMinute, int endDateMonth,
486                    int endDateDay, int endDateYear, int durationHour, int durationMinute,
487                    boolean allDay, boolean timeZoneSensitive, java.lang.String type,
488                    boolean repeating,
489                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
490                    int firstReminder, int secondReminder,
491                    com.liferay.portal.service.ServiceContext serviceContext)
492                    throws com.liferay.portal.kernel.exception.PortalException,
493                            com.liferay.portal.kernel.exception.SystemException {
494                    return getService()
495                                       .updateEvent(userId, eventId, title, description, location,
496                            startDateMonth, startDateDay, startDateYear, startDateHour,
497                            startDateMinute, endDateMonth, endDateDay, endDateYear,
498                            durationHour, durationMinute, allDay, timeZoneSensitive, type,
499                            repeating, recurrence, remindBy, firstReminder, secondReminder,
500                            serviceContext);
501            }
502    
503            public static CalEventLocalService getService() {
504                    if (_service == null) {
505                            _service = (CalEventLocalService)PortalBeanLocatorUtil.locate(CalEventLocalService.class.getName());
506    
507                            ReferenceRegistry.registerReference(CalEventLocalServiceUtil.class,
508                                    "_service");
509                            MethodCache.remove(CalEventLocalService.class);
510                    }
511    
512                    return _service;
513            }
514    
515            public void setService(CalEventLocalService service) {
516                    MethodCache.remove(CalEventLocalService.class);
517    
518                    _service = service;
519    
520                    ReferenceRegistry.registerReference(CalEventLocalServiceUtil.class,
521                            "_service");
522                    MethodCache.remove(CalEventLocalService.class);
523            }
524    
525            private static CalEventLocalService _service;
526    }