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.cal.TZSRecurrence;
020    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.Projection;
025    import com.liferay.portal.kernel.exception.PortalException;
026    import com.liferay.portal.kernel.exception.SystemException;
027    import com.liferay.portal.kernel.search.Indexable;
028    import com.liferay.portal.kernel.search.IndexableType;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.model.PersistedModel;
034    import com.liferay.portal.service.BaseLocalService;
035    import com.liferay.portal.service.PersistedModelLocalService;
036    import com.liferay.portal.service.ServiceContext;
037    import com.liferay.portal.service.permission.ModelPermissions;
038    
039    import com.liferay.portlet.calendar.model.CalEvent;
040    import com.liferay.portlet.exportimport.lar.PortletDataContext;
041    
042    import java.io.File;
043    import java.io.InputStream;
044    import java.io.Serializable;
045    
046    import java.util.Calendar;
047    import java.util.List;
048    
049    /**
050     * Provides the local service interface for CalEvent. Methods of this
051     * service will not have security checks based on the propagated JAAS
052     * credentials because this service can only be accessed from within the same
053     * VM.
054     *
055     * @author Brian Wing Shun Chan
056     * @see CalEventLocalServiceUtil
057     * @see com.liferay.portlet.calendar.service.base.CalEventLocalServiceBaseImpl
058     * @see com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl
059     * @deprecated As of 7.0.0, with no direct replacement
060     * @generated
061     */
062    @Deprecated
063    @ProviderType
064    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
065            PortalException.class, SystemException.class})
066    public interface CalEventLocalService extends BaseLocalService,
067            PersistedModelLocalService {
068            /*
069             * NOTE FOR DEVELOPERS:
070             *
071             * Never modify or reference this interface directly. Always use {@link CalEventLocalServiceUtil} to access the cal event local service. Add custom service methods to {@link com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
072             */
073    
074            /**
075            * Adds the cal event to the database. Also notifies the appropriate model listeners.
076            *
077            * @param calEvent the cal event
078            * @return the cal event that was added
079            */
080            @Indexable(type = IndexableType.REINDEX)
081            public CalEvent addCalEvent(CalEvent calEvent);
082    
083            @Indexable(type = IndexableType.REINDEX)
084            public CalEvent addEvent(long userId, java.lang.String title,
085                    java.lang.String description, java.lang.String location,
086                    int startDateMonth, int startDateDay, int startDateYear,
087                    int startDateHour, int startDateMinute, int durationHour,
088                    int durationMinute, boolean allDay, boolean timeZoneSensitive,
089                    java.lang.String type, boolean repeating, TZSRecurrence recurrence,
090                    int remindBy, int firstReminder, int secondReminder,
091                    ServiceContext serviceContext) throws PortalException;
092    
093            public void addEventResources(CalEvent event, boolean addGroupPermissions,
094                    boolean addGuestPermissions) throws PortalException;
095    
096            public void addEventResources(CalEvent event,
097                    ModelPermissions modelPermissions) throws PortalException;
098    
099            public void addEventResources(long eventId, boolean addGroupPermissions,
100                    boolean addGuestPermissions) throws PortalException;
101    
102            public void addEventResources(long eventId,
103                    ModelPermissions modelPermissions) throws PortalException;
104    
105            public void checkEvents();
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 CalEvent createCalEvent(long eventId);
114    
115            /**
116            * Deletes the cal event from the database. Also notifies the appropriate model listeners.
117            *
118            * @param calEvent the cal event
119            * @return the cal event that was removed
120            */
121            @Indexable(type = IndexableType.DELETE)
122            public CalEvent deleteCalEvent(CalEvent calEvent);
123    
124            /**
125            * Deletes the cal event with the primary key from the database. Also notifies the appropriate model listeners.
126            *
127            * @param eventId the primary key of the cal event
128            * @return the cal event that was removed
129            * @throws PortalException if a cal event with the primary key could not be found
130            */
131            @Indexable(type = IndexableType.DELETE)
132            public CalEvent deleteCalEvent(long eventId) throws PortalException;
133    
134            @Indexable(type = IndexableType.DELETE)
135            public CalEvent deleteEvent(CalEvent event) throws PortalException;
136    
137            @Indexable(type = IndexableType.DELETE)
138            public CalEvent deleteEvent(long eventId) throws PortalException;
139    
140            public void deleteEvents(long groupId) throws PortalException;
141    
142            /**
143            * @throws PortalException
144            */
145            @Override
146            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
147                    throws PortalException;
148    
149            public DynamicQuery dynamicQuery();
150    
151            /**
152            * Performs a dynamic query on the database and returns the matching rows.
153            *
154            * @param dynamicQuery the dynamic query
155            * @return the matching rows
156            */
157            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
158    
159            /**
160            * Performs a dynamic query on the database and returns a range of the matching rows.
161            *
162            * <p>
163            * 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.
164            * </p>
165            *
166            * @param dynamicQuery the dynamic query
167            * @param start the lower bound of the range of model instances
168            * @param end the upper bound of the range of model instances (not inclusive)
169            * @return the range of matching rows
170            */
171            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
172                    int end);
173    
174            /**
175            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
176            *
177            * <p>
178            * 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.
179            * </p>
180            *
181            * @param dynamicQuery the dynamic query
182            * @param start the lower bound of the range of model instances
183            * @param end the upper bound of the range of model instances (not inclusive)
184            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
185            * @return the ordered range of matching rows
186            */
187            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188                    int end, OrderByComparator<T> orderByComparator);
189    
190            /**
191            * Returns the number of rows matching the dynamic query.
192            *
193            * @param dynamicQuery the dynamic query
194            * @return the number of rows matching the dynamic query
195            */
196            public long dynamicQueryCount(DynamicQuery dynamicQuery);
197    
198            /**
199            * Returns the number of rows matching the dynamic query.
200            *
201            * @param dynamicQuery the dynamic query
202            * @param projection the projection to apply to the query
203            * @return the number of rows matching the dynamic query
204            */
205            public long dynamicQueryCount(DynamicQuery dynamicQuery,
206                    Projection projection);
207    
208            public File exportEvent(long userId, long eventId)
209                    throws PortalException;
210    
211            public File exportEvents(long userId, List<CalEvent> events,
212                    java.lang.String fileName) throws PortalException;
213    
214            public File exportGroupEvents(long userId, long groupId,
215                    java.lang.String fileName) throws PortalException;
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public CalEvent fetchCalEvent(long eventId);
219    
220            /**
221            * Returns the cal event matching the UUID and group.
222            *
223            * @param uuid the cal event's UUID
224            * @param groupId the primary key of the group
225            * @return the matching cal event, or <code>null</code> if a matching cal event could not be found
226            */
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public CalEvent fetchCalEventByUuidAndGroupId(java.lang.String uuid,
229                    long groupId);
230    
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public ActionableDynamicQuery getActionableDynamicQuery();
233    
234            /**
235            * Returns the cal event with the primary key.
236            *
237            * @param eventId the primary key of the cal event
238            * @return the cal event
239            * @throws PortalException if a cal event with the primary key could not be found
240            */
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public CalEvent getCalEvent(long eventId) throws PortalException;
243    
244            /**
245            * Returns the cal event matching the UUID and group.
246            *
247            * @param uuid the cal event's UUID
248            * @param groupId the primary key of the group
249            * @return the matching cal event
250            * @throws PortalException if a matching cal event could not be found
251            */
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public CalEvent getCalEventByUuidAndGroupId(java.lang.String uuid,
254                    long groupId) throws PortalException;
255    
256            /**
257            * Returns a range of all the cal events.
258            *
259            * <p>
260            * 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.
261            * </p>
262            *
263            * @param start the lower bound of the range of cal events
264            * @param end the upper bound of the range of cal events (not inclusive)
265            * @return the range of cal events
266            */
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public List<CalEvent> getCalEvents(int start, int end);
269    
270            /**
271            * Returns all the cal events matching the UUID and company.
272            *
273            * @param uuid the UUID of the cal events
274            * @param companyId the primary key of the company
275            * @return the matching cal events, or an empty list if no matches were found
276            */
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public List<CalEvent> getCalEventsByUuidAndCompanyId(
279                    java.lang.String uuid, long companyId);
280    
281            /**
282            * Returns a range of cal events matching the UUID and company.
283            *
284            * @param uuid the UUID of the cal events
285            * @param companyId the primary key of the company
286            * @param start the lower bound of the range of cal events
287            * @param end the upper bound of the range of cal events (not inclusive)
288            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
289            * @return the range of matching cal events, or an empty list if no matches were found
290            */
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public List<CalEvent> getCalEventsByUuidAndCompanyId(
293                    java.lang.String uuid, long companyId, int start, int end,
294                    OrderByComparator<CalEvent> orderByComparator);
295    
296            /**
297            * Returns the number of cal events.
298            *
299            * @return the number of cal events
300            */
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public int getCalEventsCount();
303    
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public List<CalEvent> getCompanyEvents(long companyId, int start, int end);
306    
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public int getCompanyEventsCount(long companyId);
309    
310            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311            public CalEvent getEvent(long eventId) throws PortalException;
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public List<CalEvent> getEvents(long groupId, Calendar cal);
315    
316            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
317            public List<CalEvent> getEvents(long groupId, Calendar cal,
318                    java.lang.String type);
319    
320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321            public List<CalEvent> getEvents(long groupId, Calendar cal,
322                    java.lang.String[] types);
323    
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public List<CalEvent> getEvents(long groupId, java.lang.String type,
326                    int start, int end);
327    
328            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
329            public List<CalEvent> getEvents(long groupId, java.lang.String[] types,
330                    int start, int end);
331    
332            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
333            public int getEventsCount(long groupId, java.lang.String type);
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public int getEventsCount(long groupId, java.lang.String[] types);
337    
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
340                    PortletDataContext portletDataContext);
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
344    
345            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346            public List<CalEvent> getNoAssetEvents();
347    
348            /**
349            * Returns the OSGi service identifier.
350            *
351            * @return the OSGi service identifier
352            */
353            public java.lang.String getOSGiServiceIdentifier();
354    
355            @Override
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
358                    throws PortalException;
359    
360            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361            public List<CalEvent> getRepeatingEvents(long groupId);
362    
363            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364            public List<CalEvent> getRepeatingEvents(long groupId, Calendar cal,
365                    java.lang.String[] types);
366    
367            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368            public boolean hasEvents(long groupId, Calendar cal);
369    
370            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
371            public boolean hasEvents(long groupId, Calendar cal, java.lang.String type);
372    
373            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
374            public boolean hasEvents(long groupId, Calendar cal,
375                    java.lang.String[] types);
376    
377            public void importICal4j(long userId, long groupId, InputStream inputStream)
378                    throws PortalException;
379    
380            public void updateAsset(long userId, CalEvent event,
381                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
382                    long[] assetLinkEntryIds) throws PortalException;
383    
384            /**
385            * Updates the cal event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
386            *
387            * @param calEvent the cal event
388            * @return the cal event that was updated
389            */
390            @Indexable(type = IndexableType.REINDEX)
391            public CalEvent updateCalEvent(CalEvent calEvent);
392    
393            @Indexable(type = IndexableType.REINDEX)
394            public CalEvent updateEvent(long userId, long eventId,
395                    java.lang.String title, java.lang.String description,
396                    java.lang.String location, int startDateMonth, int startDateDay,
397                    int startDateYear, int startDateHour, int startDateMinute,
398                    int durationHour, int durationMinute, boolean allDay,
399                    boolean timeZoneSensitive, java.lang.String type, boolean repeating,
400                    TZSRecurrence recurrence, int remindBy, int firstReminder,
401                    int secondReminder, ServiceContext serviceContext)
402                    throws PortalException;
403    }