1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  import com.liferay.portal.kernel.util.ListUtil;
20  
21  import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
22  
23  import java.rmi.RemoteException;
24  
25  /**
26   * <a href="MBCategoryServiceSoap.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides a SOAP utility for the
35   * {@link com.liferay.portlet.messageboards.service.MBCategoryServiceUtil} service utility. The
36   * static methods of this class calls the same methods of the service utility.
37   * However, the signatures are different because it is difficult for SOAP to
38   * support certain types.
39   * </p>
40   *
41   * <p>
42   * ServiceBuilder follows certain rules in translating the methods. For example,
43   * if the method in the service utility returns a {@link java.util.List}, that
44   * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBCategorySoap}.
45   * If the method in the service utility returns a
46   * {@link com.liferay.portlet.messageboards.model.MBCategory}, that is translated to a
47   * {@link com.liferay.portlet.messageboards.model.MBCategorySoap}. Methods that SOAP cannot
48   * safely wire are skipped.
49   * </p>
50   *
51   * <p>
52   * The benefits of using the SOAP utility is that it is cross platform
53   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
54   * even Perl, to call the generated services. One drawback of SOAP is that it is
55   * slow because it needs to serialize all calls into a text format (XML).
56   * </p>
57   *
58   * <p>
59   * You can see a list of services at
60   * http://localhost:8080/tunnel-web/secure/axis. Set the property
61   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
62   * security.
63   * </p>
64   *
65   * <p>
66   * The SOAP utility is only generated for remote services.
67   * </p>
68   *
69   * @author    Brian Wing Shun Chan
70   * @see       MBCategoryServiceHttp
71   * @see       com.liferay.portlet.messageboards.model.MBCategorySoap
72   * @see       com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
73   * @generated
74   */
75  public class MBCategoryServiceSoap {
76      public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
77          long parentCategoryId, java.lang.String name,
78          java.lang.String description, java.lang.String emailAddress,
79          java.lang.String inProtocol, java.lang.String inServerName,
80          int inServerPort, boolean inUseSSL, java.lang.String inUserName,
81          java.lang.String inPassword, int inReadInterval,
82          java.lang.String outEmailAddress, boolean outCustom,
83          java.lang.String outServerName, int outServerPort, boolean outUseSSL,
84          java.lang.String outUserName, java.lang.String outPassword,
85          boolean mailingListActive,
86          com.liferay.portal.service.ServiceContext serviceContext)
87          throws RemoteException {
88          try {
89              com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(parentCategoryId,
90                      name, description, emailAddress, inProtocol, inServerName,
91                      inServerPort, inUseSSL, inUserName, inPassword,
92                      inReadInterval, outEmailAddress, outCustom, outServerName,
93                      outServerPort, outUseSSL, outUserName, outPassword,
94                      mailingListActive, serviceContext);
95  
96              return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
97          }
98          catch (Exception e) {
99              _log.error(e, e);
100 
101             throw new RemoteException(e.getMessage());
102         }
103     }
104 
105     public static void deleteCategory(long groupId, long categoryId)
106         throws RemoteException {
107         try {
108             MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
109         }
110         catch (Exception e) {
111             _log.error(e, e);
112 
113             throw new RemoteException(e.getMessage());
114         }
115     }
116 
117     public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
118         long categoryId) throws RemoteException {
119         try {
120             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
121 
122             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
123         }
124         catch (Exception e) {
125             _log.error(e, e);
126 
127             throw new RemoteException(e.getMessage());
128         }
129     }
130 
131     public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
132         long groupId, long parentCategoryId, int start, int end)
133         throws RemoteException {
134         try {
135             java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
136                 MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
137                     start, end);
138 
139             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
140         }
141         catch (Exception e) {
142             _log.error(e, e);
143 
144             throw new RemoteException(e.getMessage());
145         }
146     }
147 
148     public static int getCategoriesCount(long groupId, long parentCategoryId)
149         throws RemoteException {
150         try {
151             int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
152                     parentCategoryId);
153 
154             return returnValue;
155         }
156         catch (Exception e) {
157             _log.error(e, e);
158 
159             throw new RemoteException(e.getMessage());
160         }
161     }
162 
163     public static java.lang.Long[] getSubcategoryIds(Long[] categoryIds,
164         long groupId, long categoryId) throws RemoteException {
165         try {
166             java.util.List<java.lang.Long> returnValue = MBCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
167                         categoryIds), groupId, categoryId);
168 
169             return returnValue.toArray(new java.lang.Long[returnValue.size()]);
170         }
171         catch (Exception e) {
172             _log.error(e, e);
173 
174             throw new RemoteException(e.getMessage());
175         }
176     }
177 
178     public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getSubscribedCategories(
179         long groupId, long userId, int start, int end)
180         throws RemoteException {
181         try {
182             java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
183                 MBCategoryServiceUtil.getSubscribedCategories(groupId, userId,
184                     start, end);
185 
186             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
187         }
188         catch (Exception e) {
189             _log.error(e, e);
190 
191             throw new RemoteException(e.getMessage());
192         }
193     }
194 
195     public static int getSubscribedCategoriesCount(long groupId, long userId)
196         throws RemoteException {
197         try {
198             int returnValue = MBCategoryServiceUtil.getSubscribedCategoriesCount(groupId,
199                     userId);
200 
201             return returnValue;
202         }
203         catch (Exception e) {
204             _log.error(e, e);
205 
206             throw new RemoteException(e.getMessage());
207         }
208     }
209 
210     public static void subscribeCategory(long groupId, long categoryId)
211         throws RemoteException {
212         try {
213             MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
214         }
215         catch (Exception e) {
216             _log.error(e, e);
217 
218             throw new RemoteException(e.getMessage());
219         }
220     }
221 
222     public static void unsubscribeCategory(long groupId, long categoryId)
223         throws RemoteException {
224         try {
225             MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
226         }
227         catch (Exception e) {
228             _log.error(e, e);
229 
230             throw new RemoteException(e.getMessage());
231         }
232     }
233 
234     public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
235         long categoryId, long parentCategoryId, java.lang.String name,
236         java.lang.String description, java.lang.String emailAddress,
237         java.lang.String inProtocol, java.lang.String inServerName,
238         int inServerPort, boolean inUseSSL, java.lang.String inUserName,
239         java.lang.String inPassword, int inReadInterval,
240         java.lang.String outEmailAddress, boolean outCustom,
241         java.lang.String outServerName, int outServerPort, boolean outUseSSL,
242         java.lang.String outUserName, java.lang.String outPassword,
243         boolean mailingListActive, boolean mergeWithParentCategory,
244         com.liferay.portal.service.ServiceContext serviceContext)
245         throws RemoteException {
246         try {
247             com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
248                     parentCategoryId, name, description, emailAddress,
249                     inProtocol, inServerName, inServerPort, inUseSSL,
250                     inUserName, inPassword, inReadInterval, outEmailAddress,
251                     outCustom, outServerName, outServerPort, outUseSSL,
252                     outUserName, outPassword, mailingListActive,
253                     mergeWithParentCategory, serviceContext);
254 
255             return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
256         }
257         catch (Exception e) {
258             _log.error(e, e);
259 
260             throw new RemoteException(e.getMessage());
261         }
262     }
263 
264     private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
265 }