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.announcements.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.portlet.announcements.model.AnnouncementsEntry addAnnouncementsEntry(
051                    com.liferay.portlet.announcements.model.AnnouncementsEntry announcementsEntry) {
052                    return getService().addAnnouncementsEntry(announcementsEntry);
053            }
054    
055            public static com.liferay.portlet.announcements.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            /**
073            * @deprecated As of 6.2.0, replaced by {@link #addEntry(long, long, long,
074            String, String, String, String, int, int, int, int, int,
075            boolean, int, int, int, int, int, int, boolean)}
076            */
077            @Deprecated
078            public static com.liferay.portlet.announcements.model.AnnouncementsEntry addEntry(
079                    long userId, long classNameId, long classPK, java.lang.String title,
080                    java.lang.String content, java.lang.String url, java.lang.String type,
081                    int displayDateMonth, int displayDateDay, int displayDateYear,
082                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
083                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
084                    int expirationDateMinute, int priority, boolean alert)
085                    throws com.liferay.portal.kernel.exception.PortalException {
086                    return getService()
087                                       .addEntry(userId, classNameId, classPK, title, content, url,
088                            type, displayDateMonth, displayDateDay, displayDateYear,
089                            displayDateHour, displayDateMinute, expirationDateMonth,
090                            expirationDateDay, expirationDateYear, expirationDateHour,
091                            expirationDateMinute, priority, alert);
092            }
093    
094            public static void checkEntries()
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    getService().checkEntries();
097            }
098    
099            /**
100            * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
101            *
102            * @param entryId the primary key for the new announcements entry
103            * @return the new announcements entry
104            */
105            public static com.liferay.portlet.announcements.model.AnnouncementsEntry createAnnouncementsEntry(
106                    long entryId) {
107                    return getService().createAnnouncementsEntry(entryId);
108            }
109    
110            /**
111            * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
112            *
113            * @param announcementsEntry the announcements entry
114            * @return the announcements entry that was removed
115            */
116            public static com.liferay.portlet.announcements.model.AnnouncementsEntry deleteAnnouncementsEntry(
117                    com.liferay.portlet.announcements.model.AnnouncementsEntry announcementsEntry) {
118                    return getService().deleteAnnouncementsEntry(announcementsEntry);
119            }
120    
121            /**
122            * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
123            *
124            * @param entryId the primary key of the announcements entry
125            * @return the announcements entry that was removed
126            * @throws PortalException if a announcements entry with the primary key could not be found
127            */
128            public static com.liferay.portlet.announcements.model.AnnouncementsEntry deleteAnnouncementsEntry(
129                    long entryId)
130                    throws com.liferay.portal.kernel.exception.PortalException {
131                    return getService().deleteAnnouncementsEntry(entryId);
132            }
133    
134            public static void deleteEntry(
135                    com.liferay.portlet.announcements.model.AnnouncementsEntry entry)
136                    throws com.liferay.portal.kernel.exception.PortalException {
137                    getService().deleteEntry(entry);
138            }
139    
140            public static void deleteEntry(long entryId)
141                    throws com.liferay.portal.kernel.exception.PortalException {
142                    getService().deleteEntry(entryId);
143            }
144    
145            /**
146            * @throws PortalException
147            */
148            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
149                    com.liferay.portal.model.PersistedModel persistedModel)
150                    throws com.liferay.portal.kernel.exception.PortalException {
151                    return getService().deletePersistedModel(persistedModel);
152            }
153    
154            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
155                    return getService().dynamicQuery();
156            }
157    
158            /**
159            * Performs a dynamic query on the database and returns the matching rows.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the matching rows
163            */
164            public static <T> java.util.List<T> dynamicQuery(
165                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
166                    return getService().dynamicQuery(dynamicQuery);
167            }
168    
169            /**
170            * Performs a dynamic query on the database and returns a range of the matching rows.
171            *
172            * <p>
173            * 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.
174            * </p>
175            *
176            * @param dynamicQuery the dynamic query
177            * @param start the lower bound of the range of model instances
178            * @param end the upper bound of the range of model instances (not inclusive)
179            * @return the range of matching rows
180            */
181            public static <T> java.util.List<T> dynamicQuery(
182                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
183                    int end) {
184                    return getService().dynamicQuery(dynamicQuery, start, end);
185            }
186    
187            /**
188            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
189            *
190            * <p>
191            * 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.
192            * </p>
193            *
194            * @param dynamicQuery the dynamic query
195            * @param start the lower bound of the range of model instances
196            * @param end the upper bound of the range of model instances (not inclusive)
197            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
198            * @return the ordered range of matching rows
199            */
200            public static <T> java.util.List<T> dynamicQuery(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
202                    int end,
203                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
204                    return getService()
205                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
206            }
207    
208            /**
209            * Returns the number of rows matching the dynamic query.
210            *
211            * @param dynamicQuery the dynamic query
212            * @return the number of rows matching the dynamic query
213            */
214            public static long dynamicQueryCount(
215                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
216                    return getService().dynamicQueryCount(dynamicQuery);
217            }
218    
219            /**
220            * Returns the number of rows matching the dynamic query.
221            *
222            * @param dynamicQuery the dynamic query
223            * @param projection the projection to apply to the query
224            * @return the number of rows matching the dynamic query
225            */
226            public static long dynamicQueryCount(
227                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
228                    com.liferay.portal.kernel.dao.orm.Projection projection) {
229                    return getService().dynamicQueryCount(dynamicQuery, projection);
230            }
231    
232            public static com.liferay.portlet.announcements.model.AnnouncementsEntry fetchAnnouncementsEntry(
233                    long entryId) {
234                    return getService().fetchAnnouncementsEntry(entryId);
235            }
236    
237            /**
238            * Returns the announcements entry with the matching UUID and company.
239            *
240            * @param uuid the announcements entry's UUID
241            * @param companyId the primary key of the company
242            * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
243            */
244            public static com.liferay.portlet.announcements.model.AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
245                    java.lang.String uuid, long companyId) {
246                    return getService()
247                                       .fetchAnnouncementsEntryByUuidAndCompanyId(uuid, companyId);
248            }
249    
250            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
251                    return getService().getActionableDynamicQuery();
252            }
253    
254            /**
255            * Returns a range of all the announcements entries.
256            *
257            * <p>
258            * 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.
259            * </p>
260            *
261            * @param start the lower bound of the range of announcements entries
262            * @param end the upper bound of the range of announcements entries (not inclusive)
263            * @return the range of announcements entries
264            */
265            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getAnnouncementsEntries(
266                    int start, int end) {
267                    return getService().getAnnouncementsEntries(start, end);
268            }
269    
270            /**
271            * Returns the number of announcements entries.
272            *
273            * @return the number of announcements entries
274            */
275            public static int getAnnouncementsEntriesCount() {
276                    return getService().getAnnouncementsEntriesCount();
277            }
278    
279            /**
280            * Returns the announcements entry with the primary key.
281            *
282            * @param entryId the primary key of the announcements entry
283            * @return the announcements entry
284            * @throws PortalException if a announcements entry with the primary key could not be found
285            */
286            public static com.liferay.portlet.announcements.model.AnnouncementsEntry getAnnouncementsEntry(
287                    long entryId)
288                    throws com.liferay.portal.kernel.exception.PortalException {
289                    return getService().getAnnouncementsEntry(entryId);
290            }
291    
292            /**
293            * Returns the announcements entry with the matching UUID and company.
294            *
295            * @param uuid the announcements entry's UUID
296            * @param companyId the primary key of the company
297            * @return the matching announcements entry
298            * @throws PortalException if a matching announcements entry could not be found
299            */
300            public static com.liferay.portlet.announcements.model.AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
301                    java.lang.String uuid, long companyId)
302                    throws com.liferay.portal.kernel.exception.PortalException {
303                    return getService()
304                                       .getAnnouncementsEntryByUuidAndCompanyId(uuid, companyId);
305            }
306    
307            /**
308            * Returns the Spring bean ID for this bean.
309            *
310            * @return the Spring bean ID for this bean
311            */
312            public static java.lang.String getBeanIdentifier() {
313                    return getService().getBeanIdentifier();
314            }
315    
316            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
317                    long classNameId, long classPK, boolean alert, int start, int end) {
318                    return getService().getEntries(classNameId, classPK, alert, start, end);
319            }
320    
321            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
322                    long userId, long classNameId, long[] classPKs, int displayDateMonth,
323                    int displayDateDay, int displayDateYear, int displayDateHour,
324                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
325                    int expirationDateYear, int expirationDateHour,
326                    int expirationDateMinute, boolean alert, int flagValue, int start,
327                    int end) {
328                    return getService()
329                                       .getEntries(userId, classNameId, classPKs, displayDateMonth,
330                            displayDateDay, displayDateYear, displayDateHour,
331                            displayDateMinute, expirationDateMonth, expirationDateDay,
332                            expirationDateYear, expirationDateHour, expirationDateMinute,
333                            alert, flagValue, start, end);
334            }
335    
336            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
337                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
338                    boolean alert, int flagValue, int start, int end) {
339                    return getService()
340                                       .getEntries(userId, scopes, alert, flagValue, start, end);
341            }
342    
343            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
344                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
345                    int displayDateMonth, int displayDateDay, int displayDateYear,
346                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
347                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
348                    int expirationDateMinute, boolean alert, int flagValue, int start,
349                    int end) {
350                    return getService()
351                                       .getEntries(userId, scopes, displayDateMonth,
352                            displayDateDay, displayDateYear, displayDateHour,
353                            displayDateMinute, expirationDateMonth, expirationDateDay,
354                            expirationDateYear, expirationDateHour, expirationDateMinute,
355                            alert, flagValue, start, end);
356            }
357    
358            public static int getEntriesCount(long classNameId, long classPK,
359                    boolean alert) {
360                    return getService().getEntriesCount(classNameId, classPK, alert);
361            }
362    
363            public static int getEntriesCount(long userId, long classNameId,
364                    long[] classPKs, boolean alert, int flagValue) {
365                    return getService()
366                                       .getEntriesCount(userId, classNameId, classPKs, alert,
367                            flagValue);
368            }
369    
370            public static int getEntriesCount(long userId, long classNameId,
371                    long[] classPKs, int displayDateMonth, int displayDateDay,
372                    int displayDateYear, int displayDateHour, int displayDateMinute,
373                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
374                    int expirationDateHour, int expirationDateMinute, boolean alert,
375                    int flagValue) {
376                    return getService()
377                                       .getEntriesCount(userId, classNameId, classPKs,
378                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
379                            displayDateMinute, expirationDateMonth, expirationDateDay,
380                            expirationDateYear, expirationDateHour, expirationDateMinute,
381                            alert, flagValue);
382            }
383    
384            public static int getEntriesCount(long userId,
385                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
386                    int flagValue) {
387                    return getService().getEntriesCount(userId, scopes, alert, flagValue);
388            }
389    
390            public static int getEntriesCount(long userId,
391                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
392                    int displayDateMonth, int displayDateDay, int displayDateYear,
393                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
394                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
395                    int expirationDateMinute, boolean alert, int flagValue) {
396                    return getService()
397                                       .getEntriesCount(userId, scopes, displayDateMonth,
398                            displayDateDay, displayDateYear, displayDateHour,
399                            displayDateMinute, expirationDateMonth, expirationDateDay,
400                            expirationDateYear, expirationDateHour, expirationDateMinute,
401                            alert, flagValue);
402            }
403    
404            public static com.liferay.portlet.announcements.model.AnnouncementsEntry getEntry(
405                    long entryId)
406                    throws com.liferay.portal.kernel.exception.PortalException {
407                    return getService().getEntry(entryId);
408            }
409    
410            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
411                    com.liferay.portal.kernel.lar.PortletDataContext portletDataContext) {
412                    return getService().getExportActionableDynamicQuery(portletDataContext);
413            }
414    
415            public static com.liferay.portal.model.PersistedModel getPersistedModel(
416                    java.io.Serializable primaryKeyObj)
417                    throws com.liferay.portal.kernel.exception.PortalException {
418                    return getService().getPersistedModel(primaryKeyObj);
419            }
420    
421            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getUserEntries(
422                    long userId, int start, int end) {
423                    return getService().getUserEntries(userId, start, end);
424            }
425    
426            public static int getUserEntriesCount(long userId) {
427                    return getService().getUserEntriesCount(userId);
428            }
429    
430            /**
431            * Sets the Spring bean ID for this bean.
432            *
433            * @param beanIdentifier the Spring bean ID for this bean
434            */
435            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
436                    getService().setBeanIdentifier(beanIdentifier);
437            }
438    
439            /**
440            * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
441            *
442            * @param announcementsEntry the announcements entry
443            * @return the announcements entry that was updated
444            */
445            public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateAnnouncementsEntry(
446                    com.liferay.portlet.announcements.model.AnnouncementsEntry announcementsEntry) {
447                    return getService().updateAnnouncementsEntry(announcementsEntry);
448            }
449    
450            public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
451                    long userId, long entryId, java.lang.String title,
452                    java.lang.String content, java.lang.String url, java.lang.String type,
453                    int displayDateMonth, int displayDateDay, int displayDateYear,
454                    int displayDateHour, int displayDateMinute, boolean displayImmediately,
455                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
456                    int expirationDateHour, int expirationDateMinute, int priority)
457                    throws com.liferay.portal.kernel.exception.PortalException {
458                    return getService()
459                                       .updateEntry(userId, entryId, title, content, url, type,
460                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
461                            displayDateMinute, displayImmediately, expirationDateMonth,
462                            expirationDateDay, expirationDateYear, expirationDateHour,
463                            expirationDateMinute, priority);
464            }
465    
466            public static AnnouncementsEntryLocalService getService() {
467                    if (_service == null) {
468                            _service = (AnnouncementsEntryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsEntryLocalService.class.getName());
469    
470                            ReferenceRegistry.registerReference(AnnouncementsEntryLocalServiceUtil.class,
471                                    "_service");
472                    }
473    
474                    return _service;
475            }
476    
477            /**
478             * @deprecated As of 6.2.0
479             */
480            @Deprecated
481            public void setService(AnnouncementsEntryLocalService service) {
482            }
483    
484            private static AnnouncementsEntryLocalService _service;
485    }