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