1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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   * {@link com.liferay.portlet.messageboards.service.MBMessageServiceUtil} service utility. The
43   * static methods of this class calls the same methods of the service utility.
44   * However, the signatures are different because it is difficult for SOAP to
45   * 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 {@link java.util.List}, that
51   * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBMessageSoap}.
52   * If the method in the service utility returns a
53   * {@link com.liferay.portlet.messageboards.model.MBMessage}, that is translated to a
54   * {@link com.liferay.portlet.messageboards.model.MBMessageSoap}. Methods that SOAP cannot
55   * 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   * <b>tunnel.servlet.hosts.allowed</b> 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   * @see       MBMessageServiceHttp
78   * @see       com.liferay.portlet.messageboards.model.MBMessageSoap
79   * @see       com.liferay.portlet.messageboards.service.MBMessageServiceUtil
80   * @generated
81   */
82  public class MBMessageServiceSoap {
83      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
84          long categoryId, java.lang.String subject, java.lang.String body,
85          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
86          boolean anonymous, double priority, java.lang.String[] tagsEntries,
87          boolean addCommunityPermissions, boolean addGuestPermissions)
88          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<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
106         boolean anonymous, double priority, 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,
126         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
127         boolean anonymous, double priority, java.lang.String[] tagsEntries,
128         boolean addCommunityPermissions, boolean addGuestPermissions)
129         throws RemoteException {
130         try {
131             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
132                     threadId, parentMessageId, subject, body, files, anonymous,
133                     priority, tagsEntries, addCommunityPermissions,
134                     addGuestPermissions);
135 
136             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
137         }
138         catch (Exception e) {
139             _log.error(e, e);
140 
141             throw new RemoteException(e.getMessage());
142         }
143     }
144 
145     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
146         long categoryId, long threadId, long parentMessageId,
147         java.lang.String subject, java.lang.String body,
148         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
149         boolean anonymous, double priority, java.lang.String[] tagsEntries,
150         java.lang.String[] communityPermissions,
151         java.lang.String[] guestPermissions) throws RemoteException {
152         try {
153             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
154                     threadId, parentMessageId, subject, body, files, anonymous,
155                     priority, tagsEntries, communityPermissions,
156                     guestPermissions);
157 
158             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
159         }
160         catch (Exception e) {
161             _log.error(e, e);
162 
163             throw new RemoteException(e.getMessage());
164         }
165     }
166 
167     public static void deleteDiscussionMessage(long groupId,
168         java.lang.String className, long classPK, long messageId)
169         throws RemoteException {
170         try {
171             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
172                 classPK, messageId);
173         }
174         catch (Exception e) {
175             _log.error(e, e);
176 
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static void deleteMessage(long messageId) throws RemoteException {
182         try {
183             MBMessageServiceUtil.deleteMessage(messageId);
184         }
185         catch (Exception e) {
186             _log.error(e, e);
187 
188             throw new RemoteException(e.getMessage());
189         }
190     }
191 
192     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
193         long categoryId, int start, int end) throws RemoteException {
194         try {
195             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
196                 MBMessageServiceUtil.getCategoryMessages(categoryId, start, end);
197 
198             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
199         }
200         catch (Exception e) {
201             _log.error(e, e);
202 
203             throw new RemoteException(e.getMessage());
204         }
205     }
206 
207     public static int getCategoryMessagesCount(long categoryId)
208         throws RemoteException {
209         try {
210             int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(categoryId);
211 
212             return returnValue;
213         }
214         catch (Exception e) {
215             _log.error(e, e);
216 
217             throw new RemoteException(e.getMessage());
218         }
219     }
220 
221     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
222         long messageId) throws RemoteException {
223         try {
224             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
225 
226             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
227         }
228         catch (Exception e) {
229             _log.error(e, e);
230 
231             throw new RemoteException(e.getMessage());
232         }
233     }
234 
235     public static void subscribeMessage(long messageId)
236         throws RemoteException {
237         try {
238             MBMessageServiceUtil.subscribeMessage(messageId);
239         }
240         catch (Exception e) {
241             _log.error(e, e);
242 
243             throw new RemoteException(e.getMessage());
244         }
245     }
246 
247     public static void unsubscribeMessage(long messageId)
248         throws RemoteException {
249         try {
250             MBMessageServiceUtil.unsubscribeMessage(messageId);
251         }
252         catch (Exception e) {
253             _log.error(e, e);
254 
255             throw new RemoteException(e.getMessage());
256         }
257     }
258 
259     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
260         long groupId, java.lang.String className, long classPK, long messageId,
261         java.lang.String subject, java.lang.String body)
262         throws RemoteException {
263         try {
264             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
265                     className, classPK, messageId, subject, body);
266 
267             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
268         }
269         catch (Exception e) {
270             _log.error(e, e);
271 
272             throw new RemoteException(e.getMessage());
273         }
274     }
275 
276     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
277         long messageId, java.lang.String subject, java.lang.String body,
278         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
279         java.util.List<String> existingFiles, double priority,
280         java.lang.String[] tagsEntries) throws RemoteException {
281         try {
282             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
283                     subject, body, files, existingFiles, priority, tagsEntries);
284 
285             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
286         }
287         catch (Exception e) {
288             _log.error(e, e);
289 
290             throw new RemoteException(e.getMessage());
291         }
292     }
293 
294     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
295 }