1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.messageboards.service.http;
21  
22  import com.liferay.portal.kernel.log.Log;
23  import com.liferay.portal.kernel.log.LogFactoryUtil;
24  
25  import com.liferay.portlet.messageboards.service.MBMessageServiceUtil;
26  
27  import java.rmi.RemoteException;
28  
29  /**
30   * <a href="MBMessageServiceSoap.java.html"><b><i>View Source</i></b></a>
31   *
32   * <p>
33   * ServiceBuilder generated this class. Modifications in this class will be
34   * overwritten the next time is generated.
35   * </p>
36   *
37   * <p>
38   * This class provides a SOAP utility for the
39   * <code>com.liferay.portlet.messageboards.service.MBMessageServiceUtil</code> service
40   * utility. The static methods of this class calls the same methods of the
41   * service utility. However, the signatures are different because it is
42   * difficult for SOAP to support certain types.
43   * </p>
44   *
45   * <p>
46   * ServiceBuilder follows certain rules in translating the methods. For example,
47   * if the method in the service utility returns a <code>java.util.List</code>,
48   * that is translated to an array of
49   * <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>. If the method in the
50   * service utility returns a <code>com.liferay.portlet.messageboards.model.MBMessage</code>,
51   * that is translated to a <code>com.liferay.portlet.messageboards.model.MBMessageSoap</code>.
52   * Methods that SOAP cannot safely wire are skipped.
53   * </p>
54   *
55   * <p>
56   * The benefits of using the SOAP utility is that it is cross platform
57   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
58   * even Perl, to call the generated services. One drawback of SOAP is that it is
59   * slow because it needs to serialize all calls into a text format (XML).
60   * </p>
61   *
62   * <p>
63   * You can see a list of services at
64   * http://localhost:8080/tunnel-web/secure/axis. Set the property
65   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
66   * 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.model.MBMessageSoap
76   * @see com.liferay.portlet.messageboards.service.MBMessageServiceUtil
77   * @see com.liferay.portlet.messageboards.service.http.MBMessageServiceHttp
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<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
84          boolean anonymous, double priority, java.lang.String[] tagsEntries,
85          boolean addCommunityPermissions, boolean addGuestPermissions)
86          throws RemoteException {
87          try {
88              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
89                      subject, body, files, anonymous, priority, tagsEntries,
90                      addCommunityPermissions, addGuestPermissions);
91  
92              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
93          }
94          catch (Exception e) {
95              _log.error(e, e);
96  
97              throw new RemoteException(e.getMessage());
98          }
99      }
100 
101     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
102         long categoryId, java.lang.String subject, java.lang.String body,
103         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
104         boolean anonymous, double priority, java.lang.String[] tagsEntries,
105         java.lang.String[] communityPermissions,
106         java.lang.String[] guestPermissions) throws RemoteException {
107         try {
108             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
109                     subject, body, files, anonymous, priority, tagsEntries,
110                     communityPermissions, guestPermissions);
111 
112             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
113         }
114         catch (Exception e) {
115             _log.error(e, e);
116 
117             throw new RemoteException(e.getMessage());
118         }
119     }
120 
121     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
122         long categoryId, long threadId, long parentMessageId,
123         java.lang.String subject, java.lang.String body,
124         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
125         boolean anonymous, double priority, java.lang.String[] tagsEntries,
126         boolean addCommunityPermissions, boolean addGuestPermissions)
127         throws RemoteException {
128         try {
129             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
130                     threadId, parentMessageId, subject, body, files, anonymous,
131                     priority, tagsEntries, addCommunityPermissions,
132                     addGuestPermissions);
133 
134             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
135         }
136         catch (Exception e) {
137             _log.error(e, e);
138 
139             throw new RemoteException(e.getMessage());
140         }
141     }
142 
143     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
144         long categoryId, long threadId, long parentMessageId,
145         java.lang.String subject, java.lang.String body,
146         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> 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 start, int end) throws RemoteException {
192         try {
193             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
194                 MBMessageServiceUtil.getCategoryMessages(categoryId, start, 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 com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
220         long messageId) throws RemoteException {
221         try {
222             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
223 
224             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
225         }
226         catch (Exception e) {
227             _log.error(e, e);
228 
229             throw new RemoteException(e.getMessage());
230         }
231     }
232 
233     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
234         long messageId) throws RemoteException {
235         try {
236             com.liferay.portlet.messageboards.model.MBMessageDisplay returnValue =
237                 MBMessageServiceUtil.getMessageDisplay(messageId);
238 
239             return returnValue;
240         }
241         catch (Exception e) {
242             _log.error(e, e);
243 
244             throw new RemoteException(e.getMessage());
245         }
246     }
247 
248     public static void subscribeMessage(long messageId)
249         throws RemoteException {
250         try {
251             MBMessageServiceUtil.subscribeMessage(messageId);
252         }
253         catch (Exception e) {
254             _log.error(e, e);
255 
256             throw new RemoteException(e.getMessage());
257         }
258     }
259 
260     public static void unsubscribeMessage(long messageId)
261         throws RemoteException {
262         try {
263             MBMessageServiceUtil.unsubscribeMessage(messageId);
264         }
265         catch (Exception e) {
266             _log.error(e, e);
267 
268             throw new RemoteException(e.getMessage());
269         }
270     }
271 
272     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
273         long groupId, java.lang.String className, long classPK, long messageId,
274         java.lang.String subject, java.lang.String body)
275         throws RemoteException {
276         try {
277             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
278                     className, classPK, messageId, subject, body);
279 
280             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
281         }
282         catch (Exception e) {
283             _log.error(e, e);
284 
285             throw new RemoteException(e.getMessage());
286         }
287     }
288 
289     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
290         long messageId, java.lang.String subject, java.lang.String body,
291         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
292         java.util.List<String> existingFiles, double priority,
293         java.lang.String[] tagsEntries) throws RemoteException {
294         try {
295             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
296                     subject, body, files, existingFiles, priority, tagsEntries);
297 
298             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
299         }
300         catch (Exception e) {
301             _log.error(e, e);
302 
303             throw new RemoteException(e.getMessage());
304         }
305     }
306 
307     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
308 }