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