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<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 begin, int end) throws RemoteException {
195         try {
196             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
197                 MBMessageServiceUtil.getCategoryMessages(categoryId, begin, 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 java.lang.String getCategoryMessagesRSS(long categoryId,
223         int max, java.lang.String type, double version,
224         java.lang.String displayStyle, java.lang.String feedURL,
225         java.lang.String entryURL) throws RemoteException {
226         try {
227             java.lang.String returnValue = MBMessageServiceUtil.getCategoryMessagesRSS(categoryId,
228                     max, type, version, displayStyle, feedURL, entryURL);
229 
230             return returnValue;
231         }
232         catch (Exception e) {
233             _log.error(e, e);
234 
235             throw new RemoteException(e.getMessage());
236         }
237     }
238 
239     public static java.lang.String getCompanyMessagesRSS(long companyId,
240         int max, java.lang.String type, double version,
241         java.lang.String displayStyle, java.lang.String feedURL,
242         java.lang.String entryURL) throws RemoteException {
243         try {
244             java.lang.String returnValue = MBMessageServiceUtil.getCompanyMessagesRSS(companyId,
245                     max, type, version, displayStyle, feedURL, entryURL);
246 
247             return returnValue;
248         }
249         catch (Exception e) {
250             _log.error(e, e);
251 
252             throw new RemoteException(e.getMessage());
253         }
254     }
255 
256     public static java.lang.String getGroupMessagesRSS(long groupId, int max,
257         java.lang.String type, double version, java.lang.String displayStyle,
258         java.lang.String feedURL, java.lang.String entryURL)
259         throws RemoteException {
260         try {
261             java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
262                     max, type, version, displayStyle, feedURL, entryURL);
263 
264             return returnValue;
265         }
266         catch (Exception e) {
267             _log.error(e, e);
268 
269             throw new RemoteException(e.getMessage());
270         }
271     }
272 
273     public static java.lang.String getGroupMessagesRSS(long groupId,
274         long userId, int max, java.lang.String type, double version,
275         java.lang.String displayStyle, java.lang.String feedURL,
276         java.lang.String entryURL) throws RemoteException {
277         try {
278             java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
279                     userId, max, type, version, displayStyle, feedURL, entryURL);
280 
281             return returnValue;
282         }
283         catch (Exception e) {
284             _log.error(e, e);
285 
286             throw new RemoteException(e.getMessage());
287         }
288     }
289 
290     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
291         long messageId) throws RemoteException {
292         try {
293             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
294 
295             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
296         }
297         catch (Exception e) {
298             _log.error(e, e);
299 
300             throw new RemoteException(e.getMessage());
301         }
302     }
303 
304     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
305         long messageId) throws RemoteException {
306         try {
307             com.liferay.portlet.messageboards.model.MBMessageDisplay returnValue =
308                 MBMessageServiceUtil.getMessageDisplay(messageId);
309 
310             return returnValue;
311         }
312         catch (Exception e) {
313             _log.error(e, e);
314 
315             throw new RemoteException(e.getMessage());
316         }
317     }
318 
319     public static java.lang.String getThreadMessagesRSS(long threadId, int max,
320         java.lang.String type, double version, java.lang.String displayStyle,
321         java.lang.String feedURL, java.lang.String entryURL)
322         throws RemoteException {
323         try {
324             java.lang.String returnValue = MBMessageServiceUtil.getThreadMessagesRSS(threadId,
325                     max, type, version, displayStyle, feedURL, entryURL);
326 
327             return returnValue;
328         }
329         catch (Exception e) {
330             _log.error(e, e);
331 
332             throw new RemoteException(e.getMessage());
333         }
334     }
335 
336     public static void subscribeMessage(long messageId)
337         throws RemoteException {
338         try {
339             MBMessageServiceUtil.subscribeMessage(messageId);
340         }
341         catch (Exception e) {
342             _log.error(e, e);
343 
344             throw new RemoteException(e.getMessage());
345         }
346     }
347 
348     public static void unsubscribeMessage(long messageId)
349         throws RemoteException {
350         try {
351             MBMessageServiceUtil.unsubscribeMessage(messageId);
352         }
353         catch (Exception e) {
354             _log.error(e, e);
355 
356             throw new RemoteException(e.getMessage());
357         }
358     }
359 
360     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
361         long groupId, java.lang.String className, long classPK, long messageId,
362         java.lang.String subject, java.lang.String body)
363         throws RemoteException {
364         try {
365             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
366                     className, classPK, messageId, subject, body);
367 
368             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
369         }
370         catch (Exception e) {
371             _log.error(e, e);
372 
373             throw new RemoteException(e.getMessage());
374         }
375     }
376 
377     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
378         long messageId, java.lang.String subject, java.lang.String body,
379         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
380         java.util.List<String> existingFiles, double priority,
381         java.lang.String[] tagsEntries) throws RemoteException {
382         try {
383             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
384                     subject, body, files, existingFiles, priority, tagsEntries);
385 
386             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
387         }
388         catch (Exception e) {
389             _log.error(e, e);
390 
391             throw new RemoteException(e.getMessage());
392         }
393     }
394 
395     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
396 }