001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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     * Provides the SOAP utility for the
027     * {@link com.liferay.portlet.messageboards.service.MBCategoryServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBCategorySoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portlet.messageboards.model.MBCategory}, that is translated to a
038     * {@link com.liferay.portlet.messageboards.model.MBCategorySoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see MBCategoryServiceHttp
061     * @see com.liferay.portlet.messageboards.model.MBCategorySoap
062     * @see com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
063     * @generated
064     */
065    public class MBCategoryServiceSoap {
066            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
067                    long userId, long parentCategoryId, java.lang.String name,
068                    java.lang.String description,
069                    com.liferay.portal.service.ServiceContext serviceContext)
070                    throws RemoteException {
071                    try {
072                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(userId,
073                                            parentCategoryId, name, description, serviceContext);
074    
075                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
076                    }
077                    catch (Exception e) {
078                            _log.error(e, e);
079    
080                            throw new RemoteException(e.getMessage());
081                    }
082            }
083    
084            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
085                    long parentCategoryId, java.lang.String name,
086                    java.lang.String description, java.lang.String displayStyle,
087                    java.lang.String emailAddress, java.lang.String inProtocol,
088                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
089                    java.lang.String inUserName, java.lang.String inPassword,
090                    int inReadInterval, java.lang.String outEmailAddress,
091                    boolean outCustom, java.lang.String outServerName, int outServerPort,
092                    boolean outUseSSL, java.lang.String outUserName,
093                    java.lang.String outPassword, boolean mailingListActive,
094                    boolean allowAnonymousEmail,
095                    com.liferay.portal.service.ServiceContext serviceContext)
096                    throws RemoteException {
097                    try {
098                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(parentCategoryId,
099                                            name, description, displayStyle, emailAddress, inProtocol,
100                                            inServerName, inServerPort, inUseSSL, inUserName,
101                                            inPassword, inReadInterval, outEmailAddress, outCustom,
102                                            outServerName, outServerPort, outUseSSL, outUserName,
103                                            outPassword, mailingListActive, allowAnonymousEmail,
104                                            serviceContext);
105    
106                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
107                    }
108                    catch (Exception e) {
109                            _log.error(e, e);
110    
111                            throw new RemoteException(e.getMessage());
112                    }
113            }
114    
115            public static void deleteCategory(long categoryId,
116                    boolean includeTrashedEntries) throws RemoteException {
117                    try {
118                            MBCategoryServiceUtil.deleteCategory(categoryId,
119                                    includeTrashedEntries);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            public static void deleteCategory(long groupId, long categoryId)
129                    throws RemoteException {
130                    try {
131                            MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
132                    }
133                    catch (Exception e) {
134                            _log.error(e, e);
135    
136                            throw new RemoteException(e.getMessage());
137                    }
138            }
139    
140            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
141                    long groupId) throws RemoteException {
142                    try {
143                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
144                                    MBCategoryServiceUtil.getCategories(groupId);
145    
146                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
147                    }
148                    catch (Exception e) {
149                            _log.error(e, e);
150    
151                            throw new RemoteException(e.getMessage());
152                    }
153            }
154    
155            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
156                    long groupId, int status) throws RemoteException {
157                    try {
158                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
159                                    MBCategoryServiceUtil.getCategories(groupId, status);
160    
161                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
162                    }
163                    catch (Exception e) {
164                            _log.error(e, e);
165    
166                            throw new RemoteException(e.getMessage());
167                    }
168            }
169    
170            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
171                    long groupId, long parentCategoryId, int start, int end)
172                    throws RemoteException {
173                    try {
174                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
175                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
176                                            start, end);
177    
178                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
188                    long groupId, long parentCategoryId, int status, int start, int end)
189                    throws RemoteException {
190                    try {
191                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
192                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
193                                            status, start, end);
194    
195                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
205                    long groupId, long[] parentCategoryIds, int start, int end)
206                    throws RemoteException {
207                    try {
208                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
209                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
210                                            start, end);
211    
212                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(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.MBCategorySoap[] getCategories(
222                    long groupId, long[] parentCategoryIds, int status, int start, int end)
223                    throws RemoteException {
224                    try {
225                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
226                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
227                                            status, start, end);
228    
229                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
230                    }
231                    catch (Exception e) {
232                            _log.error(e, e);
233    
234                            throw new RemoteException(e.getMessage());
235                    }
236            }
237    
238            public static int getCategoriesCount(long groupId, long parentCategoryId)
239                    throws RemoteException {
240                    try {
241                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
242                                            parentCategoryId);
243    
244                            return returnValue;
245                    }
246                    catch (Exception e) {
247                            _log.error(e, e);
248    
249                            throw new RemoteException(e.getMessage());
250                    }
251            }
252    
253            public static int getCategoriesCount(long groupId, long parentCategoryId,
254                    int status) throws RemoteException {
255                    try {
256                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
257                                            parentCategoryId, status);
258    
259                            return returnValue;
260                    }
261                    catch (Exception e) {
262                            _log.error(e, e);
263    
264                            throw new RemoteException(e.getMessage());
265                    }
266            }
267    
268            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
269                    throws RemoteException {
270                    try {
271                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
272                                            parentCategoryIds);
273    
274                            return returnValue;
275                    }
276                    catch (Exception e) {
277                            _log.error(e, e);
278    
279                            throw new RemoteException(e.getMessage());
280                    }
281            }
282    
283            public static int getCategoriesCount(long groupId,
284                    long[] parentCategoryIds, int status) throws RemoteException {
285                    try {
286                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
287                                            parentCategoryIds, status);
288    
289                            return returnValue;
290                    }
291                    catch (Exception e) {
292                            _log.error(e, e);
293    
294                            throw new RemoteException(e.getMessage());
295                    }
296            }
297    
298            public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
299                    long categoryId) throws RemoteException {
300                    try {
301                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
302    
303                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
304                    }
305                    catch (Exception e) {
306                            _log.error(e, e);
307    
308                            throw new RemoteException(e.getMessage());
309                    }
310            }
311    
312            public static long[] getCategoryIds(long groupId, long categoryId)
313                    throws RemoteException {
314                    try {
315                            long[] returnValue = MBCategoryServiceUtil.getCategoryIds(groupId,
316                                            categoryId);
317    
318                            return returnValue;
319                    }
320                    catch (Exception e) {
321                            _log.error(e, e);
322    
323                            throw new RemoteException(e.getMessage());
324                    }
325            }
326    
327            public static java.lang.Long[] getSubcategoryIds(Long[] categoryIds,
328                    long groupId, long categoryId) throws RemoteException {
329                    try {
330                            java.util.List<java.lang.Long> returnValue = MBCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
331                                                    categoryIds), groupId, categoryId);
332    
333                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
334                    }
335                    catch (Exception e) {
336                            _log.error(e, e);
337    
338                            throw new RemoteException(e.getMessage());
339                    }
340            }
341    
342            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getSubscribedCategories(
343                    long groupId, long userId, int start, int end)
344                    throws RemoteException {
345                    try {
346                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
347                                    MBCategoryServiceUtil.getSubscribedCategories(groupId, userId,
348                                            start, end);
349    
350                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
351                    }
352                    catch (Exception e) {
353                            _log.error(e, e);
354    
355                            throw new RemoteException(e.getMessage());
356                    }
357            }
358    
359            public static int getSubscribedCategoriesCount(long groupId, long userId)
360                    throws RemoteException {
361                    try {
362                            int returnValue = MBCategoryServiceUtil.getSubscribedCategoriesCount(groupId,
363                                            userId);
364    
365                            return returnValue;
366                    }
367                    catch (Exception e) {
368                            _log.error(e, e);
369    
370                            throw new RemoteException(e.getMessage());
371                    }
372            }
373    
374            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategory(
375                    long categoryId, long parentCategoryId, boolean mergeWithParentCategory)
376                    throws RemoteException {
377                    try {
378                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategory(categoryId,
379                                            parentCategoryId, mergeWithParentCategory);
380    
381                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
382                    }
383                    catch (Exception e) {
384                            _log.error(e, e);
385    
386                            throw new RemoteException(e.getMessage());
387                    }
388            }
389    
390            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategoryFromTrash(
391                    long categoryId, long newCategoryId) throws RemoteException {
392                    try {
393                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategoryFromTrash(categoryId,
394                                            newCategoryId);
395    
396                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
397                    }
398                    catch (Exception e) {
399                            _log.error(e, e);
400    
401                            throw new RemoteException(e.getMessage());
402                    }
403            }
404    
405            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategoryToTrash(
406                    long categoryId) throws RemoteException {
407                    try {
408                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategoryToTrash(categoryId);
409    
410                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
411                    }
412                    catch (Exception e) {
413                            _log.error(e, e);
414    
415                            throw new RemoteException(e.getMessage());
416                    }
417            }
418    
419            public static void restoreCategoryFromTrash(long categoryId)
420                    throws RemoteException {
421                    try {
422                            MBCategoryServiceUtil.restoreCategoryFromTrash(categoryId);
423                    }
424                    catch (Exception e) {
425                            _log.error(e, e);
426    
427                            throw new RemoteException(e.getMessage());
428                    }
429            }
430    
431            public static void subscribeCategory(long groupId, long categoryId)
432                    throws RemoteException {
433                    try {
434                            MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
435                    }
436                    catch (Exception e) {
437                            _log.error(e, e);
438    
439                            throw new RemoteException(e.getMessage());
440                    }
441            }
442    
443            public static void unsubscribeCategory(long groupId, long categoryId)
444                    throws RemoteException {
445                    try {
446                            MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
447                    }
448                    catch (Exception e) {
449                            _log.error(e, e);
450    
451                            throw new RemoteException(e.getMessage());
452                    }
453            }
454    
455            public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
456                    long categoryId, long parentCategoryId, java.lang.String name,
457                    java.lang.String description, java.lang.String displayStyle,
458                    java.lang.String emailAddress, java.lang.String inProtocol,
459                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
460                    java.lang.String inUserName, java.lang.String inPassword,
461                    int inReadInterval, java.lang.String outEmailAddress,
462                    boolean outCustom, java.lang.String outServerName, int outServerPort,
463                    boolean outUseSSL, java.lang.String outUserName,
464                    java.lang.String outPassword, boolean mailingListActive,
465                    boolean allowAnonymousEmail, boolean mergeWithParentCategory,
466                    com.liferay.portal.service.ServiceContext serviceContext)
467                    throws RemoteException {
468                    try {
469                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
470                                            parentCategoryId, name, description, displayStyle,
471                                            emailAddress, inProtocol, inServerName, inServerPort,
472                                            inUseSSL, inUserName, inPassword, inReadInterval,
473                                            outEmailAddress, outCustom, outServerName, outServerPort,
474                                            outUseSSL, outUserName, outPassword, mailingListActive,
475                                            allowAnonymousEmail, mergeWithParentCategory, serviceContext);
476    
477                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
478                    }
479                    catch (Exception e) {
480                            _log.error(e, e);
481    
482                            throw new RemoteException(e.getMessage());
483                    }
484            }
485    
486            private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
487    }