1   /**
2    * Copyright (c) 2000-2008 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.service.MBMessageServiceUtil
79   * @see com.liferay.portlet.messageboards.service.http.MBMessageServiceHttp
80   * @see com.liferay.portlet.messageboards.service.model.MBMessageSoap
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 files, boolean anonymous, double priority,
87          java.lang.String[] tagsEntries, boolean addCommunityPermissions,
88          boolean addGuestPermissions) throws RemoteException {
89          try {
90              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
91                      subject, body, files, anonymous, priority, tagsEntries,
92                      addCommunityPermissions, addGuestPermissions);
93  
94              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
95          }
96          catch (Exception e) {
97              _log.error(e, e);
98  
99              throw new RemoteException(e.getMessage());
100         }
101     }
102 
103     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
104         long categoryId, java.lang.String subject, java.lang.String body,
105         java.util.List files, boolean anonymous, double priority,
106         java.lang.String[] tagsEntries,
107         java.lang.String[] communityPermissions,
108         java.lang.String[] guestPermissions) throws RemoteException {
109         try {
110             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
111                     subject, body, files, anonymous, priority, tagsEntries,
112                     communityPermissions, guestPermissions);
113 
114             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
115         }
116         catch (Exception e) {
117             _log.error(e, e);
118 
119             throw new RemoteException(e.getMessage());
120         }
121     }
122 
123     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
124         long categoryId, long threadId, long parentMessageId,
125         java.lang.String subject, java.lang.String body, java.util.List files,
126         boolean anonymous, double priority, java.lang.String[] tagsEntries,
127         boolean addCommunityPermissions, boolean addGuestPermissions)
128         throws RemoteException {
129         try {
130             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
131                     threadId, parentMessageId, subject, body, files, anonymous,
132                     priority, tagsEntries, addCommunityPermissions,
133                     addGuestPermissions);
134 
135             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
136         }
137         catch (Exception e) {
138             _log.error(e, e);
139 
140             throw new RemoteException(e.getMessage());
141         }
142     }
143 
144     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
145         long categoryId, long threadId, long parentMessageId,
146         java.lang.String subject, java.lang.String body, java.util.List files,
147         boolean anonymous, double priority, java.lang.String[] tagsEntries,
148         java.lang.String[] communityPermissions,
149         java.lang.String[] guestPermissions) throws RemoteException {
150         try {
151             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
152                     threadId, parentMessageId, subject, body, files, anonymous,
153                     priority, tagsEntries, communityPermissions,
154                     guestPermissions);
155 
156             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
157         }
158         catch (Exception e) {
159             _log.error(e, e);
160 
161             throw new RemoteException(e.getMessage());
162         }
163     }
164 
165     public static void deleteDiscussionMessage(long groupId,
166         java.lang.String className, long classPK, long messageId)
167         throws RemoteException {
168         try {
169             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
170                 classPK, messageId);
171         }
172         catch (Exception e) {
173             _log.error(e, e);
174 
175             throw new RemoteException(e.getMessage());
176         }
177     }
178 
179     public static void deleteMessage(long messageId) throws RemoteException {
180         try {
181             MBMessageServiceUtil.deleteMessage(messageId);
182         }
183         catch (Exception e) {
184             _log.error(e, e);
185 
186             throw new RemoteException(e.getMessage());
187         }
188     }
189 
190     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
191         long categoryId, int begin, int end) throws RemoteException {
192         try {
193             java.util.List returnValue = MBMessageServiceUtil.getCategoryMessages(categoryId,
194                     begin, end);
195 
196             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
197         }
198         catch (Exception e) {
199             _log.error(e, e);
200 
201             throw new RemoteException(e.getMessage());
202         }
203     }
204 
205     public static int getCategoryMessagesCount(long categoryId)
206         throws RemoteException {
207         try {
208             int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(categoryId);
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 java.lang.String getCategoryMessagesRSS(long categoryId,
220         int max, java.lang.String type, double version,
221         java.lang.String displayStyle, java.lang.String feedURL,
222         java.lang.String entryURL) throws RemoteException {
223         try {
224             java.lang.String returnValue = MBMessageServiceUtil.getCategoryMessagesRSS(categoryId,
225                     max, type, version, displayStyle, feedURL, entryURL);
226 
227             return returnValue;
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     public static java.lang.String getCompanyMessagesRSS(long companyId,
237         int max, java.lang.String type, double version,
238         java.lang.String displayStyle, java.lang.String feedURL,
239         java.lang.String entryURL) throws RemoteException {
240         try {
241             java.lang.String returnValue = MBMessageServiceUtil.getCompanyMessagesRSS(companyId,
242                     max, type, version, displayStyle, feedURL, entryURL);
243 
244             return returnValue;
245         }
246         catch (Exception e) {
247             _log.error(e, e);
248 
249             throw new RemoteException(e.getMessage());
250         }
251     }
252 
253     public static java.lang.String getGroupMessagesRSS(long groupId, int max,
254         java.lang.String type, double version, java.lang.String displayStyle,
255         java.lang.String feedURL, java.lang.String entryURL)
256         throws RemoteException {
257         try {
258             java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
259                     max, type, version, displayStyle, feedURL, entryURL);
260 
261             return returnValue;
262         }
263         catch (Exception e) {
264             _log.error(e, e);
265 
266             throw new RemoteException(e.getMessage());
267         }
268     }
269 
270     public static java.lang.String getGroupMessagesRSS(long groupId,
271         long userId, int max, java.lang.String type, double version,
272         java.lang.String displayStyle, java.lang.String feedURL,
273         java.lang.String entryURL) throws RemoteException {
274         try {
275             java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
276                     userId, max, type, version, displayStyle, feedURL, entryURL);
277 
278             return returnValue;
279         }
280         catch (Exception e) {
281             _log.error(e, e);
282 
283             throw new RemoteException(e.getMessage());
284         }
285     }
286 
287     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
288         long messageId) throws RemoteException {
289         try {
290             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
291 
292             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
293         }
294         catch (Exception e) {
295             _log.error(e, e);
296 
297             throw new RemoteException(e.getMessage());
298         }
299     }
300 
301     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
302         long messageId) throws RemoteException {
303         try {
304             com.liferay.portlet.messageboards.model.MBMessageDisplay returnValue =
305                 MBMessageServiceUtil.getMessageDisplay(messageId);
306 
307             return returnValue;
308         }
309         catch (Exception e) {
310             _log.error(e, e);
311 
312             throw new RemoteException(e.getMessage());
313         }
314     }
315 
316     public static java.lang.String getThreadMessagesRSS(long threadId, int max,
317         java.lang.String type, double version, java.lang.String displayStyle,
318         java.lang.String feedURL, java.lang.String entryURL)
319         throws RemoteException {
320         try {
321             java.lang.String returnValue = MBMessageServiceUtil.getThreadMessagesRSS(threadId,
322                     max, type, version, displayStyle, feedURL, entryURL);
323 
324             return returnValue;
325         }
326         catch (Exception e) {
327             _log.error(e, e);
328 
329             throw new RemoteException(e.getMessage());
330         }
331     }
332 
333     public static void subscribeMessage(long messageId)
334         throws RemoteException {
335         try {
336             MBMessageServiceUtil.subscribeMessage(messageId);
337         }
338         catch (Exception e) {
339             _log.error(e, e);
340 
341             throw new RemoteException(e.getMessage());
342         }
343     }
344 
345     public static void unsubscribeMessage(long messageId)
346         throws RemoteException {
347         try {
348             MBMessageServiceUtil.unsubscribeMessage(messageId);
349         }
350         catch (Exception e) {
351             _log.error(e, e);
352 
353             throw new RemoteException(e.getMessage());
354         }
355     }
356 
357     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
358         long groupId, java.lang.String className, long classPK, long messageId,
359         java.lang.String subject, java.lang.String body)
360         throws RemoteException {
361         try {
362             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
363                     className, classPK, messageId, subject, body);
364 
365             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
366         }
367         catch (Exception e) {
368             _log.error(e, e);
369 
370             throw new RemoteException(e.getMessage());
371         }
372     }
373 
374     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
375         long messageId, java.lang.String subject, java.lang.String body,
376         java.util.List files, double priority, java.lang.String[] tagsEntries)
377         throws RemoteException {
378         try {
379             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
380                     subject, body, files, priority, tagsEntries);
381 
382             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
383         }
384         catch (Exception e) {
385             _log.error(e, e);
386 
387             throw new RemoteException(e.getMessage());
388         }
389     }
390 
391     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
392 }