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.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    
022    import com.liferay.portlet.messageboards.service.MBMessageServiceUtil;
023    
024    import java.rmi.RemoteException;
025    
026    /**
027     * Provides the SOAP utility for the
028     * {@link com.liferay.portlet.messageboards.service.MBMessageServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it is difficult for SOAP to
031     * support certain types.
032     *
033     * <p>
034     * ServiceBuilder follows certain rules in translating the methods. For example,
035     * if the method in the service utility returns a {@link java.util.List}, that
036     * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBMessageSoap}.
037     * If the method in the service utility returns a
038     * {@link com.liferay.portlet.messageboards.model.MBMessage}, that is translated to a
039     * {@link com.liferay.portlet.messageboards.model.MBMessageSoap}. Methods that SOAP cannot
040     * safely wire are skipped.
041     * </p>
042     *
043     * <p>
044     * The benefits of using the SOAP utility is that it is cross platform
045     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
046     * even Perl, to call the generated services. One drawback of SOAP is that it is
047     * slow because it needs to serialize all calls into a text format (XML).
048     * </p>
049     *
050     * <p>
051     * You can see a list of services at http://localhost:8080/api/axis. Set the
052     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
053     * security.
054     * </p>
055     *
056     * <p>
057     * The SOAP utility is only generated for remote services.
058     * </p>
059     *
060     * @author Brian Wing Shun Chan
061     * @see MBMessageServiceHttp
062     * @see com.liferay.portlet.messageboards.model.MBMessageSoap
063     * @see com.liferay.portlet.messageboards.service.MBMessageServiceUtil
064     * @generated
065     */
066    @ProviderType
067    public class MBMessageServiceSoap {
068            public static com.liferay.portlet.messageboards.model.MBMessageSoap addDiscussionMessage(
069                    long groupId, java.lang.String className, long classPK,
070                    java.lang.String permissionClassName, long permissionClassPK,
071                    long permissionOwnerId, long threadId, long parentMessageId,
072                    java.lang.String subject, java.lang.String body,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws RemoteException {
075                    try {
076                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addDiscussionMessage(groupId,
077                                            className, classPK, permissionClassName, permissionClassPK,
078                                            permissionOwnerId, threadId, parentMessageId, subject,
079                                            body, serviceContext);
080    
081                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
082                    }
083                    catch (Exception e) {
084                            _log.error(e, e);
085    
086                            throw new RemoteException(e.getMessage());
087                    }
088            }
089    
090            /**
091            * @deprecated As of 6.2.0, replaced by {@link #addMessage(long, String,
092            String, String, java.util.List, boolean, double, boolean,
093            com.liferay.portal.service.ServiceContext)}
094            */
095            @Deprecated
096            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
097                    long groupId, long categoryId, long threadId, long parentMessageId,
098                    java.lang.String subject, java.lang.String body,
099                    java.lang.String format,
100                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
101                    boolean anonymous, double priority, boolean allowPingbacks,
102                    com.liferay.portal.service.ServiceContext serviceContext)
103                    throws RemoteException {
104                    try {
105                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
106                                            categoryId, threadId, parentMessageId, subject, body,
107                                            format, inputStreamOVPs, anonymous, priority,
108                                            allowPingbacks, serviceContext);
109    
110                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
111                    }
112                    catch (Exception e) {
113                            _log.error(e, e);
114    
115                            throw new RemoteException(e.getMessage());
116                    }
117            }
118    
119            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
120                    long groupId, long categoryId, java.lang.String subject,
121                    java.lang.String body, java.lang.String format,
122                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
123                    boolean anonymous, double priority, boolean allowPingbacks,
124                    com.liferay.portal.service.ServiceContext serviceContext)
125                    throws RemoteException {
126                    try {
127                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
128                                            categoryId, subject, body, format, inputStreamOVPs,
129                                            anonymous, priority, allowPingbacks, serviceContext);
130    
131                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
132                    }
133                    catch (Exception e) {
134                            _log.error(e, e);
135    
136                            throw new RemoteException(e.getMessage());
137                    }
138            }
139    
140            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
141                    long categoryId, java.lang.String subject, java.lang.String body,
142                    com.liferay.portal.service.ServiceContext serviceContext)
143                    throws RemoteException {
144                    try {
145                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
146                                            subject, body, serviceContext);
147    
148                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
149                    }
150                    catch (Exception e) {
151                            _log.error(e, e);
152    
153                            throw new RemoteException(e.getMessage());
154                    }
155            }
156    
157            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
158                    long parentMessageId, java.lang.String subject, java.lang.String body,
159                    java.lang.String format,
160                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
161                    boolean anonymous, double priority, boolean allowPingbacks,
162                    com.liferay.portal.service.ServiceContext serviceContext)
163                    throws RemoteException {
164                    try {
165                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(parentMessageId,
166                                            subject, body, format, inputStreamOVPs, anonymous,
167                                            priority, allowPingbacks, serviceContext);
168    
169                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
170                    }
171                    catch (Exception e) {
172                            _log.error(e, e);
173    
174                            throw new RemoteException(e.getMessage());
175                    }
176            }
177    
178            public static void deleteDiscussionMessage(long groupId,
179                    java.lang.String className, long classPK,
180                    java.lang.String permissionClassName, long permissionClassPK,
181                    long permissionOwnerId, long messageId) throws RemoteException {
182                    try {
183                            MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
184                                    classPK, permissionClassName, permissionClassPK,
185                                    permissionOwnerId, messageId);
186                    }
187                    catch (Exception e) {
188                            _log.error(e, e);
189    
190                            throw new RemoteException(e.getMessage());
191                    }
192            }
193    
194            public static void deleteMessage(long messageId) throws RemoteException {
195                    try {
196                            MBMessageServiceUtil.deleteMessage(messageId);
197                    }
198                    catch (Exception e) {
199                            _log.error(e, e);
200    
201                            throw new RemoteException(e.getMessage());
202                    }
203            }
204    
205            public static void deleteMessageAttachments(long messageId)
206                    throws RemoteException {
207                    try {
208                            MBMessageServiceUtil.deleteMessageAttachments(messageId);
209                    }
210                    catch (Exception e) {
211                            _log.error(e, e);
212    
213                            throw new RemoteException(e.getMessage());
214                    }
215            }
216    
217            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
218                    long groupId, long categoryId, int status, int start, int end)
219                    throws RemoteException {
220                    try {
221                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
222                                    MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
223                                            status, start, end);
224    
225                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
226                    }
227                    catch (Exception e) {
228                            _log.error(e, e);
229    
230                            throw new RemoteException(e.getMessage());
231                    }
232            }
233    
234            public static int getCategoryMessagesCount(long groupId, long categoryId,
235                    int status) throws RemoteException {
236                    try {
237                            int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
238                                            categoryId, status);
239    
240                            return returnValue;
241                    }
242                    catch (Exception e) {
243                            _log.error(e, e);
244    
245                            throw new RemoteException(e.getMessage());
246                    }
247            }
248    
249            public static int getGroupMessagesCount(long groupId, int status)
250                    throws RemoteException {
251                    try {
252                            int returnValue = MBMessageServiceUtil.getGroupMessagesCount(groupId,
253                                            status);
254    
255                            return returnValue;
256                    }
257                    catch (Exception e) {
258                            _log.error(e, e);
259    
260                            throw new RemoteException(e.getMessage());
261                    }
262            }
263    
264            public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
265                    long messageId) throws RemoteException {
266                    try {
267                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
268    
269                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
270                    }
271                    catch (Exception e) {
272                            _log.error(e, e);
273    
274                            throw new RemoteException(e.getMessage());
275                    }
276            }
277    
278            public static int getThreadAnswersCount(long groupId, long categoryId,
279                    long threadId) throws RemoteException {
280                    try {
281                            int returnValue = MBMessageServiceUtil.getThreadAnswersCount(groupId,
282                                            categoryId, threadId);
283    
284                            return returnValue;
285                    }
286                    catch (Exception e) {
287                            _log.error(e, e);
288    
289                            throw new RemoteException(e.getMessage());
290                    }
291            }
292    
293            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
294                    long groupId, long categoryId, long threadId, int status, int start,
295                    int end) throws RemoteException {
296                    try {
297                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
298                                    MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
299                                            threadId, status, start, end);
300    
301                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
302                    }
303                    catch (Exception e) {
304                            _log.error(e, e);
305    
306                            throw new RemoteException(e.getMessage());
307                    }
308            }
309    
310            public static int getThreadMessagesCount(long groupId, long categoryId,
311                    long threadId, int status) throws RemoteException {
312                    try {
313                            int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
314                                            categoryId, threadId, status);
315    
316                            return returnValue;
317                    }
318                    catch (Exception e) {
319                            _log.error(e, e);
320    
321                            throw new RemoteException(e.getMessage());
322                    }
323            }
324    
325            public static void restoreMessageAttachmentFromTrash(long messageId,
326                    java.lang.String fileName) throws RemoteException {
327                    try {
328                            MBMessageServiceUtil.restoreMessageAttachmentFromTrash(messageId,
329                                    fileName);
330                    }
331                    catch (Exception e) {
332                            _log.error(e, e);
333    
334                            throw new RemoteException(e.getMessage());
335                    }
336            }
337    
338            public static void subscribeMessage(long messageId)
339                    throws RemoteException {
340                    try {
341                            MBMessageServiceUtil.subscribeMessage(messageId);
342                    }
343                    catch (Exception e) {
344                            _log.error(e, e);
345    
346                            throw new RemoteException(e.getMessage());
347                    }
348            }
349    
350            public static void unsubscribeMessage(long messageId)
351                    throws RemoteException {
352                    try {
353                            MBMessageServiceUtil.unsubscribeMessage(messageId);
354                    }
355                    catch (Exception e) {
356                            _log.error(e, e);
357    
358                            throw new RemoteException(e.getMessage());
359                    }
360            }
361    
362            public static void updateAnswer(long messageId, boolean answer,
363                    boolean cascade) throws RemoteException {
364                    try {
365                            MBMessageServiceUtil.updateAnswer(messageId, answer, cascade);
366                    }
367                    catch (Exception e) {
368                            _log.error(e, e);
369    
370                            throw new RemoteException(e.getMessage());
371                    }
372            }
373    
374            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
375                    java.lang.String className, long classPK,
376                    java.lang.String permissionClassName, long permissionClassPK,
377                    long permissionOwnerId, long messageId, java.lang.String subject,
378                    java.lang.String body,
379                    com.liferay.portal.service.ServiceContext serviceContext)
380                    throws RemoteException {
381                    try {
382                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
383                                            classPK, permissionClassName, permissionClassPK,
384                                            permissionOwnerId, messageId, subject, body, serviceContext);
385    
386                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
387                    }
388                    catch (Exception e) {
389                            _log.error(e, e);
390    
391                            throw new RemoteException(e.getMessage());
392                    }
393            }
394    
395            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
396                    long messageId, java.lang.String subject, java.lang.String body,
397                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
398                    java.util.List<java.lang.String> existingFiles, double priority,
399                    boolean allowPingbacks,
400                    com.liferay.portal.service.ServiceContext serviceContext)
401                    throws RemoteException {
402                    try {
403                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
404                                            subject, body, inputStreamOVPs, existingFiles, priority,
405                                            allowPingbacks, serviceContext);
406    
407                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
408                    }
409                    catch (Exception e) {
410                            _log.error(e, e);
411    
412                            throw new RemoteException(e.getMessage());
413                    }
414            }
415    
416            private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
417    }