1   /**
2    * Copyright (c) 2000-2007 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 overwritten
37   * the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a SOAP utility for the <code>com.liferay.portlet.messageboards.service.MBMessageServiceUtil</code>
42   * service utility. The static methods of this class calls the same methods of the
43   * service utility. However, the signatures are different because it is difficult
44   * for SOAP to support certain types.
45   * </p>
46   *
47   * <p>
48   * ServiceBuilder follows certain rules in translating the methods. For example,
49   * if the method in the service utility returns a <code>java.util.List</code>, that
50   * is translated to an array of <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>.
51   * If the method in the service utility returns a <code>com.liferay.portlet.messageboards.model.MBMessage</code>,
52   * that is translated to a <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>.
53   * Methods that SOAP cannot safely wire are skipped.
54   * </p>
55   *
56   * <p>
57   * The benefits of using the SOAP utility is that it is cross platform compatible.
58   * SOAP allows different languages like Java, .NET, C++, PHP, and even Perl, to
59   * call the generated services. One drawback of SOAP is that it is slow because
60   * it needs to serialize all calls into a text format (XML).
61   * </p>
62   *
63   * <p>
64   * You can see a list of services at http://localhost:8080/tunnel-web/secure/axis.
65   * Set the property <code>tunnel.servlet.hosts.allowed</code> in portal.properties
66   * to configure security.
67   * </p>
68   *
69   * <p>
70   * The SOAP utility is only generated for remote services.
71   * </p>
72   *
73   * @author Brian Wing Shun Chan
74   *
75   * @see com.liferay.portlet.messageboards.service.MBMessageServiceUtil
76   * @see com.liferay.portlet.messageboards.service.http.MBMessageServiceHttp
77   * @see com.liferay.portlet.messageboards.service.model.MBMessageSoap
78   *
79   */
80  public class MBMessageServiceSoap {
81      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
82          long categoryId, java.lang.String subject, java.lang.String body,
83          java.util.List files, boolean anonymous, double priority,
84          java.lang.String[] tagsEntries, boolean addCommunityPermissions,
85          boolean addGuestPermissions) throws RemoteException {
86          try {
87              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
88                      subject, body, files, anonymous, priority, tagsEntries,
89                      addCommunityPermissions, addGuestPermissions);
90  
91              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
92          }
93          catch (Exception e) {
94              _log.error(e, e);
95              throw new RemoteException(e.getMessage());
96          }
97      }
98  
99      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
100         long categoryId, long threadId, long parentMessageId,
101         java.lang.String subject, java.lang.String body, java.util.List files,
102         boolean anonymous, double priority, java.lang.String[] tagsEntries,
103         boolean addCommunityPermissions, boolean addGuestPermissions)
104         throws RemoteException {
105         try {
106             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
107                     threadId, parentMessageId, subject, body, files, anonymous,
108                     priority, tagsEntries, addCommunityPermissions,
109                     addGuestPermissions);
110 
111             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
112         }
113         catch (Exception e) {
114             _log.error(e, e);
115             throw new RemoteException(e.getMessage());
116         }
117     }
118 
119     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
120         long categoryId, java.lang.String subject, java.lang.String body,
121         java.util.List files, boolean anonymous, double priority,
122         java.lang.String[] tagsEntries,
123         java.lang.String[] communityPermissions,
124         java.lang.String[] guestPermissions) throws RemoteException {
125         try {
126             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
127                     subject, body, files, anonymous, priority, tagsEntries,
128                     communityPermissions, guestPermissions);
129 
130             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
131         }
132         catch (Exception e) {
133             _log.error(e, e);
134             throw new RemoteException(e.getMessage());
135         }
136     }
137 
138     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
139         long categoryId, long threadId, long parentMessageId,
140         java.lang.String subject, java.lang.String body, java.util.List files,
141         boolean anonymous, double priority, java.lang.String[] tagsEntries,
142         java.lang.String[] communityPermissions,
143         java.lang.String[] guestPermissions) throws RemoteException {
144         try {
145             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
146                     threadId, parentMessageId, subject, body, files, anonymous,
147                     priority, tagsEntries, communityPermissions,
148                     guestPermissions);
149 
150             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
151         }
152         catch (Exception e) {
153             _log.error(e, e);
154             throw new RemoteException(e.getMessage());
155         }
156     }
157 
158     public static void deleteDiscussionMessage(long groupId,
159         java.lang.String className, long classPK, long messageId)
160         throws RemoteException {
161         try {
162             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
163                 classPK, messageId);
164         }
165         catch (Exception e) {
166             _log.error(e, e);
167             throw new RemoteException(e.getMessage());
168         }
169     }
170 
171     public static void deleteMessage(long messageId) throws RemoteException {
172         try {
173             MBMessageServiceUtil.deleteMessage(messageId);
174         }
175         catch (Exception e) {
176             _log.error(e, e);
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
182         long messageId) throws RemoteException {
183         try {
184             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
185 
186             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
187         }
188         catch (Exception e) {
189             _log.error(e, e);
190             throw new RemoteException(e.getMessage());
191         }
192     }
193 
194     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
195         long messageId) throws RemoteException {
196         try {
197             com.liferay.portlet.messageboards.model.MBMessageDisplay returnValue =
198                 MBMessageServiceUtil.getMessageDisplay(messageId);
199 
200             return returnValue;
201         }
202         catch (Exception e) {
203             _log.error(e, e);
204             throw new RemoteException(e.getMessage());
205         }
206     }
207 
208     public static void subscribeMessage(long messageId)
209         throws RemoteException {
210         try {
211             MBMessageServiceUtil.subscribeMessage(messageId);
212         }
213         catch (Exception e) {
214             _log.error(e, e);
215             throw new RemoteException(e.getMessage());
216         }
217     }
218 
219     public static void unsubscribeMessage(long messageId)
220         throws RemoteException {
221         try {
222             MBMessageServiceUtil.unsubscribeMessage(messageId);
223         }
224         catch (Exception e) {
225             _log.error(e, e);
226             throw new RemoteException(e.getMessage());
227         }
228     }
229 
230     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
231         long groupId, java.lang.String className, long classPK, long messageId,
232         java.lang.String subject, java.lang.String body)
233         throws RemoteException {
234         try {
235             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
236                     className, classPK, messageId, subject, body);
237 
238             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
239         }
240         catch (Exception e) {
241             _log.error(e, e);
242             throw new RemoteException(e.getMessage());
243         }
244     }
245 
246     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
247         long messageId, long categoryId, java.lang.String subject,
248         java.lang.String body, java.util.List files, double priority,
249         java.lang.String[] tagsEntries) throws RemoteException {
250         try {
251             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
252                     categoryId, subject, body, files, priority, tagsEntries);
253 
254             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
255         }
256         catch (Exception e) {
257             _log.error(e, e);
258             throw new RemoteException(e.getMessage());
259         }
260     }
261 
262     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
263 }