001    /**
002     * Copyright (c) 2000-2010 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/tunnel-web/secure/axis. Set the property
053     * <b>tunnel.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 threadId, long parentMessageId, java.lang.String subject,
072                    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                                            threadId, parentMessageId, subject, 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            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
090                    long groupId, long categoryId, long threadId, long parentMessageId,
091                    java.lang.String subject, java.lang.String body,
092                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
093                    boolean anonymous, double priority, boolean allowPingbacks,
094                    com.liferay.portal.service.ServiceContext serviceContext)
095                    throws RemoteException {
096                    try {
097                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
098                                            categoryId, threadId, parentMessageId, subject, body,
099                                            files, anonymous, priority, allowPingbacks, serviceContext);
100    
101                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
102                    }
103                    catch (Exception e) {
104                            _log.error(e, e);
105    
106                            throw new RemoteException(e.getMessage());
107                    }
108            }
109    
110            public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
111                    long groupId, long categoryId, java.lang.String subject,
112                    java.lang.String body,
113                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
114                    boolean anonymous, double priority, boolean allowPingbacks,
115                    com.liferay.portal.service.ServiceContext serviceContext)
116                    throws RemoteException {
117                    try {
118                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
119                                            categoryId, subject, body, files, anonymous, priority,
120                                            allowPingbacks, serviceContext);
121    
122                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
123                    }
124                    catch (Exception e) {
125                            _log.error(e, e);
126    
127                            throw new RemoteException(e.getMessage());
128                    }
129            }
130    
131            public static void deleteDiscussionMessage(long groupId,
132                    java.lang.String className, long classPK,
133                    java.lang.String permissionClassName, long permissionClassPK,
134                    long messageId) throws RemoteException {
135                    try {
136                            MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
137                                    classPK, permissionClassName, permissionClassPK, messageId);
138                    }
139                    catch (Exception e) {
140                            _log.error(e, e);
141    
142                            throw new RemoteException(e.getMessage());
143                    }
144            }
145    
146            public static void deleteMessage(long messageId) throws RemoteException {
147                    try {
148                            MBMessageServiceUtil.deleteMessage(messageId);
149                    }
150                    catch (Exception e) {
151                            _log.error(e, e);
152    
153                            throw new RemoteException(e.getMessage());
154                    }
155            }
156    
157            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
158                    long groupId, long categoryId, int status, int start, int end)
159                    throws RemoteException {
160                    try {
161                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
162                                    MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
163                                            status, start, end);
164    
165                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
166                    }
167                    catch (Exception e) {
168                            _log.error(e, e);
169    
170                            throw new RemoteException(e.getMessage());
171                    }
172            }
173    
174            public static int getCategoryMessagesCount(long groupId, long categoryId,
175                    int status) throws RemoteException {
176                    try {
177                            int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
178                                            categoryId, status);
179    
180                            return returnValue;
181                    }
182                    catch (Exception e) {
183                            _log.error(e, e);
184    
185                            throw new RemoteException(e.getMessage());
186                    }
187            }
188    
189            public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
190                    long messageId) throws RemoteException {
191                    try {
192                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
193    
194                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
204                    long groupId, long categoryId, long threadId, int status, int start,
205                    int end) throws RemoteException {
206                    try {
207                            java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
208                                    MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
209                                            threadId, status, start, end);
210    
211                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
212                    }
213                    catch (Exception e) {
214                            _log.error(e, e);
215    
216                            throw new RemoteException(e.getMessage());
217                    }
218            }
219    
220            public static int getThreadMessagesCount(long groupId, long categoryId,
221                    long threadId, int status) throws RemoteException {
222                    try {
223                            int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
224                                            categoryId, threadId, status);
225    
226                            return returnValue;
227                    }
228                    catch (Exception e) {
229                            _log.error(e, e);
230    
231                            throw new RemoteException(e.getMessage());
232                    }
233            }
234    
235            public static void subscribeMessage(long messageId)
236                    throws RemoteException {
237                    try {
238                            MBMessageServiceUtil.subscribeMessage(messageId);
239                    }
240                    catch (Exception e) {
241                            _log.error(e, e);
242    
243                            throw new RemoteException(e.getMessage());
244                    }
245            }
246    
247            public static void unsubscribeMessage(long messageId)
248                    throws RemoteException {
249                    try {
250                            MBMessageServiceUtil.unsubscribeMessage(messageId);
251                    }
252                    catch (Exception e) {
253                            _log.error(e, e);
254    
255                            throw new RemoteException(e.getMessage());
256                    }
257            }
258    
259            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
260                    java.lang.String className, long classPK,
261                    java.lang.String permissionClassName, long permissionClassPK,
262                    long messageId, java.lang.String subject, java.lang.String body,
263                    com.liferay.portal.service.ServiceContext serviceContext)
264                    throws RemoteException {
265                    try {
266                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
267                                            classPK, permissionClassName, permissionClassPK, messageId,
268                                            subject, body, serviceContext);
269    
270                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
271                    }
272                    catch (Exception e) {
273                            _log.error(e, e);
274    
275                            throw new RemoteException(e.getMessage());
276                    }
277            }
278    
279            public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
280                    long messageId, java.lang.String subject, java.lang.String body,
281                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
282                    java.util.List<java.lang.String> existingFiles, double priority,
283                    boolean allowPingbacks,
284                    com.liferay.portal.service.ServiceContext serviceContext)
285                    throws RemoteException {
286                    try {
287                            com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
288                                            subject, body, files, existingFiles, priority,
289                                            allowPingbacks, serviceContext);
290    
291                            return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
292                    }
293                    catch (Exception e) {
294                            _log.error(e, e);
295    
296                            throw new RemoteException(e.getMessage());
297                    }
298            }
299    
300            private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
301    }