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.messageboards.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 remote service utility for MBMessage. This utility wraps
024     * {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBMessageService
032     * @see com.liferay.portlet.messageboards.service.base.MBMessageServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MBMessageServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
044                    long groupId, java.lang.String className, long classPK, long threadId,
045                    long parentMessageId, java.lang.String subject, java.lang.String body,
046                    com.liferay.portal.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException {
048                    return getService()
049                                       .addDiscussionMessage(groupId, className, classPK, threadId,
050                            parentMessageId, subject, body, serviceContext);
051            }
052    
053            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
054                    long categoryId, java.lang.String subject, java.lang.String body,
055                    com.liferay.portal.service.ServiceContext serviceContext)
056                    throws com.liferay.portal.kernel.exception.PortalException {
057                    return getService().addMessage(categoryId, subject, body, serviceContext);
058            }
059    
060            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
061                    long groupId, long categoryId, java.lang.String subject,
062                    java.lang.String body, java.lang.String format,
063                    java.lang.String fileName, java.io.File file, boolean anonymous,
064                    double priority, boolean allowPingbacks,
065                    com.liferay.portal.service.ServiceContext serviceContext)
066                    throws com.liferay.portal.kernel.exception.PortalException,
067                            java.io.FileNotFoundException {
068                    return getService()
069                                       .addMessage(groupId, categoryId, subject, body, format,
070                            fileName, file, anonymous, priority, allowPingbacks, serviceContext);
071            }
072    
073            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
074                    long groupId, long categoryId, java.lang.String subject,
075                    java.lang.String body, java.lang.String format,
076                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
077                    boolean anonymous, double priority, boolean allowPingbacks,
078                    com.liferay.portal.service.ServiceContext serviceContext)
079                    throws com.liferay.portal.kernel.exception.PortalException {
080                    return getService()
081                                       .addMessage(groupId, categoryId, subject, body, format,
082                            inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
083            }
084    
085            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
086                    long parentMessageId, java.lang.String subject, java.lang.String body,
087                    java.lang.String format,
088                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
089                    boolean anonymous, double priority, boolean allowPingbacks,
090                    com.liferay.portal.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    return getService()
093                                       .addMessage(parentMessageId, subject, body, format,
094                            inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
095            }
096    
097            public static void addMessageAttachment(long messageId,
098                    java.lang.String fileName, java.io.File file, java.lang.String mimeType)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    getService().addMessageAttachment(messageId, fileName, file, mimeType);
101            }
102    
103            /**
104            * @deprecated As of 7.0.0, replaced by {@link
105            #deleteDiscussionMessage(long)}
106            */
107            @Deprecated
108            public static void deleteDiscussionMessage(long groupId,
109                    java.lang.String className, long classPK,
110                    java.lang.String permissionClassName, long permissionClassPK,
111                    long permissionOwnerId, long messageId)
112                    throws com.liferay.portal.kernel.exception.PortalException {
113                    getService()
114                            .deleteDiscussionMessage(groupId, className, classPK,
115                            permissionClassName, permissionClassPK, permissionOwnerId, messageId);
116            }
117    
118            public static void deleteDiscussionMessage(long messageId)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    getService().deleteDiscussionMessage(messageId);
121            }
122    
123            public static void deleteMessage(long messageId)
124                    throws com.liferay.portal.kernel.exception.PortalException {
125                    getService().deleteMessage(messageId);
126            }
127    
128            public static void deleteMessageAttachment(long messageId,
129                    java.lang.String fileName)
130                    throws com.liferay.portal.kernel.exception.PortalException {
131                    getService().deleteMessageAttachment(messageId, fileName);
132            }
133    
134            public static void deleteMessageAttachments(long messageId)
135                    throws com.liferay.portal.kernel.exception.PortalException {
136                    getService().deleteMessageAttachments(messageId);
137            }
138    
139            public static void emptyMessageAttachments(long messageId)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    getService().emptyMessageAttachments(messageId);
142            }
143    
144            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
145                    long groupId, long categoryId, int status, int start, int end)
146                    throws com.liferay.portal.kernel.exception.PortalException {
147                    return getService()
148                                       .getCategoryMessages(groupId, categoryId, status, start, end);
149            }
150    
151            public static int getCategoryMessagesCount(long groupId, long categoryId,
152                    int status) {
153                    return getService().getCategoryMessagesCount(groupId, categoryId, status);
154            }
155    
156            public static java.lang.String getCategoryMessagesRSS(long groupId,
157                    long categoryId, int status, int max, java.lang.String type,
158                    double version, java.lang.String displayStyle,
159                    java.lang.String feedURL, java.lang.String entryURL,
160                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    return getService()
163                                       .getCategoryMessagesRSS(groupId, categoryId, status, max,
164                            type, version, displayStyle, feedURL, entryURL, themeDisplay);
165            }
166    
167            public static java.lang.String getCompanyMessagesRSS(long companyId,
168                    int status, int max, java.lang.String type, double version,
169                    java.lang.String displayStyle, java.lang.String feedURL,
170                    java.lang.String entryURL,
171                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
172                    throws com.liferay.portal.kernel.exception.PortalException {
173                    return getService()
174                                       .getCompanyMessagesRSS(companyId, status, max, type,
175                            version, displayStyle, feedURL, entryURL, themeDisplay);
176            }
177    
178            public static int getGroupMessagesCount(long groupId, int status) {
179                    return getService().getGroupMessagesCount(groupId, status);
180            }
181    
182            public static java.lang.String getGroupMessagesRSS(long groupId,
183                    int status, int max, java.lang.String type, double version,
184                    java.lang.String displayStyle, java.lang.String feedURL,
185                    java.lang.String entryURL,
186                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
187                    throws com.liferay.portal.kernel.exception.PortalException {
188                    return getService()
189                                       .getGroupMessagesRSS(groupId, status, max, type, version,
190                            displayStyle, feedURL, entryURL, themeDisplay);
191            }
192    
193            public static java.lang.String getGroupMessagesRSS(long groupId,
194                    long userId, int status, int max, java.lang.String type,
195                    double version, java.lang.String displayStyle,
196                    java.lang.String feedURL, java.lang.String entryURL,
197                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
198                    throws com.liferay.portal.kernel.exception.PortalException {
199                    return getService()
200                                       .getGroupMessagesRSS(groupId, userId, status, max, type,
201                            version, displayStyle, feedURL, entryURL, themeDisplay);
202            }
203    
204            public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
205                    long messageId)
206                    throws com.liferay.portal.kernel.exception.PortalException {
207                    return getService().getMessage(messageId);
208            }
209    
210            public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
211                    long messageId, int status, boolean includePrevAndNext)
212                    throws com.liferay.portal.kernel.exception.PortalException {
213                    return getService()
214                                       .getMessageDisplay(messageId, status, includePrevAndNext);
215            }
216    
217            /**
218            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long, int,
219            boolean)}
220            */
221            @Deprecated
222            public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
223                    long messageId, int status, java.lang.String threadView,
224                    boolean includePrevAndNext)
225                    throws com.liferay.portal.kernel.exception.PortalException {
226                    return getService()
227                                       .getMessageDisplay(messageId, status, threadView,
228                            includePrevAndNext);
229            }
230    
231            /**
232            * Returns the OSGi service identifier.
233            *
234            * @return the OSGi service identifier
235            */
236            public static java.lang.String getOSGiServiceIdentifier() {
237                    return getService().getOSGiServiceIdentifier();
238            }
239    
240            public static int getThreadAnswersCount(long groupId, long categoryId,
241                    long threadId) {
242                    return getService().getThreadAnswersCount(groupId, categoryId, threadId);
243            }
244    
245            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
246                    long groupId, long categoryId, long threadId, int status, int start,
247                    int end) {
248                    return getService()
249                                       .getThreadMessages(groupId, categoryId, threadId, status,
250                            start, end);
251            }
252    
253            public static int getThreadMessagesCount(long groupId, long categoryId,
254                    long threadId, int status) {
255                    return getService()
256                                       .getThreadMessagesCount(groupId, categoryId, threadId, status);
257            }
258    
259            public static java.lang.String getThreadMessagesRSS(long threadId,
260                    int status, int max, java.lang.String type, double version,
261                    java.lang.String displayStyle, java.lang.String feedURL,
262                    java.lang.String entryURL,
263                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
264                    throws com.liferay.portal.kernel.exception.PortalException {
265                    return getService()
266                                       .getThreadMessagesRSS(threadId, status, max, type, version,
267                            displayStyle, feedURL, entryURL, themeDisplay);
268            }
269    
270            public static void restoreMessageAttachmentFromTrash(long messageId,
271                    java.lang.String fileName)
272                    throws com.liferay.portal.kernel.exception.PortalException {
273                    getService().restoreMessageAttachmentFromTrash(messageId, fileName);
274            }
275    
276            public static void subscribeMessage(long messageId)
277                    throws com.liferay.portal.kernel.exception.PortalException {
278                    getService().subscribeMessage(messageId);
279            }
280    
281            public static void unsubscribeMessage(long messageId)
282                    throws com.liferay.portal.kernel.exception.PortalException {
283                    getService().unsubscribeMessage(messageId);
284            }
285    
286            public static void updateAnswer(long messageId, boolean answer,
287                    boolean cascade)
288                    throws com.liferay.portal.kernel.exception.PortalException {
289                    getService().updateAnswer(messageId, answer, cascade);
290            }
291    
292            public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
293                    java.lang.String className, long classPK, long messageId,
294                    java.lang.String subject, java.lang.String body,
295                    com.liferay.portal.service.ServiceContext serviceContext)
296                    throws com.liferay.portal.kernel.exception.PortalException {
297                    return getService()
298                                       .updateDiscussionMessage(className, classPK, messageId,
299                            subject, body, serviceContext);
300            }
301    
302            public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
303                    long messageId, java.lang.String subject, java.lang.String body,
304                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
305                    java.util.List<java.lang.String> existingFiles, double priority,
306                    boolean allowPingbacks,
307                    com.liferay.portal.service.ServiceContext serviceContext)
308                    throws com.liferay.portal.kernel.exception.PortalException {
309                    return getService()
310                                       .updateMessage(messageId, subject, body, inputStreamOVPs,
311                            existingFiles, priority, allowPingbacks, serviceContext);
312            }
313    
314            public static MBMessageService getService() {
315                    if (_service == null) {
316                            _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
317    
318                            ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
319                                    "_service");
320                    }
321    
322                    return _service;
323            }
324    
325            private static MBMessageService _service;
326    }