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