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.announcements.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.announcements.kernel.model.AnnouncementsEntry;
020    
021    import com.liferay.exportimport.kernel.lar.PortletDataContext;
022    
023    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.Projection;
028    import com.liferay.portal.kernel.exception.PortalException;
029    import com.liferay.portal.kernel.exception.SystemException;
030    import com.liferay.portal.kernel.model.PersistedModel;
031    import com.liferay.portal.kernel.search.Indexable;
032    import com.liferay.portal.kernel.search.IndexableType;
033    import com.liferay.portal.kernel.service.BaseLocalService;
034    import com.liferay.portal.kernel.service.PersistedModelLocalService;
035    import com.liferay.portal.kernel.transaction.Isolation;
036    import com.liferay.portal.kernel.transaction.Propagation;
037    import com.liferay.portal.kernel.transaction.Transactional;
038    import com.liferay.portal.kernel.util.OrderByComparator;
039    
040    import java.io.Serializable;
041    
042    import java.util.LinkedHashMap;
043    import java.util.List;
044    
045    /**
046     * Provides the local service interface for AnnouncementsEntry. Methods of this
047     * service will not have security checks based on the propagated JAAS
048     * credentials because this service can only be accessed from within the same
049     * VM.
050     *
051     * @author Brian Wing Shun Chan
052     * @see AnnouncementsEntryLocalServiceUtil
053     * @see com.liferay.portlet.announcements.service.base.AnnouncementsEntryLocalServiceBaseImpl
054     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl
055     * @generated
056     */
057    @ProviderType
058    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
059            PortalException.class, SystemException.class})
060    public interface AnnouncementsEntryLocalService extends BaseLocalService,
061            PersistedModelLocalService {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this interface directly. Always use {@link AnnouncementsEntryLocalServiceUtil} to access the announcements entry local service. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
066             */
067    
068            /**
069            * Adds the announcements entry to the database. Also notifies the appropriate model listeners.
070            *
071            * @param announcementsEntry the announcements entry
072            * @return the announcements entry that was added
073            */
074            @Indexable(type = IndexableType.REINDEX)
075            public AnnouncementsEntry addAnnouncementsEntry(
076                    AnnouncementsEntry announcementsEntry);
077    
078            public AnnouncementsEntry addEntry(long userId, long classNameId,
079                    long classPK, java.lang.String title, java.lang.String content,
080                    java.lang.String url, java.lang.String type, int displayDateMonth,
081                    int displayDateDay, int displayDateYear, int displayDateHour,
082                    int displayDateMinute, boolean displayImmediately,
083                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
084                    int expirationDateHour, int expirationDateMinute, int priority,
085                    boolean alert) throws PortalException;
086    
087            /**
088            * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
089            *
090            * @param entryId the primary key for the new announcements entry
091            * @return the new announcements entry
092            */
093            public AnnouncementsEntry createAnnouncementsEntry(long entryId);
094    
095            /**
096            * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
097            *
098            * @param announcementsEntry the announcements entry
099            * @return the announcements entry that was removed
100            */
101            @Indexable(type = IndexableType.DELETE)
102            public AnnouncementsEntry deleteAnnouncementsEntry(
103                    AnnouncementsEntry announcementsEntry);
104    
105            /**
106            * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
107            *
108            * @param entryId the primary key of the announcements entry
109            * @return the announcements entry that was removed
110            * @throws PortalException if a announcements entry with the primary key could not be found
111            */
112            @Indexable(type = IndexableType.DELETE)
113            public AnnouncementsEntry deleteAnnouncementsEntry(long entryId)
114                    throws PortalException;
115    
116            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
117            public AnnouncementsEntry fetchAnnouncementsEntry(long entryId);
118    
119            /**
120            * Returns the announcements entry with the matching UUID and company.
121            *
122            * @param uuid the announcements entry's UUID
123            * @param companyId the primary key of the company
124            * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
125            */
126            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127            public AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
128                    java.lang.String uuid, long companyId);
129    
130            /**
131            * Returns the announcements entry with the primary key.
132            *
133            * @param entryId the primary key of the announcements entry
134            * @return the announcements entry
135            * @throws PortalException if a announcements entry with the primary key could not be found
136            */
137            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138            public AnnouncementsEntry getAnnouncementsEntry(long entryId)
139                    throws PortalException;
140    
141            /**
142            * Returns the announcements entry with the matching UUID and company.
143            *
144            * @param uuid the announcements entry's UUID
145            * @param companyId the primary key of the company
146            * @return the matching announcements entry
147            * @throws PortalException if a matching announcements entry could not be found
148            */
149            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150            public AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
151                    java.lang.String uuid, long companyId) throws PortalException;
152    
153            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154            public AnnouncementsEntry getEntry(long entryId) throws PortalException;
155    
156            /**
157            * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
158            *
159            * @param announcementsEntry the announcements entry
160            * @return the announcements entry that was updated
161            */
162            @Indexable(type = IndexableType.REINDEX)
163            public AnnouncementsEntry updateAnnouncementsEntry(
164                    AnnouncementsEntry announcementsEntry);
165    
166            public AnnouncementsEntry updateEntry(long userId, long entryId,
167                    java.lang.String title, java.lang.String content, java.lang.String url,
168                    java.lang.String type, int displayDateMonth, int displayDateDay,
169                    int displayDateYear, int displayDateHour, int displayDateMinute,
170                    boolean displayImmediately, int expirationDateMonth,
171                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
172                    int expirationDateMinute, int priority) throws PortalException;
173    
174            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175            public ActionableDynamicQuery getActionableDynamicQuery();
176    
177            public DynamicQuery dynamicQuery();
178    
179            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
181                    PortletDataContext portletDataContext);
182    
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
185    
186            /**
187            * @throws PortalException
188            */
189            @Override
190            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
191                    throws PortalException;
192    
193            @Override
194            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
195            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
196                    throws PortalException;
197    
198            /**
199            * Returns the number of announcements entries.
200            *
201            * @return the number of announcements entries
202            */
203            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204            public int getAnnouncementsEntriesCount();
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public int getEntriesCount(long classNameId, long classPK, boolean alert);
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public int getEntriesCount(long userId,
211                    LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
212                    int flagValue);
213    
214            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215            public int getEntriesCount(long userId,
216                    LinkedHashMap<java.lang.Long, long[]> scopes, int displayDateMonth,
217                    int displayDateDay, int displayDateYear, int displayDateHour,
218                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
219                    int expirationDateYear, int expirationDateHour,
220                    int expirationDateMinute, boolean alert, int flagValue);
221    
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public int getEntriesCount(long userId, long classNameId, long[] classPKs,
224                    boolean alert, int flagValue);
225    
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public int getEntriesCount(long userId, long classNameId, long[] classPKs,
228                    int displayDateMonth, int displayDateDay, int displayDateYear,
229                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
230                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
231                    int expirationDateMinute, boolean alert, int flagValue);
232    
233            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234            public int getUserEntriesCount(long userId);
235    
236            /**
237            * Returns the OSGi service identifier.
238            *
239            * @return the OSGi service identifier
240            */
241            public java.lang.String getOSGiServiceIdentifier();
242    
243            /**
244            * Performs a dynamic query on the database and returns the matching rows.
245            *
246            * @param dynamicQuery the dynamic query
247            * @return the matching rows
248            */
249            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
250    
251            /**
252            * Performs a dynamic query on the database and returns a range of the matching rows.
253            *
254            * <p>
255            * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
256            * </p>
257            *
258            * @param dynamicQuery the dynamic query
259            * @param start the lower bound of the range of model instances
260            * @param end the upper bound of the range of model instances (not inclusive)
261            * @return the range of matching rows
262            */
263            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
264                    int end);
265    
266            /**
267            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
268            *
269            * <p>
270            * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
271            * </p>
272            *
273            * @param dynamicQuery the dynamic query
274            * @param start the lower bound of the range of model instances
275            * @param end the upper bound of the range of model instances (not inclusive)
276            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
277            * @return the ordered range of matching rows
278            */
279            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
280                    int end, OrderByComparator<T> orderByComparator);
281    
282            /**
283            * Returns a range of all the announcements entries.
284            *
285            * <p>
286            * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
287            * </p>
288            *
289            * @param start the lower bound of the range of announcements entries
290            * @param end the upper bound of the range of announcements entries (not inclusive)
291            * @return the range of announcements entries
292            */
293            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
294            public List<AnnouncementsEntry> getAnnouncementsEntries(int start, int end);
295    
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public List<AnnouncementsEntry> getEntries(long classNameId, long classPK,
298                    boolean alert, int start, int end);
299    
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public List<AnnouncementsEntry> getEntries(long userId,
302                    LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
303                    int flagValue, int start, int end);
304    
305            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
306            public List<AnnouncementsEntry> getEntries(long userId,
307                    LinkedHashMap<java.lang.Long, long[]> scopes, int displayDateMonth,
308                    int displayDateDay, int displayDateYear, int displayDateHour,
309                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
310                    int expirationDateYear, int expirationDateHour,
311                    int expirationDateMinute, boolean alert, int flagValue, int start,
312                    int end);
313    
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public List<AnnouncementsEntry> getEntries(long userId, long classNameId,
316                    long[] classPKs, int displayDateMonth, int displayDateDay,
317                    int displayDateYear, int displayDateHour, int displayDateMinute,
318                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
319                    int expirationDateHour, int expirationDateMinute, boolean alert,
320                    int flagValue, int start, int end);
321    
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public List<AnnouncementsEntry> getUserEntries(long userId, int start,
324                    int end);
325    
326            /**
327            * Returns the number of rows matching the dynamic query.
328            *
329            * @param dynamicQuery the dynamic query
330            * @return the number of rows matching the dynamic query
331            */
332            public long dynamicQueryCount(DynamicQuery dynamicQuery);
333    
334            /**
335            * Returns the number of rows matching the dynamic query.
336            *
337            * @param dynamicQuery the dynamic query
338            * @param projection the projection to apply to the query
339            * @return the number of rows matching the dynamic query
340            */
341            public long dynamicQueryCount(DynamicQuery dynamicQuery,
342                    Projection projection);
343    
344            public void checkEntries() throws PortalException;
345    
346            public void deleteEntry(AnnouncementsEntry entry) throws PortalException;
347    
348            public void deleteEntry(long entryId) throws PortalException;
349    }