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            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
308                    long classNameId, long classPK, boolean alert, int start, int end) {
309                    return getService().getEntries(classNameId, classPK, alert, start, end);
310            }
311    
312            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
313                    long userId, long classNameId, long[] classPKs, int displayDateMonth,
314                    int displayDateDay, int displayDateYear, int displayDateHour,
315                    int displayDateMinute, int expirationDateMonth, int expirationDateDay,
316                    int expirationDateYear, int expirationDateHour,
317                    int expirationDateMinute, boolean alert, int flagValue, int start,
318                    int end) {
319                    return getService()
320                                       .getEntries(userId, classNameId, classPKs, displayDateMonth,
321                            displayDateDay, displayDateYear, displayDateHour,
322                            displayDateMinute, expirationDateMonth, expirationDateDay,
323                            expirationDateYear, expirationDateHour, expirationDateMinute,
324                            alert, flagValue, start, end);
325            }
326    
327            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
328                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
329                    boolean alert, int flagValue, int start, int end) {
330                    return getService()
331                                       .getEntries(userId, scopes, alert, flagValue, start, end);
332            }
333    
334            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getEntries(
335                    long userId, java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
336                    int displayDateMonth, int displayDateDay, int displayDateYear,
337                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
338                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
339                    int expirationDateMinute, boolean alert, int flagValue, int start,
340                    int end) {
341                    return getService()
342                                       .getEntries(userId, scopes, displayDateMonth,
343                            displayDateDay, displayDateYear, displayDateHour,
344                            displayDateMinute, expirationDateMonth, expirationDateDay,
345                            expirationDateYear, expirationDateHour, expirationDateMinute,
346                            alert, flagValue, start, end);
347            }
348    
349            public static int getEntriesCount(long classNameId, long classPK,
350                    boolean alert) {
351                    return getService().getEntriesCount(classNameId, classPK, alert);
352            }
353    
354            public static int getEntriesCount(long userId, long classNameId,
355                    long[] classPKs, boolean alert, int flagValue) {
356                    return getService()
357                                       .getEntriesCount(userId, classNameId, classPKs, alert,
358                            flagValue);
359            }
360    
361            public static int getEntriesCount(long userId, long classNameId,
362                    long[] classPKs, int displayDateMonth, int displayDateDay,
363                    int displayDateYear, int displayDateHour, int displayDateMinute,
364                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
365                    int expirationDateHour, int expirationDateMinute, boolean alert,
366                    int flagValue) {
367                    return getService()
368                                       .getEntriesCount(userId, classNameId, classPKs,
369                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
370                            displayDateMinute, expirationDateMonth, expirationDateDay,
371                            expirationDateYear, expirationDateHour, expirationDateMinute,
372                            alert, flagValue);
373            }
374    
375            public static int getEntriesCount(long userId,
376                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes, boolean alert,
377                    int flagValue) {
378                    return getService().getEntriesCount(userId, scopes, alert, flagValue);
379            }
380    
381            public static int getEntriesCount(long userId,
382                    java.util.LinkedHashMap<java.lang.Long, long[]> scopes,
383                    int displayDateMonth, int displayDateDay, int displayDateYear,
384                    int displayDateHour, int displayDateMinute, int expirationDateMonth,
385                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
386                    int expirationDateMinute, boolean alert, int flagValue) {
387                    return getService()
388                                       .getEntriesCount(userId, scopes, displayDateMonth,
389                            displayDateDay, displayDateYear, displayDateHour,
390                            displayDateMinute, expirationDateMonth, expirationDateDay,
391                            expirationDateYear, expirationDateHour, expirationDateMinute,
392                            alert, flagValue);
393            }
394    
395            public static com.liferay.portlet.announcements.model.AnnouncementsEntry getEntry(
396                    long entryId)
397                    throws com.liferay.portal.kernel.exception.PortalException {
398                    return getService().getEntry(entryId);
399            }
400    
401            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
402                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
403                    return getService().getExportActionableDynamicQuery(portletDataContext);
404            }
405    
406            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
407                    return getService().getIndexableActionableDynamicQuery();
408            }
409    
410            /**
411            * Returns the OSGi service identifier.
412            *
413            * @return the OSGi service identifier
414            */
415            public static java.lang.String getOSGiServiceIdentifier() {
416                    return getService().getOSGiServiceIdentifier();
417            }
418    
419            public static com.liferay.portal.model.PersistedModel getPersistedModel(
420                    java.io.Serializable primaryKeyObj)
421                    throws com.liferay.portal.kernel.exception.PortalException {
422                    return getService().getPersistedModel(primaryKeyObj);
423            }
424    
425            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsEntry> getUserEntries(
426                    long userId, int start, int end) {
427                    return getService().getUserEntries(userId, start, end);
428            }
429    
430            public static int getUserEntriesCount(long userId) {
431                    return getService().getUserEntriesCount(userId);
432            }
433    
434            /**
435            * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
436            *
437            * @param announcementsEntry the announcements entry
438            * @return the announcements entry that was updated
439            */
440            public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateAnnouncementsEntry(
441                    com.liferay.portlet.announcements.model.AnnouncementsEntry announcementsEntry) {
442                    return getService().updateAnnouncementsEntry(announcementsEntry);
443            }
444    
445            public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
446                    long userId, long entryId, java.lang.String title,
447                    java.lang.String content, java.lang.String url, java.lang.String type,
448                    int displayDateMonth, int displayDateDay, int displayDateYear,
449                    int displayDateHour, int displayDateMinute, boolean displayImmediately,
450                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
451                    int expirationDateHour, int expirationDateMinute, int priority)
452                    throws com.liferay.portal.kernel.exception.PortalException {
453                    return getService()
454                                       .updateEntry(userId, entryId, title, content, url, type,
455                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
456                            displayDateMinute, displayImmediately, expirationDateMonth,
457                            expirationDateDay, expirationDateYear, expirationDateHour,
458                            expirationDateMinute, priority);
459            }
460    
461            public static AnnouncementsEntryLocalService getService() {
462                    if (_service == null) {
463                            _service = (AnnouncementsEntryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsEntryLocalService.class.getName());
464    
465                            ReferenceRegistry.registerReference(AnnouncementsEntryLocalServiceUtil.class,
466                                    "_service");
467                    }
468    
469                    return _service;
470            }
471    
472            private static AnnouncementsEntryLocalService _service;
473    }