001    /**
002     * Copyright (c) 2000-2010 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    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link MBMessageService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       MBMessageService
030     * @generated
031     */
032    public class MBMessageServiceUtil {
033            public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
034                    long groupId, java.lang.String className, long classPK,
035                    java.lang.String permissionClassName, long permissionClassPK,
036                    long threadId, long parentMessageId, java.lang.String subject,
037                    java.lang.String body,
038                    com.liferay.portal.service.ServiceContext serviceContext)
039                    throws com.liferay.portal.kernel.exception.PortalException,
040                            com.liferay.portal.kernel.exception.SystemException {
041                    return getService()
042                                       .addDiscussionMessage(groupId, className, classPK,
043                            permissionClassName, permissionClassPK, threadId, parentMessageId,
044                            subject, body, serviceContext);
045            }
046    
047            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
048                    long groupId, long categoryId, long threadId, long parentMessageId,
049                    java.lang.String subject, java.lang.String body,
050                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
051                    boolean anonymous, double priority, boolean allowPingbacks,
052                    com.liferay.portal.service.ServiceContext serviceContext)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    return getService()
056                                       .addMessage(groupId, categoryId, threadId, parentMessageId,
057                            subject, body, files, anonymous, priority, allowPingbacks,
058                            serviceContext);
059            }
060    
061            public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
062                    long groupId, long categoryId, java.lang.String subject,
063                    java.lang.String body,
064                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
065                    boolean anonymous, double priority, boolean allowPingbacks,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    return getService()
070                                       .addMessage(groupId, categoryId, subject, body, files,
071                            anonymous, priority, allowPingbacks, serviceContext);
072            }
073    
074            public static void deleteDiscussionMessage(long groupId,
075                    java.lang.String className, long classPK,
076                    java.lang.String permissionClassName, long permissionClassPK,
077                    long messageId)
078                    throws com.liferay.portal.kernel.exception.PortalException,
079                            com.liferay.portal.kernel.exception.SystemException {
080                    getService()
081                            .deleteDiscussionMessage(groupId, className, classPK,
082                            permissionClassName, permissionClassPK, messageId);
083            }
084    
085            public static void deleteMessage(long messageId)
086                    throws com.liferay.portal.kernel.exception.PortalException,
087                            com.liferay.portal.kernel.exception.SystemException {
088                    getService().deleteMessage(messageId);
089            }
090    
091            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
092                    long groupId, long categoryId, int status, int start, int end)
093                    throws com.liferay.portal.kernel.exception.PortalException,
094                            com.liferay.portal.kernel.exception.SystemException {
095                    return getService()
096                                       .getCategoryMessages(groupId, categoryId, status, start, end);
097            }
098    
099            public static int getCategoryMessagesCount(long groupId, long categoryId,
100                    int status) throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().getCategoryMessagesCount(groupId, categoryId, status);
102            }
103    
104            public static java.lang.String getCategoryMessagesRSS(long groupId,
105                    long categoryId, int status, int max, java.lang.String type,
106                    double version, java.lang.String displayStyle,
107                    java.lang.String feedURL, java.lang.String entryURL,
108                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
109                    throws com.liferay.portal.kernel.exception.PortalException,
110                            com.liferay.portal.kernel.exception.SystemException {
111                    return getService()
112                                       .getCategoryMessagesRSS(groupId, categoryId, status, max,
113                            type, version, displayStyle, feedURL, entryURL, themeDisplay);
114            }
115    
116            public static java.lang.String getCompanyMessagesRSS(long companyId,
117                    int status, int max, java.lang.String type, double version,
118                    java.lang.String displayStyle, java.lang.String feedURL,
119                    java.lang.String entryURL,
120                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
121                    throws com.liferay.portal.kernel.exception.PortalException,
122                            com.liferay.portal.kernel.exception.SystemException {
123                    return getService()
124                                       .getCompanyMessagesRSS(companyId, status, max, type,
125                            version, displayStyle, feedURL, entryURL, themeDisplay);
126            }
127    
128            public static java.lang.String getGroupMessagesRSS(long groupId,
129                    int status, int max, java.lang.String type, double version,
130                    java.lang.String displayStyle, java.lang.String feedURL,
131                    java.lang.String entryURL,
132                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    return getService()
136                                       .getGroupMessagesRSS(groupId, status, max, type, version,
137                            displayStyle, feedURL, entryURL, themeDisplay);
138            }
139    
140            public static java.lang.String getGroupMessagesRSS(long groupId,
141                    long userId, int status, int max, java.lang.String type,
142                    double version, java.lang.String displayStyle,
143                    java.lang.String feedURL, java.lang.String entryURL,
144                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    return getService()
148                                       .getGroupMessagesRSS(groupId, userId, status, max, type,
149                            version, displayStyle, feedURL, entryURL, themeDisplay);
150            }
151    
152            public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
153                    long messageId)
154                    throws com.liferay.portal.kernel.exception.PortalException,
155                            com.liferay.portal.kernel.exception.SystemException {
156                    return getService().getMessage(messageId);
157            }
158    
159            public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
160                    long messageId, int status, java.lang.String threadView,
161                    boolean includePrevAndNext)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException {
164                    return getService()
165                                       .getMessageDisplay(messageId, status, threadView,
166                            includePrevAndNext);
167            }
168    
169            public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
170                    long groupId, long categoryId, long threadId, int status, int start,
171                    int end) throws com.liferay.portal.kernel.exception.SystemException {
172                    return getService()
173                                       .getThreadMessages(groupId, categoryId, threadId, status,
174                            start, end);
175            }
176    
177            public static int getThreadMessagesCount(long groupId, long categoryId,
178                    long threadId, int status)
179                    throws com.liferay.portal.kernel.exception.SystemException {
180                    return getService()
181                                       .getThreadMessagesCount(groupId, categoryId, threadId, status);
182            }
183    
184            public static java.lang.String getThreadMessagesRSS(long threadId,
185                    int status, int max, java.lang.String type, double version,
186                    java.lang.String displayStyle, java.lang.String feedURL,
187                    java.lang.String entryURL,
188                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
189                    throws com.liferay.portal.kernel.exception.PortalException,
190                            com.liferay.portal.kernel.exception.SystemException {
191                    return getService()
192                                       .getThreadMessagesRSS(threadId, status, max, type, version,
193                            displayStyle, feedURL, entryURL, themeDisplay);
194            }
195    
196            public static void subscribeMessage(long messageId)
197                    throws com.liferay.portal.kernel.exception.PortalException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    getService().subscribeMessage(messageId);
200            }
201    
202            public static void unsubscribeMessage(long messageId)
203                    throws com.liferay.portal.kernel.exception.PortalException,
204                            com.liferay.portal.kernel.exception.SystemException {
205                    getService().unsubscribeMessage(messageId);
206            }
207    
208            public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
209                    java.lang.String className, long classPK,
210                    java.lang.String permissionClassName, long permissionClassPK,
211                    long messageId, java.lang.String subject, java.lang.String body,
212                    com.liferay.portal.service.ServiceContext serviceContext)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    return getService()
216                                       .updateDiscussionMessage(className, classPK,
217                            permissionClassName, permissionClassPK, messageId, subject, body,
218                            serviceContext);
219            }
220    
221            public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
222                    long messageId, java.lang.String subject, java.lang.String body,
223                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
224                    java.util.List<java.lang.String> existingFiles, double priority,
225                    boolean allowPingbacks,
226                    com.liferay.portal.service.ServiceContext serviceContext)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException {
229                    return getService()
230                                       .updateMessage(messageId, subject, body, files,
231                            existingFiles, priority, allowPingbacks, serviceContext);
232            }
233    
234            public static MBMessageService getService() {
235                    if (_service == null) {
236                            _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
237                    }
238    
239                    return _service;
240            }
241    
242            public void setService(MBMessageService service) {
243                    _service = service;
244            }
245    
246            private static MBMessageService _service;
247    }