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 parentMessageId, java.lang.String subject, java.lang.String body,
140                    java.lang.String format,
141                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
142                    boolean anonymous, double priority, boolean allowPingbacks,
143                    com.liferay.portal.service.ServiceContext serviceContext)
144                    throws RemoteException {
145                    try {
146                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(parentMessageId,
147                                            subject, body, format, inputStreamOVPs, anonymous,
148                                            priority, allowPingbacks, serviceContext);
149    
150                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static void deleteDiscussionMessage(long groupId,
160                    java.lang.String className, long classPK,
161                    java.lang.String permissionClassName, long permissionClassPK,
162                    long permissionOwnerId, long messageId) throws RemoteException {
163                    try {
164                            MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
165                                    classPK, permissionClassName, permissionClassPK,
166                                    permissionOwnerId, messageId);
167                    }
168                    catch (Exception e) {
169                            _log.error(e, e);
170    
171                            throw new RemoteException(e.getMessage());
172                    }
173            }
174    
175            public static void deleteMessage(long messageId) throws RemoteException {
176                    try {
177                            MBMessageServiceUtil.deleteMessage(messageId);
178                    }
179                    catch (Exception e) {
180                            _log.error(e, e);
181    
182                            throw new RemoteException(e.getMessage());
183                    }
184            }
185    
186            public static void deleteMessageAttachments(long messageId)
187                    throws RemoteException {
188                    try {
189                            MBMessageServiceUtil.deleteMessageAttachments(messageId);
190                    }
191                    catch (Exception e) {
192                            _log.error(e, e);
193    
194                            throw new RemoteException(e.getMessage());
195                    }
196            }
197    
198            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
199                    long groupId, long categoryId, int status, int start, int end)
200                    throws RemoteException {
201                    try {
202                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
203                                    MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
204                                            status, start, end);
205    
206                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
207                    }
208                    catch (Exception e) {
209                            _log.error(e, e);
210    
211                            throw new RemoteException(e.getMessage());
212                    }
213            }
214    
215            public static int getCategoryMessagesCount(long groupId, long categoryId,
216                    int status) throws RemoteException {
217                    try {
218                            int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
219                                            categoryId, status);
220    
221                            return 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 getGroupMessagesCount(long groupId, int status)
231                    throws RemoteException {
232                    try {
233                            int returnValue = MBMessageServiceUtil.getGroupMessagesCount(groupId,
234                                            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 com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
246                    long messageId) throws RemoteException {
247                    try {
248                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
249    
250                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
251                    }
252                    catch (Exception e) {
253                            _log.error(e, e);
254    
255                            throw new RemoteException(e.getMessage());
256                    }
257            }
258    
259            public static int getThreadAnswersCount(long groupId, long categoryId,
260                    long threadId) throws RemoteException {
261                    try {
262                            int returnValue = MBMessageServiceUtil.getThreadAnswersCount(groupId,
263                                            categoryId, threadId);
264    
265                            return returnValue;
266                    }
267                    catch (Exception e) {
268                            _log.error(e, e);
269    
270                            throw new RemoteException(e.getMessage());
271                    }
272            }
273    
274            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
275                    long groupId, long categoryId, long threadId, int status, int start,
276                    int end) throws RemoteException {
277                    try {
278                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
279                                    MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
280                                            threadId, status, start, end);
281    
282                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
283                    }
284                    catch (Exception e) {
285                            _log.error(e, e);
286    
287                            throw new RemoteException(e.getMessage());
288                    }
289            }
290    
291            public static int getThreadMessagesCount(long groupId, long categoryId,
292                    long threadId, int status) throws RemoteException {
293                    try {
294                            int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
295                                            categoryId, threadId, status);
296    
297                            return returnValue;
298                    }
299                    catch (Exception e) {
300                            _log.error(e, e);
301    
302                            throw new RemoteException(e.getMessage());
303                    }
304            }
305    
306            public static void subscribeMessage(long messageId)
307                    throws RemoteException {
308                    try {
309                            MBMessageServiceUtil.subscribeMessage(messageId);
310                    }
311                    catch (Exception e) {
312                            _log.error(e, e);
313    
314                            throw new RemoteException(e.getMessage());
315                    }
316            }
317    
318            public static void unsubscribeMessage(long messageId)
319                    throws RemoteException {
320                    try {
321                            MBMessageServiceUtil.unsubscribeMessage(messageId);
322                    }
323                    catch (Exception e) {
324                            _log.error(e, e);
325    
326                            throw new RemoteException(e.getMessage());
327                    }
328            }
329    
330            public static void updateAnswer(long messageId, boolean answer,
331                    boolean cascade) throws RemoteException {
332                    try {
333                            MBMessageServiceUtil.updateAnswer(messageId, answer, cascade);
334                    }
335                    catch (Exception e) {
336                            _log.error(e, e);
337    
338                            throw new RemoteException(e.getMessage());
339                    }
340            }
341    
342            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
343                    java.lang.String className, long classPK,
344                    java.lang.String permissionClassName, long permissionClassPK,
345                    long permissionOwnerId, long messageId, java.lang.String subject,
346                    java.lang.String body,
347                    com.liferay.portal.service.ServiceContext serviceContext)
348                    throws RemoteException {
349                    try {
350                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
351                                            classPK, permissionClassName, permissionClassPK,
352                                            permissionOwnerId, messageId, subject, body, serviceContext);
353    
354                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
355                    }
356                    catch (Exception e) {
357                            _log.error(e, e);
358    
359                            throw new RemoteException(e.getMessage());
360                    }
361            }
362    
363            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
364                    long messageId, java.lang.String subject, java.lang.String body,
365                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
366                    java.util.List<java.lang.String> existingFiles, double priority,
367                    boolean allowPingbacks,
368                    com.liferay.portal.service.ServiceContext serviceContext)
369                    throws RemoteException {
370                    try {
371                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
372                                            subject, body, inputStreamOVPs, existingFiles, priority,
373                                            allowPingbacks, serviceContext);
374    
375                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
376                    }
377                    catch (Exception e) {
378                            _log.error(e, e);
379    
380                            throw new RemoteException(e.getMessage());
381                    }
382            }
383    
384            private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
385    }