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