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.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for AnnouncementsEntry. This utility wraps
024     * {@link com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see AnnouncementsEntryLocalService
032     * @see com.liferay.portlet.announcements.service.base.AnnouncementsEntryLocalServiceBaseImpl
033     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class AnnouncementsEntryLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the announcements entry to the database. Also notifies the appropriate model listeners.
046            *
047            * @param announcementsEntry the announcements entry
048            * @return the announcements entry that was added
049            */
050            public static com.liferay.announcements.kernel.model.AnnouncementsEntry addAnnouncementsEntry(
051                    com.liferay.announcements.kernel.model.AnnouncementsEntry announcementsEntry) {
052                    return getService().addAnnouncementsEntry(announcementsEntry);
053            }
054    
055            public static com.liferay.announcements.kernel.model.AnnouncementsEntry addEntry(
056                    long userId, long classNameId, long classPK, java.lang.String title,
057                    java.lang.String content, java.lang.String url, java.lang.String type,
058                    int displayDateMonth, int displayDateDay, int displayDateYear,
059                    int displayDateHour, int displayDateMinute, boolean displayImmediately,
060                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
061                    int expirationDateHour, int expirationDateMinute, int priority,
062                    boolean alert)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    return getService()
065                                       .addEntry(userId, classNameId, classPK, title, content, url,
066                            type, displayDateMonth, displayDateDay, displayDateYear,
067                            displayDateHour, displayDateMinute, displayImmediately,
068                            expirationDateMonth, expirationDateDay, expirationDateYear,
069                            expirationDateHour, expirationDateMinute, priority, alert);
070            }
071    
072            public static void checkEntries()
073                    throws com.liferay.portal.kernel.exception.PortalException {
074                    getService().checkEntries();
075            }
076    
077            /**
078            * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
079            *
080            * @param entryId the primary key for the new announcements entry
081            * @return the new announcements entry
082            */
083            public static com.liferay.announcements.kernel.model.AnnouncementsEntry createAnnouncementsEntry(
084                    long entryId) {
085                    return getService().createAnnouncementsEntry(entryId);
086            }
087    
088            /**
089            * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
090            *
091            * @param announcementsEntry the announcements entry
092            * @return the announcements entry that was removed
093            */
094            public static com.liferay.announcements.kernel.model.AnnouncementsEntry deleteAnnouncementsEntry(
095                    com.liferay.announcements.kernel.model.AnnouncementsEntry announcementsEntry) {
096                    return getService().deleteAnnouncementsEntry(announcementsEntry);
097            }
098    
099            /**
100            * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
101            *
102            * @param entryId the primary key of the announcements entry
103            * @return the announcements entry that was removed
104            * @throws PortalException if a announcements entry with the primary key could not be found
105            */
106            public static com.liferay.announcements.kernel.model.AnnouncementsEntry deleteAnnouncementsEntry(
107                    long entryId)
108                    throws com.liferay.portal.kernel.exception.PortalException {
109                    return getService().deleteAnnouncementsEntry(entryId);
110            }
111    
112            public static void deleteEntry(
113                    com.liferay.announcements.kernel.model.AnnouncementsEntry entry)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    getService().deleteEntry(entry);
116            }
117    
118            public static void deleteEntry(long entryId)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    getService().deleteEntry(entryId);
121            }
122    
123            /**
124            * @throws PortalException
125            */
126            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
127                    com.liferay.portal.model.PersistedModel persistedModel)
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    return getService().deletePersistedModel(persistedModel);
130            }
131    
132            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
133                    return getService().dynamicQuery();
134            }
135    
136            /**
137            * Performs a dynamic query on the database and returns the matching rows.
138            *
139            * @param dynamicQuery the dynamic query
140            * @return the matching rows
141            */
142            public static <T> java.util.List<T> dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
144                    return getService().dynamicQuery(dynamicQuery);
145            }
146    
147            /**
148            * Performs a dynamic query on the database and returns a range of the matching rows.
149            *
150            * <p>
151            * 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.
152            * </p>
153            *
154            * @param dynamicQuery the dynamic query
155            * @param start the lower bound of the range of model instances
156            * @param end the upper bound of the range of model instances (not inclusive)
157            * @return the range of matching rows
158            */
159            public static <T> java.util.List<T> dynamicQuery(
160                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
161                    int end) {
162                    return getService().dynamicQuery(dynamicQuery, start, end);
163            }
164    
165            /**
166            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
167            *
168            * <p>
169            * 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.
170            * </p>
171            *
172            * @param dynamicQuery the dynamic query
173            * @param start the lower bound of the range of model instances
174            * @param end the upper bound of the range of model instances (not inclusive)
175            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
176            * @return the ordered range of matching rows
177            */
178            public static <T> java.util.List<T> dynamicQuery(
179                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
180                    int end,
181                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
182                    return getService()
183                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
184            }
185    
186            /**
187            * Returns the number of rows matching the dynamic query.
188            *
189            * @param dynamicQuery the dynamic query
190            * @return the number of rows matching the dynamic query
191            */
192            public static long dynamicQueryCount(
193                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
194                    return getService().dynamicQueryCount(dynamicQuery);
195            }
196    
197            /**
198            * Returns the number of rows matching the dynamic query.
199            *
200            * @param dynamicQuery the dynamic query
201            * @param projection the projection to apply to the query
202            * @return the number of rows matching the dynamic query
203            */
204            public static long dynamicQueryCount(
205                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
206                    com.liferay.portal.kernel.dao.orm.Projection projection) {
207                    return getService().dynamicQueryCount(dynamicQuery, projection);
208            }
209    
210            public static com.liferay.announcements.kernel.model.AnnouncementsEntry fetchAnnouncementsEntry(
211                    long entryId) {
212                    return getService().fetchAnnouncementsEntry(entryId);
213            }
214    
215            /**
216            * Returns the announcements entry with the matching UUID and company.
217            *
218            * @param uuid the announcements entry's UUID
219            * @param companyId the primary key of the company
220            * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
221            */
222            public static com.liferay.announcements.kernel.model.AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
223                    java.lang.String uuid, long companyId) {
224                    return getService()
225                                       .fetchAnnouncementsEntryByUuidAndCompanyId(uuid, companyId);
226            }
227    
228            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
229                    return getService().getActionableDynamicQuery();
230            }
231    
232            /**
233            * Returns a range of all the announcements entries.
234            *
235            * <p>
236            * 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.
237            * </p>
238            *
239            * @param start the lower bound of the range of announcements entries
240            * @param end the upper bound of the range of announcements entries (not inclusive)
241            * @return the range of announcements entries
242            */
243            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getAnnouncementsEntries(
244                    int start, int end) {
245                    return getService().getAnnouncementsEntries(start, end);
246            }
247    
248            /**
249            * Returns the number of announcements entries.
250            *
251            * @return the number of announcements entries
252            */
253            public static int getAnnouncementsEntriesCount() {
254                    return getService().getAnnouncementsEntriesCount();
255            }
256    
257            /**
258            * Returns the announcements entry with the primary key.
259            *
260            * @param entryId the primary key of the announcements entry
261            * @return the announcements entry
262            * @throws PortalException if a announcements entry with the primary key could not be found
263            */
264            public static com.liferay.announcements.kernel.model.AnnouncementsEntry getAnnouncementsEntry(
265                    long entryId)
266                    throws com.liferay.portal.kernel.exception.PortalException {
267                    return getService().getAnnouncementsEntry(entryId);
268            }
269    
270            /**
271            * Returns the announcements entry with the matching UUID and company.
272            *
273            * @param uuid the announcements entry's UUID
274            * @param companyId the primary key of the company
275            * @return the matching announcements entry
276            * @throws PortalException if a matching announcements entry could not be found
277            */
278            public static com.liferay.announcements.kernel.model.AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
279                    java.lang.String uuid, long companyId)
280                    throws com.liferay.portal.kernel.exception.PortalException {
281                    return getService()
282                                       .getAnnouncementsEntryByUuidAndCompanyId(uuid, companyId);
283            }
284    
285            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getEntries(
286                    long classNameId, long classPK, boolean alert, int start, int end) {
287                    return getService().getEntries(classNameId, classPK, alert, start, end);
288            }
289    
290            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getEntries(
291                    long userId, long classNameId, long[] classPKs, int displayDateMonth,
292                    int displayDateDay, int displayDateYear, int displayDateHour,
293                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
294                    int expirationDateYear, int expirationDateHour,
295                    int expirationDateMinute, boolean alert, int flagValue, int start,
296                    int end) {
297                    return getService()
298                                       .getEntries(userId, classNameId, classPKs, displayDateMonth,
299                            displayDateDay, displayDateYear, displayDateHour,
300                            displayDateMinute, expirationDateMonth, expirationDateDay,
301                            expirationDateYear, expirationDateHour, expirationDateMinute,
302                            alert, flagValue, start, end);
303            }
304    
305            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getEntries(
306                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
307                    boolean alert, int flagValue, int start, int end) {
308                    return getService()
309                                       .getEntries(userId, scopes, alert, flagValue, start, end);
310            }
311    
312            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getEntries(
313                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
314                    int displayDateMonth, int displayDateDay, int displayDateYear,
315                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
316                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
317                    int expirationDateMinute, boolean alert, int flagValue, int start,
318                    int end) {
319                    return getService()
320                                       .getEntries(userId, scopes, displayDateMonth,
321                            displayDateDay, displayDateYear, displayDateHour,
322                            displayDateMinute, expirationDateMonth, expirationDateDay,
323                            expirationDateYear, expirationDateHour, expirationDateMinute,
324                            alert, flagValue, start, end);
325            }
326    
327            public static int getEntriesCount(long classNameId, long classPK,
328                    boolean alert) {
329                    return getService().getEntriesCount(classNameId, classPK, alert);
330            }
331    
332            public static int getEntriesCount(long userId, long classNameId,
333                    long[] classPKs, boolean alert, int flagValue) {
334                    return getService()
335                                       .getEntriesCount(userId, classNameId, classPKs, alert,
336                            flagValue);
337            }
338    
339            public static int getEntriesCount(long userId, long classNameId,
340                    long[] classPKs, int displayDateMonth, int displayDateDay,
341                    int displayDateYear, int displayDateHour, int displayDateMinute,
342                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
343                    int expirationDateHour, int expirationDateMinute, boolean alert,
344                    int flagValue) {
345                    return getService()
346                                       .getEntriesCount(userId, classNameId, classPKs,
347                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
348                            displayDateMinute, expirationDateMonth, expirationDateDay,
349                            expirationDateYear, expirationDateHour, expirationDateMinute,
350                            alert, flagValue);
351            }
352    
353            public static int getEntriesCount(long userId,
354                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
355                    int flagValue) {
356                    return getService().getEntriesCount(userId, scopes, alert, flagValue);
357            }
358    
359            public static int getEntriesCount(long userId,
360                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
361                    int displayDateMonth, int displayDateDay, int displayDateYear,
362                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
363                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
364                    int expirationDateMinute, boolean alert, int flagValue) {
365                    return getService()
366                                       .getEntriesCount(userId, scopes, displayDateMonth,
367                            displayDateDay, displayDateYear, displayDateHour,
368                            displayDateMinute, expirationDateMonth, expirationDateDay,
369                            expirationDateYear, expirationDateHour, expirationDateMinute,
370                            alert, flagValue);
371            }
372    
373            public static com.liferay.announcements.kernel.model.AnnouncementsEntry getEntry(
374                    long entryId)
375                    throws com.liferay.portal.kernel.exception.PortalException {
376                    return getService().getEntry(entryId);
377            }
378    
379            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
380                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
381                    return getService().getExportActionableDynamicQuery(portletDataContext);
382            }
383    
384            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
385                    return getService().getIndexableActionableDynamicQuery();
386            }
387    
388            /**
389            * Returns the OSGi service identifier.
390            *
391            * @return the OSGi service identifier
392            */
393            public static java.lang.String getOSGiServiceIdentifier() {
394                    return getService().getOSGiServiceIdentifier();
395            }
396    
397            public static com.liferay.portal.model.PersistedModel getPersistedModel(
398                    java.io.Serializable primaryKeyObj)
399                    throws com.liferay.portal.kernel.exception.PortalException {
400                    return getService().getPersistedModel(primaryKeyObj);
401            }
402    
403            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsEntry> getUserEntries(
404                    long userId, int start, int end) {
405                    return getService().getUserEntries(userId, start, end);
406            }
407    
408            public static int getUserEntriesCount(long userId) {
409                    return getService().getUserEntriesCount(userId);
410            }
411    
412            /**
413            * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
414            *
415            * @param announcementsEntry the announcements entry
416            * @return the announcements entry that was updated
417            */
418            public static com.liferay.announcements.kernel.model.AnnouncementsEntry updateAnnouncementsEntry(
419                    com.liferay.announcements.kernel.model.AnnouncementsEntry announcementsEntry) {
420                    return getService().updateAnnouncementsEntry(announcementsEntry);
421            }
422    
423            public static com.liferay.announcements.kernel.model.AnnouncementsEntry updateEntry(
424                    long userId, long entryId, java.lang.String title,
425                    java.lang.String content, java.lang.String url, java.lang.String type,
426                    int displayDateMonth, int displayDateDay, int displayDateYear,
427                    int displayDateHour, int displayDateMinute, boolean displayImmediately,
428                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
429                    int expirationDateHour, int expirationDateMinute, int priority)
430                    throws com.liferay.portal.kernel.exception.PortalException {
431                    return getService()
432                                       .updateEntry(userId, entryId, title, content, url, type,
433                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
434                            displayDateMinute, displayImmediately, expirationDateMonth,
435                            expirationDateDay, expirationDateYear, expirationDateHour,
436                            expirationDateMinute, priority);
437            }
438    
439            public static AnnouncementsEntryLocalService getService() {
440                    if (_service == null) {
441                            _service = (AnnouncementsEntryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsEntryLocalService.class.getName());
442    
443                            ReferenceRegistry.registerReference(AnnouncementsEntryLocalServiceUtil.class,
444                                    "_service");
445                    }
446    
447                    return _service;
448            }
449    
450            private static AnnouncementsEntryLocalService _service;
451    }