1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.messageboards.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  
28  import com.liferay.portlet.messageboards.service.MBMessageServiceUtil;
29  
30  import java.rmi.RemoteException;
31  
32  /**
33   * <a href="MBMessageServiceSoap.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a SOAP utility for the
42   * <code>com.liferay.portlet.messageboards.service.MBMessageServiceUtil</code> service
43   * utility. The static methods of this class calls the same methods of the
44   * service utility. However, the signatures are different because it is
45   * difficult for SOAP to support certain types.
46   * </p>
47   *
48   * <p>
49   * ServiceBuilder follows certain rules in translating the methods. For example,
50   * if the method in the service utility returns a <code>java.util.List</code>,
51   * that is translated to an array of
52   * <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>. If the method in the
53   * service utility returns a <code>com.liferay.portlet.messageboards.model.MBMessage</code>,
54   * that is translated to a <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>.
55   * Methods that SOAP cannot safely wire are skipped.
56   * </p>
57   *
58   * <p>
59   * The benefits of using the SOAP utility is that it is cross platform
60   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
61   * even Perl, to call the generated services. One drawback of SOAP is that it is
62   * slow because it needs to serialize all calls into a text format (XML).
63   * </p>
64   *
65   * <p>
66   * You can see a list of services at
67   * http://localhost:8080/tunnel-web/secure/axis. Set the property
68   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
69   * security.
70   * </p>
71   *
72   * <p>
73   * The SOAP utility is only generated for remote services.
74   * </p>
75   *
76   * @author Brian Wing Shun Chan
77   *
78   * @see com.liferay.portlet.messageboards.model.MBMessageSoap
79   * @see com.liferay.portlet.messageboards.service.MBMessageServiceUtil
80   * @see com.liferay.portlet.messageboards.service.http.MBMessageServiceHttp
81   *
82   */
83  public class MBMessageServiceSoap {
84      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
85          long categoryId, java.lang.String subject, java.lang.String body,
86          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
87          boolean anonymous, double priority, java.lang.String[] tagsEntries,
88          boolean addCommunityPermissions, boolean addGuestPermissions)
89          throws RemoteException {
90          try {
91              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
92                      subject, body, files, anonymous, priority, tagsEntries,
93                      addCommunityPermissions, addGuestPermissions);
94  
95              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
96          }
97          catch (Exception e) {
98              _log.error(e, e);
99  
100             throw new RemoteException(e.getMessage());
101         }
102     }
103 
104     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
105         long categoryId, java.lang.String subject, java.lang.String body,
106         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
107         boolean anonymous, double priority, java.lang.String[] tagsEntries,
108         java.lang.String[] communityPermissions,
109         java.lang.String[] guestPermissions) throws RemoteException {
110         try {
111             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
112                     subject, body, files, anonymous, priority, tagsEntries,
113                     communityPermissions, guestPermissions);
114 
115             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
116         }
117         catch (Exception e) {
118             _log.error(e, e);
119 
120             throw new RemoteException(e.getMessage());
121         }
122     }
123 
124     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
125         long categoryId, long threadId, long parentMessageId,
126         java.lang.String subject, java.lang.String body,
127         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
128         boolean anonymous, double priority, java.lang.String[] tagsEntries,
129         boolean addCommunityPermissions, boolean addGuestPermissions)
130         throws RemoteException {
131         try {
132             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
133                     threadId, parentMessageId, subject, body, files, anonymous,
134                     priority, tagsEntries, addCommunityPermissions,
135                     addGuestPermissions);
136 
137             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
138         }
139         catch (Exception e) {
140             _log.error(e, e);
141 
142             throw new RemoteException(e.getMessage());
143         }
144     }
145 
146     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
147         long categoryId, long threadId, long parentMessageId,
148         java.lang.String subject, java.lang.String body,
149         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
150         boolean anonymous, double priority, java.lang.String[] tagsEntries,
151         java.lang.String[] communityPermissions,
152         java.lang.String[] guestPermissions) throws RemoteException {
153         try {
154             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
155                     threadId, parentMessageId, subject, body, files, anonymous,
156                     priority, tagsEntries, communityPermissions,
157                     guestPermissions);
158 
159             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
160         }
161         catch (Exception e) {
162             _log.error(e, e);
163 
164             throw new RemoteException(e.getMessage());
165         }
166     }
167 
168     public static void deleteDiscussionMessage(long groupId,
169         java.lang.String className, long classPK, long messageId)
170         throws RemoteException {
171         try {
172             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
173                 classPK, messageId);
174         }
175         catch (Exception e) {
176             _log.error(e, e);
177 
178             throw new RemoteException(e.getMessage());
179         }
180     }
181 
182     public static void deleteMessage(long messageId) throws RemoteException {
183         try {
184             MBMessageServiceUtil.deleteMessage(messageId);
185         }
186         catch (Exception e) {
187             _log.error(e, e);
188 
189             throw new RemoteException(e.getMessage());
190         }
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
194         long categoryId, int start, int end) throws RemoteException {
195         try {
196             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
197                 MBMessageServiceUtil.getCategoryMessages(categoryId, start, end);
198 
199             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
200         }
201         catch (Exception e) {
202             _log.error(e, e);
203 
204             throw new RemoteException(e.getMessage());
205         }
206     }
207 
208     public static int getCategoryMessagesCount(long categoryId)
209         throws RemoteException {
210         try {
211             int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(categoryId);
212 
213             return returnValue;
214         }
215         catch (Exception e) {
216             _log.error(e, e);
217 
218             throw new RemoteException(e.getMessage());
219         }
220     }
221 
222     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
223         long messageId) throws RemoteException {
224         try {
225             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
226 
227             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     public static void subscribeMessage(long messageId)
237         throws RemoteException {
238         try {
239             MBMessageServiceUtil.subscribeMessage(messageId);
240         }
241         catch (Exception e) {
242             _log.error(e, e);
243 
244             throw new RemoteException(e.getMessage());
245         }
246     }
247 
248     public static void unsubscribeMessage(long messageId)
249         throws RemoteException {
250         try {
251             MBMessageServiceUtil.unsubscribeMessage(messageId);
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 updateDiscussionMessage(
261         long groupId, java.lang.String className, long classPK, long messageId,
262         java.lang.String subject, java.lang.String body)
263         throws RemoteException {
264         try {
265             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
266                     className, classPK, messageId, subject, body);
267 
268             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
269         }
270         catch (Exception e) {
271             _log.error(e, e);
272 
273             throw new RemoteException(e.getMessage());
274         }
275     }
276 
277     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
278         long messageId, java.lang.String subject, java.lang.String body,
279         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
280         java.util.List<String> existingFiles, double priority,
281         java.lang.String[] tagsEntries) throws RemoteException {
282         try {
283             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
284                     subject, body, files, existingFiles, priority, tagsEntries);
285 
286             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
287         }
288         catch (Exception e) {
289             _log.error(e, e);
290 
291             throw new RemoteException(e.getMessage());
292         }
293     }
294 
295     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
296 }