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