001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.messageboards.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.ListUtil;
020    
021    import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * <p>
027     * This class provides a SOAP utility for the
028     * {@link com.liferay.portlet.messageboards.service.MBCategoryServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it is difficult for SOAP to
031     * support certain types.
032     * </p>
033     *
034     * <p>
035     * ServiceBuilder follows certain rules in translating the methods. For example,
036     * if the method in the service utility returns a {@link java.util.List}, that
037     * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBCategorySoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portlet.messageboards.model.MBCategory}, that is translated to a
040     * {@link com.liferay.portlet.messageboards.model.MBCategorySoap}. Methods that SOAP cannot
041     * safely wire are skipped.
042     * </p>
043     *
044     * <p>
045     * The benefits of using the SOAP utility is that it is cross platform
046     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
047     * even Perl, to call the generated services. One drawback of SOAP is that it is
048     * slow because it needs to serialize all calls into a text format (XML).
049     * </p>
050     *
051     * <p>
052     * You can see a list of services at
053     * http://localhost:8080/tunnel-web/secure/axis. Set the property
054     * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
055     * security.
056     * </p>
057     *
058     * <p>
059     * The SOAP utility is only generated for remote services.
060     * </p>
061     *
062     * @author    Brian Wing Shun Chan
063     * @see       MBCategoryServiceHttp
064     * @see       com.liferay.portlet.messageboards.model.MBCategorySoap
065     * @see       com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
066     * @generated
067     */
068    public class MBCategoryServiceSoap {
069            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
070                    long parentCategoryId, java.lang.String name,
071                    java.lang.String description, java.lang.String emailAddress,
072                    java.lang.String inProtocol, java.lang.String inServerName,
073                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
074                    java.lang.String inPassword, int inReadInterval,
075                    java.lang.String outEmailAddress, boolean outCustom,
076                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
077                    java.lang.String outUserName, java.lang.String outPassword,
078                    boolean mailingListActive,
079                    com.liferay.portal.service.ServiceContext serviceContext)
080                    throws RemoteException {
081                    try {
082                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(parentCategoryId,
083                                            name, description, emailAddress, inProtocol, inServerName,
084                                            inServerPort, inUseSSL, inUserName, inPassword,
085                                            inReadInterval, outEmailAddress, outCustom, outServerName,
086                                            outServerPort, outUseSSL, outUserName, outPassword,
087                                            mailingListActive, serviceContext);
088    
089                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
090                    }
091                    catch (Exception e) {
092                            _log.error(e, e);
093    
094                            throw new RemoteException(e.getMessage());
095                    }
096            }
097    
098            public static void deleteCategory(long groupId, long categoryId)
099                    throws RemoteException {
100                    try {
101                            MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
102                    }
103                    catch (Exception e) {
104                            _log.error(e, e);
105    
106                            throw new RemoteException(e.getMessage());
107                    }
108            }
109    
110            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
111                    long groupId, long parentCategoryId, int start, int end)
112                    throws RemoteException {
113                    try {
114                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
115                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
116                                            start, end);
117    
118                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
119                    }
120                    catch (Exception e) {
121                            _log.error(e, e);
122    
123                            throw new RemoteException(e.getMessage());
124                    }
125            }
126    
127            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
128                    long groupId, long[] parentCategoryIds, int start, int end)
129                    throws RemoteException {
130                    try {
131                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
132                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
133                                            start, end);
134    
135                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
136                    }
137                    catch (Exception e) {
138                            _log.error(e, e);
139    
140                            throw new RemoteException(e.getMessage());
141                    }
142            }
143    
144            public static int getCategoriesCount(long groupId, long parentCategoryId)
145                    throws RemoteException {
146                    try {
147                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
148                                            parentCategoryId);
149    
150                            return returnValue;
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
160                    throws RemoteException {
161                    try {
162                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
163                                            parentCategoryIds);
164    
165                            return returnValue;
166                    }
167                    catch (Exception e) {
168                            _log.error(e, e);
169    
170                            throw new RemoteException(e.getMessage());
171                    }
172            }
173    
174            public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
175                    long categoryId) throws RemoteException {
176                    try {
177                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
178    
179                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
180                    }
181                    catch (Exception e) {
182                            _log.error(e, e);
183    
184                            throw new RemoteException(e.getMessage());
185                    }
186            }
187    
188            public static long[] getCategoryIds(long groupId, long categoryId)
189                    throws RemoteException {
190                    try {
191                            long[] returnValue = MBCategoryServiceUtil.getCategoryIds(groupId,
192                                            categoryId);
193    
194                            return returnValue;
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            public static java.lang.Long[] getSubcategoryIds(Long[] categoryIds,
204                    long groupId, long categoryId) throws RemoteException {
205                    try {
206                            java.util.List<java.lang.Long> returnValue = MBCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
207                                                    categoryIds), groupId, categoryId);
208    
209                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
210                    }
211                    catch (Exception e) {
212                            _log.error(e, e);
213    
214                            throw new RemoteException(e.getMessage());
215                    }
216            }
217    
218            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getSubscribedCategories(
219                    long groupId, long userId, int start, int end)
220                    throws RemoteException {
221                    try {
222                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
223                                    MBCategoryServiceUtil.getSubscribedCategories(groupId, userId,
224                                            start, end);
225    
226                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
227                    }
228                    catch (Exception e) {
229                            _log.error(e, e);
230    
231                            throw new RemoteException(e.getMessage());
232                    }
233            }
234    
235            public static int getSubscribedCategoriesCount(long groupId, long userId)
236                    throws RemoteException {
237                    try {
238                            int returnValue = MBCategoryServiceUtil.getSubscribedCategoriesCount(groupId,
239                                            userId);
240    
241                            return returnValue;
242                    }
243                    catch (Exception e) {
244                            _log.error(e, e);
245    
246                            throw new RemoteException(e.getMessage());
247                    }
248            }
249    
250            public static void subscribeCategory(long groupId, long categoryId)
251                    throws RemoteException {
252                    try {
253                            MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
254                    }
255                    catch (Exception e) {
256                            _log.error(e, e);
257    
258                            throw new RemoteException(e.getMessage());
259                    }
260            }
261    
262            public static void unsubscribeCategory(long groupId, long categoryId)
263                    throws RemoteException {
264                    try {
265                            MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
266                    }
267                    catch (Exception e) {
268                            _log.error(e, e);
269    
270                            throw new RemoteException(e.getMessage());
271                    }
272            }
273    
274            public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
275                    long categoryId, long parentCategoryId, java.lang.String name,
276                    java.lang.String description, java.lang.String emailAddress,
277                    java.lang.String inProtocol, java.lang.String inServerName,
278                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
279                    java.lang.String inPassword, int inReadInterval,
280                    java.lang.String outEmailAddress, boolean outCustom,
281                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
282                    java.lang.String outUserName, java.lang.String outPassword,
283                    boolean mailingListActive, boolean mergeWithParentCategory,
284                    com.liferay.portal.service.ServiceContext serviceContext)
285                    throws RemoteException {
286                    try {
287                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
288                                            parentCategoryId, name, description, emailAddress,
289                                            inProtocol, inServerName, inServerPort, inUseSSL,
290                                            inUserName, inPassword, inReadInterval, outEmailAddress,
291                                            outCustom, outServerName, outServerPort, outUseSSL,
292                                            outUserName, outPassword, mailingListActive,
293                                            mergeWithParentCategory, serviceContext);
294    
295                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
296                    }
297                    catch (Exception e) {
298                            _log.error(e, e);
299    
300                            throw new RemoteException(e.getMessage());
301                    }
302            }
303    
304            private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
305    }