001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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                    int startDateMonth, int startDateDay, int startDateYear,
276                    int startDateHour, int startDateMinute, int endDateMonth,
277                    int endDateDay, int endDateYear, int durationHour, int durationMinute,
278                    boolean allDay, boolean timeZoneSensitive, java.lang.String type,
279                    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, startDateMonth,
287                            startDateDay, startDateYear, startDateHour, startDateMinute,
288                            endDateMonth, endDateDay, endDateYear, durationHour,
289                            durationMinute, allDay, timeZoneSensitive, type, repeating,
290                            recurrence, remindBy, firstReminder, secondReminder, serviceContext);
291            }
292    
293            public static void addEventResources(
294                    com.liferay.portlet.calendar.model.CalEvent event,
295                    boolean addCommunityPermissions, boolean addGuestPermissions)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    getService()
299                            .addEventResources(event, addCommunityPermissions,
300                            addGuestPermissions);
301            }
302    
303            public static void addEventResources(
304                    com.liferay.portlet.calendar.model.CalEvent event,
305                    java.lang.String[] communityPermissions,
306                    java.lang.String[] guestPermissions)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException {
309                    getService()
310                            .addEventResources(event, communityPermissions, guestPermissions);
311            }
312    
313            public static void addEventResources(long eventId,
314                    boolean addCommunityPermissions, boolean addGuestPermissions)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    getService()
318                            .addEventResources(eventId, addCommunityPermissions,
319                            addGuestPermissions);
320            }
321    
322            public static void addEventResources(long eventId,
323                    java.lang.String[] communityPermissions,
324                    java.lang.String[] guestPermissions)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    getService()
328                            .addEventResources(eventId, communityPermissions, guestPermissions);
329            }
330    
331            public static void checkEvents()
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    getService().checkEvents();
335            }
336    
337            public static void deleteEvent(
338                    com.liferay.portlet.calendar.model.CalEvent event)
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException {
341                    getService().deleteEvent(event);
342            }
343    
344            public static void deleteEvent(long eventId)
345                    throws com.liferay.portal.kernel.exception.PortalException,
346                            com.liferay.portal.kernel.exception.SystemException {
347                    getService().deleteEvent(eventId);
348            }
349    
350            public static void deleteEvents(long groupId)
351                    throws com.liferay.portal.kernel.exception.PortalException,
352                            com.liferay.portal.kernel.exception.SystemException {
353                    getService().deleteEvents(groupId);
354            }
355    
356            public static java.io.File exportEvent(long userId, long eventId)
357                    throws com.liferay.portal.kernel.exception.PortalException,
358                            com.liferay.portal.kernel.exception.SystemException {
359                    return getService().exportEvent(userId, eventId);
360            }
361    
362            public static java.io.File exportGroupEvents(long userId, long groupId,
363                    java.lang.String fileName)
364                    throws com.liferay.portal.kernel.exception.PortalException,
365                            com.liferay.portal.kernel.exception.SystemException {
366                    return getService().exportGroupEvents(userId, groupId, fileName);
367            }
368    
369            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getCompanyEvents(
370                    long companyId, int start, int end)
371                    throws com.liferay.portal.kernel.exception.SystemException {
372                    return getService().getCompanyEvents(companyId, start, end);
373            }
374    
375            public static int getCompanyEventsCount(long companyId)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getService().getCompanyEventsCount(companyId);
378            }
379    
380            public static com.liferay.portlet.calendar.model.CalEvent getEvent(
381                    long eventId)
382                    throws com.liferay.portal.kernel.exception.PortalException,
383                            com.liferay.portal.kernel.exception.SystemException {
384                    return getService().getEvent(eventId);
385            }
386    
387            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
388                    long groupId, java.util.Calendar cal)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getService().getEvents(groupId, cal);
391            }
392    
393            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
394                    long groupId, java.util.Calendar cal, java.lang.String type)
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    return getService().getEvents(groupId, cal, type);
397            }
398    
399            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getEvents(
400                    long groupId, java.lang.String type, int start, int end)
401                    throws com.liferay.portal.kernel.exception.SystemException {
402                    return getService().getEvents(groupId, type, start, end);
403            }
404    
405            public static int getEventsCount(long groupId, java.lang.String type)
406                    throws com.liferay.portal.kernel.exception.SystemException {
407                    return getService().getEventsCount(groupId, type);
408            }
409    
410            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getNoAssetEvents()
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getService().getNoAssetEvents();
413            }
414    
415            public static java.util.List<com.liferay.portlet.calendar.model.CalEvent> getRepeatingEvents(
416                    long groupId)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getService().getRepeatingEvents(groupId);
419            }
420    
421            public static boolean hasEvents(long groupId, java.util.Calendar cal)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    return getService().hasEvents(groupId, cal);
424            }
425    
426            public static boolean hasEvents(long groupId, java.util.Calendar cal,
427                    java.lang.String type)
428                    throws com.liferay.portal.kernel.exception.SystemException {
429                    return getService().hasEvents(groupId, cal, type);
430            }
431    
432            public static void importICal4j(long userId, long groupId, java.io.File file)
433                    throws com.liferay.portal.kernel.exception.PortalException,
434                            com.liferay.portal.kernel.exception.SystemException {
435                    getService().importICal4j(userId, groupId, file);
436            }
437    
438            public static void updateAsset(long userId,
439                    com.liferay.portlet.calendar.model.CalEvent event,
440                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
441                    throws com.liferay.portal.kernel.exception.PortalException,
442                            com.liferay.portal.kernel.exception.SystemException {
443                    getService().updateAsset(userId, event, assetCategoryIds, assetTagNames);
444            }
445    
446            public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
447                    long userId, long eventId, java.lang.String title,
448                    java.lang.String description, int startDateMonth, int startDateDay,
449                    int startDateYear, int startDateHour, int startDateMinute,
450                    int endDateMonth, int endDateDay, int endDateYear, int durationHour,
451                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
452                    java.lang.String type, boolean repeating,
453                    com.liferay.portal.kernel.cal.TZSRecurrence recurrence, int remindBy,
454                    int firstReminder, int secondReminder,
455                    com.liferay.portal.service.ServiceContext serviceContext)
456                    throws com.liferay.portal.kernel.exception.PortalException,
457                            com.liferay.portal.kernel.exception.SystemException {
458                    return getService()
459                                       .updateEvent(userId, eventId, title, description,
460                            startDateMonth, startDateDay, startDateYear, startDateHour,
461                            startDateMinute, endDateMonth, endDateDay, endDateYear,
462                            durationHour, durationMinute, allDay, timeZoneSensitive, type,
463                            repeating, recurrence, remindBy, firstReminder, secondReminder,
464                            serviceContext);
465            }
466    
467            public static CalEventLocalService getService() {
468                    if (_service == null) {
469                            _service = (CalEventLocalService)PortalBeanLocatorUtil.locate(CalEventLocalService.class.getName());
470    
471                            ReferenceRegistry.registerReference(CalEventLocalServiceUtil.class,
472                                    "_service");
473                            MethodCache.remove(CalEventLocalService.class);
474                    }
475    
476                    return _service;
477            }
478    
479            public void setService(CalEventLocalService service) {
480                    MethodCache.remove(CalEventLocalService.class);
481    
482                    _service = service;
483    
484                    ReferenceRegistry.registerReference(CalEventLocalServiceUtil.class,
485                            "_service");
486                    MethodCache.remove(CalEventLocalService.class);
487            }
488    
489            private static CalEventLocalService _service;
490    }