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            public void checkEntries() throws PortalException;
088    
089            /**
090            * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
091            *
092            * @param entryId the primary key for the new announcements entry
093            * @return the new announcements entry
094            */
095            public AnnouncementsEntry createAnnouncementsEntry(long entryId);
096    
097            /**
098            * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
099            *
100            * @param announcementsEntry the announcements entry
101            * @return the announcements entry that was removed
102            */
103            @Indexable(type = IndexableType.DELETE)
104            public AnnouncementsEntry deleteAnnouncementsEntry(
105                    AnnouncementsEntry announcementsEntry);
106    
107            /**
108            * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
109            *
110            * @param entryId the primary key of the announcements entry
111            * @return the announcements entry that was removed
112            * @throws PortalException if a announcements entry with the primary key could not be found
113            */
114            @Indexable(type = IndexableType.DELETE)
115            public AnnouncementsEntry deleteAnnouncementsEntry(long entryId)
116                    throws PortalException;
117    
118            public void deleteEntry(AnnouncementsEntry entry) throws PortalException;
119    
120            public void deleteEntry(long entryId) throws PortalException;
121    
122            /**
123            * @throws PortalException
124            */
125            @Override
126            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
127                    throws PortalException;
128    
129            public DynamicQuery dynamicQuery();
130    
131            /**
132            * Performs a dynamic query on the database and returns the matching rows.
133            *
134            * @param dynamicQuery the dynamic query
135            * @return the matching rows
136            */
137            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
138    
139            /**
140            * Performs a dynamic query on the database and returns a range of the matching rows.
141            *
142            * <p>
143            * 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.
144            * </p>
145            *
146            * @param dynamicQuery the dynamic query
147            * @param start the lower bound of the range of model instances
148            * @param end the upper bound of the range of model instances (not inclusive)
149            * @return the range of matching rows
150            */
151            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
152                    int end);
153    
154            /**
155            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
156            *
157            * <p>
158            * 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.
159            * </p>
160            *
161            * @param dynamicQuery the dynamic query
162            * @param start the lower bound of the range of model instances
163            * @param end the upper bound of the range of model instances (not inclusive)
164            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
165            * @return the ordered range of matching rows
166            */
167            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
168                    int end, OrderByComparator<T> orderByComparator);
169    
170            /**
171            * Returns the number of rows matching the dynamic query.
172            *
173            * @param dynamicQuery the dynamic query
174            * @return the number of rows matching the dynamic query
175            */
176            public long dynamicQueryCount(DynamicQuery dynamicQuery);
177    
178            /**
179            * Returns the number of rows matching the dynamic query.
180            *
181            * @param dynamicQuery the dynamic query
182            * @param projection the projection to apply to the query
183            * @return the number of rows matching the dynamic query
184            */
185            public long dynamicQueryCount(DynamicQuery dynamicQuery,
186                    Projection projection);
187    
188            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189            public AnnouncementsEntry fetchAnnouncementsEntry(long entryId);
190    
191            /**
192            * Returns the announcements entry with the matching UUID and company.
193            *
194            * @param uuid the announcements entry's UUID
195            * @param companyId the primary key of the company
196            * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
197            */
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
200                    java.lang.String uuid, long companyId);
201    
202            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203            public ActionableDynamicQuery getActionableDynamicQuery();
204    
205            /**
206            * Returns a range of all the announcements entries.
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. 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.
210            * </p>
211            *
212            * @param start the lower bound of the range of announcements entries
213            * @param end the upper bound of the range of announcements entries (not inclusive)
214            * @return the range of announcements entries
215            */
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public List<AnnouncementsEntry> getAnnouncementsEntries(int start, int end);
218    
219            /**
220            * Returns the number of announcements entries.
221            *
222            * @return the number of announcements entries
223            */
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public int getAnnouncementsEntriesCount();
226    
227            /**
228            * Returns the announcements entry with the primary key.
229            *
230            * @param entryId the primary key of the announcements entry
231            * @return the announcements entry
232            * @throws PortalException if a announcements entry with the primary key could not be found
233            */
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public AnnouncementsEntry getAnnouncementsEntry(long entryId)
236                    throws PortalException;
237    
238            /**
239            * Returns the announcements entry with the matching UUID and company.
240            *
241            * @param uuid the announcements entry's UUID
242            * @param companyId the primary key of the company
243            * @return the matching announcements entry
244            * @throws PortalException if a matching announcements entry could not be found
245            */
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
248                    java.lang.String uuid, long companyId) throws PortalException;
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public List<AnnouncementsEntry> getEntries(long classNameId, long classPK,
252                    boolean alert, int start, int end);
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public List<AnnouncementsEntry> getEntries(long userId, long classNameId,
256                    long[] classPKs, int displayDateMonth, int displayDateDay,
257                    int displayDateYear, int displayDateHour, int displayDateMinute,
258                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
259                    int expirationDateHour, int expirationDateMinute, boolean alert,
260                    int flagValue, int start, int end);
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<AnnouncementsEntry> getEntries(long userId,
264                    LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
265                    int flagValue, int start, int end);
266    
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public List<AnnouncementsEntry> getEntries(long userId,
269                    LinkedHashMap<java.lang.Long, long[]> scopes, int displayDateMonth,
270                    int displayDateDay, int displayDateYear, int displayDateHour,
271                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
272                    int expirationDateYear, int expirationDateHour,
273                    int expirationDateMinute, boolean alert, int flagValue, int start,
274                    int end);
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public int getEntriesCount(long classNameId, long classPK, boolean alert);
278    
279            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280            public int getEntriesCount(long userId, long classNameId, long[] classPKs,
281                    boolean alert, int flagValue);
282    
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public int getEntriesCount(long userId, long classNameId, long[] classPKs,
285                    int displayDateMonth, int displayDateDay, int displayDateYear,
286                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
287                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
288                    int expirationDateMinute, boolean alert, int flagValue);
289    
290            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
291            public int getEntriesCount(long userId,
292                    LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
293                    int flagValue);
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public int getEntriesCount(long userId,
297                    LinkedHashMap<java.lang.Long, long[]> scopes, int displayDateMonth,
298                    int displayDateDay, int displayDateYear, int displayDateHour,
299                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
300                    int expirationDateYear, int expirationDateHour,
301                    int expirationDateMinute, boolean alert, int flagValue);
302    
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public AnnouncementsEntry getEntry(long entryId) throws PortalException;
305    
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
308                    PortletDataContext portletDataContext);
309    
310            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
312    
313            /**
314            * Returns the OSGi service identifier.
315            *
316            * @return the OSGi service identifier
317            */
318            public java.lang.String getOSGiServiceIdentifier();
319    
320            @Override
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
323                    throws PortalException;
324    
325            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326            public List<AnnouncementsEntry> getUserEntries(long userId, int start,
327                    int end);
328    
329            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330            public int getUserEntriesCount(long userId);
331    
332            /**
333            * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
334            *
335            * @param announcementsEntry the announcements entry
336            * @return the announcements entry that was updated
337            */
338            @Indexable(type = IndexableType.REINDEX)
339            public AnnouncementsEntry updateAnnouncementsEntry(
340                    AnnouncementsEntry announcementsEntry);
341    
342            public AnnouncementsEntry updateEntry(long userId, long entryId,
343                    java.lang.String title, java.lang.String content, java.lang.String url,
344                    java.lang.String type, int displayDateMonth, int displayDateDay,
345                    int displayDateYear, int displayDateHour, int displayDateMinute,
346                    boolean displayImmediately, int expirationDateMonth,
347                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
348                    int expirationDateMinute, int priority) throws PortalException;
349    }