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     * <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
052     * http://localhost:8080/api/secure/axis. Set the property
053     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
054     * security.
055     * </p>
056     *
057     * <p>
058     * The SOAP utility is only generated for remote services.
059     * </p>
060     *
061     * @author    Brian Wing Shun Chan
062     * @see       MBMessageServiceHttp
063     * @see       com.liferay.portlet.messageboards.model.MBMessageSoap
064     * @see       com.liferay.portlet.messageboards.service.MBMessageServiceUtil
065     * @generated
066     */
067    public class MBMessageServiceSoap {
068            public static com.liferay.portlet.messageboards.model.MBMessageSoap addDiscussionMessage(
069                    long groupId, java.lang.String className, long classPK,
070                    java.lang.String permissionClassName, long permissionClassPK,
071                    long permissionOwnerId, long threadId, long parentMessageId,
072                    java.lang.String subject, java.lang.String body,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws RemoteException {
075                    try {
076                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addDiscussionMessage(groupId,
077                                            className, classPK, permissionClassName, permissionClassPK,
078                                            permissionOwnerId, threadId, parentMessageId, subject,
079                                            body, serviceContext);
080    
081                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
082                    }
083                    catch (Exception e) {
084                            _log.error(e, e);
085    
086                            throw new RemoteException(e.getMessage());
087                    }
088            }
089    
090            /**
091            * @deprecated {@link #addMessage(long, String, String, String,
092            java.util.List, boolean, double, boolean,
093            com.liferay.portal.service.ServiceContext)}
094            */
095            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
096                    long groupId, long categoryId, long threadId, long parentMessageId,
097                    java.lang.String subject, java.lang.String body,
098                    java.lang.String format,
099                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
100                    boolean anonymous, double priority, boolean allowPingbacks,
101                    com.liferay.portal.service.ServiceContext serviceContext)
102                    throws RemoteException {
103                    try {
104                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
105                                            categoryId, threadId, parentMessageId, subject, body,
106                                            format, inputStreamOVPs, anonymous, priority,
107                                            allowPingbacks, serviceContext);
108    
109                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
110                    }
111                    catch (Exception e) {
112                            _log.error(e, e);
113    
114                            throw new RemoteException(e.getMessage());
115                    }
116            }
117    
118            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
119                    long groupId, long categoryId, java.lang.String subject,
120                    java.lang.String body, java.lang.String format,
121                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
122                    boolean anonymous, double priority, boolean allowPingbacks,
123                    com.liferay.portal.service.ServiceContext serviceContext)
124                    throws RemoteException {
125                    try {
126                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
127                                            categoryId, subject, body, format, inputStreamOVPs,
128                                            anonymous, priority, allowPingbacks, serviceContext);
129    
130                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
140                    long parentMessageId, java.lang.String subject, java.lang.String body,
141                    java.lang.String format,
142                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
143                    boolean anonymous, double priority, boolean allowPingbacks,
144                    com.liferay.portal.service.ServiceContext serviceContext)
145                    throws RemoteException {
146                    try {
147                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(parentMessageId,
148                                            subject, body, format, inputStreamOVPs, anonymous,
149                                            priority, allowPingbacks, serviceContext);
150    
151                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static void deleteDiscussionMessage(long groupId,
161                    java.lang.String className, long classPK,
162                    java.lang.String permissionClassName, long permissionClassPK,
163                    long permissionOwnerId, long messageId) throws RemoteException {
164                    try {
165                            MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
166                                    classPK, permissionClassName, permissionClassPK,
167                                    permissionOwnerId, messageId);
168                    }
169                    catch (Exception e) {
170                            _log.error(e, e);
171    
172                            throw new RemoteException(e.getMessage());
173                    }
174            }
175    
176            public static void deleteMessage(long messageId) throws RemoteException {
177                    try {
178                            MBMessageServiceUtil.deleteMessage(messageId);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
188                    long groupId, long categoryId, int status, int start, int end)
189                    throws RemoteException {
190                    try {
191                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
192                                    MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
193                                            status, start, end);
194    
195                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            public static int getCategoryMessagesCount(long groupId, long categoryId,
205                    int status) throws RemoteException {
206                    try {
207                            int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
208                                            categoryId, status);
209    
210                            return returnValue;
211                    }
212                    catch (Exception e) {
213                            _log.error(e, e);
214    
215                            throw new RemoteException(e.getMessage());
216                    }
217            }
218    
219            public static int getGroupMessagesCount(long groupId, int status)
220                    throws RemoteException {
221                    try {
222                            int returnValue = MBMessageServiceUtil.getGroupMessagesCount(groupId,
223                                            status);
224    
225                            return returnValue;
226                    }
227                    catch (Exception e) {
228                            _log.error(e, e);
229    
230                            throw new RemoteException(e.getMessage());
231                    }
232            }
233    
234            public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
235                    long messageId) throws RemoteException {
236                    try {
237                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
238    
239                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
240                    }
241                    catch (Exception e) {
242                            _log.error(e, e);
243    
244                            throw new RemoteException(e.getMessage());
245                    }
246            }
247    
248            public static int getThreadAnswersCount(long groupId, long categoryId,
249                    long threadId) throws RemoteException {
250                    try {
251                            int returnValue = MBMessageServiceUtil.getThreadAnswersCount(groupId,
252                                            categoryId, threadId);
253    
254                            return returnValue;
255                    }
256                    catch (Exception e) {
257                            _log.error(e, e);
258    
259                            throw new RemoteException(e.getMessage());
260                    }
261            }
262    
263            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
264                    long groupId, long categoryId, long threadId, int status, int start,
265                    int end) throws RemoteException {
266                    try {
267                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
268                                    MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
269                                            threadId, status, start, end);
270    
271                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
272                    }
273                    catch (Exception e) {
274                            _log.error(e, e);
275    
276                            throw new RemoteException(e.getMessage());
277                    }
278            }
279    
280            public static int getThreadMessagesCount(long groupId, long categoryId,
281                    long threadId, int status) throws RemoteException {
282                    try {
283                            int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
284                                            categoryId, threadId, status);
285    
286                            return returnValue;
287                    }
288                    catch (Exception e) {
289                            _log.error(e, e);
290    
291                            throw new RemoteException(e.getMessage());
292                    }
293            }
294    
295            public static void subscribeMessage(long messageId)
296                    throws RemoteException {
297                    try {
298                            MBMessageServiceUtil.subscribeMessage(messageId);
299                    }
300                    catch (Exception e) {
301                            _log.error(e, e);
302    
303                            throw new RemoteException(e.getMessage());
304                    }
305            }
306    
307            public static void unsubscribeMessage(long messageId)
308                    throws RemoteException {
309                    try {
310                            MBMessageServiceUtil.unsubscribeMessage(messageId);
311                    }
312                    catch (Exception e) {
313                            _log.error(e, e);
314    
315                            throw new RemoteException(e.getMessage());
316                    }
317            }
318    
319            public static void updateAnswer(long messageId, boolean answer,
320                    boolean cascade) throws RemoteException {
321                    try {
322                            MBMessageServiceUtil.updateAnswer(messageId, answer, cascade);
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 updateDiscussionMessage(
332                    java.lang.String className, long classPK,
333                    java.lang.String permissionClassName, long permissionClassPK,
334                    long permissionOwnerId, long messageId, java.lang.String subject,
335                    java.lang.String body,
336                    com.liferay.portal.service.ServiceContext serviceContext)
337                    throws RemoteException {
338                    try {
339                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
340                                            classPK, permissionClassName, permissionClassPK,
341                                            permissionOwnerId, messageId, subject, body, serviceContext);
342    
343                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
344                    }
345                    catch (Exception e) {
346                            _log.error(e, e);
347    
348                            throw new RemoteException(e.getMessage());
349                    }
350            }
351    
352            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
353                    long messageId, java.lang.String subject, java.lang.String body,
354                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
355                    java.util.List<java.lang.String> existingFiles, double priority,
356                    boolean allowPingbacks,
357                    com.liferay.portal.service.ServiceContext serviceContext)
358                    throws RemoteException {
359                    try {
360                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
361                                            subject, body, inputStreamOVPs, existingFiles, priority,
362                                            allowPingbacks, serviceContext);
363    
364                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
365                    }
366                    catch (Exception e) {
367                            _log.error(e, e);
368    
369                            throw new RemoteException(e.getMessage());
370                    }
371            }
372    
373            private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
374    }