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