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 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 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, long threadId,
070                    long parentMessageId, java.lang.String subject, java.lang.String body,
071                    com.liferay.portal.service.ServiceContext serviceContext)
072                    throws RemoteException {
073                    try {
074                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addDiscussionMessage(groupId,
075                                            className, classPK, threadId, parentMessageId, subject,
076                                            body, serviceContext);
077    
078                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
079                    }
080                    catch (Exception e) {
081                            _log.error(e, e);
082    
083                            throw new RemoteException(e.getMessage());
084                    }
085            }
086    
087            /**
088            * @deprecated As of 6.2.0, replaced by {@link #addMessage(long, String,
089            String, String, List, boolean, double, boolean,
090            ServiceContext)}
091            */
092            @Deprecated
093            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
094                    long groupId, long categoryId, long threadId, long parentMessageId,
095                    java.lang.String subject, java.lang.String body,
096                    java.lang.String format,
097                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
098                    boolean anonymous, double priority, boolean allowPingbacks,
099                    com.liferay.portal.service.ServiceContext serviceContext)
100                    throws RemoteException {
101                    try {
102                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
103                                            categoryId, threadId, parentMessageId, subject, body,
104                                            format, inputStreamOVPs, anonymous, priority,
105                                            allowPingbacks, serviceContext);
106    
107                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
108                    }
109                    catch (Exception e) {
110                            _log.error(e, e);
111    
112                            throw new RemoteException(e.getMessage());
113                    }
114            }
115    
116            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
117                    long groupId, long categoryId, java.lang.String subject,
118                    java.lang.String body, java.lang.String format,
119                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
120                    boolean anonymous, double priority, boolean allowPingbacks,
121                    com.liferay.portal.service.ServiceContext serviceContext)
122                    throws RemoteException {
123                    try {
124                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
125                                            categoryId, subject, body, format, inputStreamOVPs,
126                                            anonymous, priority, allowPingbacks, serviceContext);
127    
128                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
129                    }
130                    catch (Exception e) {
131                            _log.error(e, e);
132    
133                            throw new RemoteException(e.getMessage());
134                    }
135            }
136    
137            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
138                    long categoryId, java.lang.String subject, java.lang.String body,
139                    com.liferay.portal.service.ServiceContext serviceContext)
140                    throws RemoteException {
141                    try {
142                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
143                                            subject, body, serviceContext);
144    
145                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
155                    long parentMessageId, java.lang.String subject, java.lang.String body,
156                    java.lang.String format,
157                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
158                    boolean anonymous, double priority, boolean allowPingbacks,
159                    com.liferay.portal.service.ServiceContext serviceContext)
160                    throws RemoteException {
161                    try {
162                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(parentMessageId,
163                                            subject, body, format, inputStreamOVPs, anonymous,
164                                            priority, allowPingbacks, serviceContext);
165    
166                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
167                    }
168                    catch (Exception e) {
169                            _log.error(e, e);
170    
171                            throw new RemoteException(e.getMessage());
172                    }
173            }
174    
175            public static void deleteDiscussionMessage(long messageId)
176                    throws RemoteException {
177                    try {
178                            MBMessageServiceUtil.deleteDiscussionMessage(messageId);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            /**
188            * @deprecated As of 7.0.0, replaced by {@link
189            #deleteDiscussionMessage(long)}
190            */
191            @Deprecated
192            public static void deleteDiscussionMessage(long groupId,
193                    java.lang.String className, long classPK,
194                    java.lang.String permissionClassName, long permissionClassPK,
195                    long permissionOwnerId, long messageId) throws RemoteException {
196                    try {
197                            MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
198                                    classPK, permissionClassName, permissionClassPK,
199                                    permissionOwnerId, messageId);
200                    }
201                    catch (Exception e) {
202                            _log.error(e, e);
203    
204                            throw new RemoteException(e.getMessage());
205                    }
206            }
207    
208            public static void deleteMessage(long messageId) throws RemoteException {
209                    try {
210                            MBMessageServiceUtil.deleteMessage(messageId);
211                    }
212                    catch (Exception e) {
213                            _log.error(e, e);
214    
215                            throw new RemoteException(e.getMessage());
216                    }
217            }
218    
219            public static void deleteMessageAttachment(long messageId,
220                    java.lang.String fileName) throws RemoteException {
221                    try {
222                            MBMessageServiceUtil.deleteMessageAttachment(messageId, fileName);
223                    }
224                    catch (Exception e) {
225                            _log.error(e, e);
226    
227                            throw new RemoteException(e.getMessage());
228                    }
229            }
230    
231            public static void deleteMessageAttachments(long messageId)
232                    throws RemoteException {
233                    try {
234                            MBMessageServiceUtil.deleteMessageAttachments(messageId);
235                    }
236                    catch (Exception e) {
237                            _log.error(e, e);
238    
239                            throw new RemoteException(e.getMessage());
240                    }
241            }
242    
243            public static void emptyMessageAttachments(long messageId)
244                    throws RemoteException {
245                    try {
246                            MBMessageServiceUtil.emptyMessageAttachments(messageId);
247                    }
248                    catch (Exception e) {
249                            _log.error(e, e);
250    
251                            throw new RemoteException(e.getMessage());
252                    }
253            }
254    
255            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
256                    long groupId, long categoryId, int status, int start, int end)
257                    throws RemoteException {
258                    try {
259                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
260                                    MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
261                                            status, start, end);
262    
263                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
264                    }
265                    catch (Exception e) {
266                            _log.error(e, e);
267    
268                            throw new RemoteException(e.getMessage());
269                    }
270            }
271    
272            public static int getCategoryMessagesCount(long groupId, long categoryId,
273                    int status) throws RemoteException {
274                    try {
275                            int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
276                                            categoryId, status);
277    
278                            return returnValue;
279                    }
280                    catch (Exception e) {
281                            _log.error(e, e);
282    
283                            throw new RemoteException(e.getMessage());
284                    }
285            }
286    
287            public static int getGroupMessagesCount(long groupId, int status)
288                    throws RemoteException {
289                    try {
290                            int returnValue = MBMessageServiceUtil.getGroupMessagesCount(groupId,
291                                            status);
292    
293                            return returnValue;
294                    }
295                    catch (Exception e) {
296                            _log.error(e, e);
297    
298                            throw new RemoteException(e.getMessage());
299                    }
300            }
301    
302            public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
303                    long messageId) throws RemoteException {
304                    try {
305                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
306    
307                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
308                    }
309                    catch (Exception e) {
310                            _log.error(e, e);
311    
312                            throw new RemoteException(e.getMessage());
313                    }
314            }
315    
316            public static int getThreadAnswersCount(long groupId, long categoryId,
317                    long threadId) throws RemoteException {
318                    try {
319                            int returnValue = MBMessageServiceUtil.getThreadAnswersCount(groupId,
320                                            categoryId, threadId);
321    
322                            return returnValue;
323                    }
324                    catch (Exception e) {
325                            _log.error(e, e);
326    
327                            throw new RemoteException(e.getMessage());
328                    }
329            }
330    
331            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
332                    long groupId, long categoryId, long threadId, int status, int start,
333                    int end) throws RemoteException {
334                    try {
335                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
336                                    MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
337                                            threadId, status, start, end);
338    
339                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
340                    }
341                    catch (Exception e) {
342                            _log.error(e, e);
343    
344                            throw new RemoteException(e.getMessage());
345                    }
346            }
347    
348            public static int getThreadMessagesCount(long groupId, long categoryId,
349                    long threadId, int status) throws RemoteException {
350                    try {
351                            int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
352                                            categoryId, threadId, status);
353    
354                            return returnValue;
355                    }
356                    catch (Exception e) {
357                            _log.error(e, e);
358    
359                            throw new RemoteException(e.getMessage());
360                    }
361            }
362    
363            public static void restoreMessageAttachmentFromTrash(long messageId,
364                    java.lang.String fileName) throws RemoteException {
365                    try {
366                            MBMessageServiceUtil.restoreMessageAttachmentFromTrash(messageId,
367                                    fileName);
368                    }
369                    catch (Exception e) {
370                            _log.error(e, e);
371    
372                            throw new RemoteException(e.getMessage());
373                    }
374            }
375    
376            public static void subscribeMessage(long messageId)
377                    throws RemoteException {
378                    try {
379                            MBMessageServiceUtil.subscribeMessage(messageId);
380                    }
381                    catch (Exception e) {
382                            _log.error(e, e);
383    
384                            throw new RemoteException(e.getMessage());
385                    }
386            }
387    
388            public static void unsubscribeMessage(long messageId)
389                    throws RemoteException {
390                    try {
391                            MBMessageServiceUtil.unsubscribeMessage(messageId);
392                    }
393                    catch (Exception e) {
394                            _log.error(e, e);
395    
396                            throw new RemoteException(e.getMessage());
397                    }
398            }
399    
400            public static void updateAnswer(long messageId, boolean answer,
401                    boolean cascade) throws RemoteException {
402                    try {
403                            MBMessageServiceUtil.updateAnswer(messageId, answer, cascade);
404                    }
405                    catch (Exception e) {
406                            _log.error(e, e);
407    
408                            throw new RemoteException(e.getMessage());
409                    }
410            }
411    
412            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
413                    java.lang.String className, long classPK, long messageId,
414                    java.lang.String subject, java.lang.String body,
415                    com.liferay.portal.service.ServiceContext serviceContext)
416                    throws RemoteException {
417                    try {
418                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
419                                            classPK, messageId, subject, body, serviceContext);
420    
421                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
422                    }
423                    catch (Exception e) {
424                            _log.error(e, e);
425    
426                            throw new RemoteException(e.getMessage());
427                    }
428            }
429    
430            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
431                    long messageId, java.lang.String subject, java.lang.String body,
432                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
433                    java.util.List<java.lang.String> existingFiles, double priority,
434                    boolean allowPingbacks,
435                    com.liferay.portal.service.ServiceContext serviceContext)
436                    throws RemoteException {
437                    try {
438                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
439                                            subject, body, inputStreamOVPs, existingFiles, priority,
440                                            allowPingbacks, serviceContext);
441    
442                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
443                    }
444                    catch (Exception e) {
445                            _log.error(e, e);
446    
447                            throw new RemoteException(e.getMessage());
448                    }
449            }
450    
451            private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
452    }