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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.ListUtil;
022    
023    import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
024    
025    import java.rmi.RemoteException;
026    
027    /**
028     * Provides the SOAP utility for the
029     * {@link com.liferay.portlet.messageboards.service.MBCategoryServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it is difficult for SOAP to
032     * support certain types.
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 http://localhost:8080/api/axis. Set the
053     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
054     * security.
055     * </p>
056     *
057     * <p>
058     * The SOAP utility is only generated for remote services.
059     * </p>
060     *
061     * @author Brian Wing Shun Chan
062     * @see MBCategoryServiceHttp
063     * @see com.liferay.portlet.messageboards.model.MBCategorySoap
064     * @see com.liferay.portlet.messageboards.service.MBCategoryServiceUtil
065     * @generated
066     */
067    @ProviderType
068    public class MBCategoryServiceSoap {
069            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
070                    long userId, long parentCategoryId, java.lang.String name,
071                    java.lang.String description,
072                    com.liferay.portal.service.ServiceContext serviceContext)
073                    throws RemoteException {
074                    try {
075                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(userId,
076                                            parentCategoryId, name, description, serviceContext);
077    
078                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
079                    }
080                    catch (Exception e) {
081                            _log.error(e, e);
082    
083                            throw new RemoteException(e.getMessage());
084                    }
085            }
086    
087            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
088                    long parentCategoryId, java.lang.String name,
089                    java.lang.String description, java.lang.String displayStyle,
090                    java.lang.String emailAddress, java.lang.String inProtocol,
091                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
092                    java.lang.String inUserName, java.lang.String inPassword,
093                    int inReadInterval, java.lang.String outEmailAddress,
094                    boolean outCustom, java.lang.String outServerName, int outServerPort,
095                    boolean outUseSSL, java.lang.String outUserName,
096                    java.lang.String outPassword, boolean mailingListActive,
097                    boolean allowAnonymousEmail,
098                    com.liferay.portal.service.ServiceContext serviceContext)
099                    throws RemoteException {
100                    try {
101                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(parentCategoryId,
102                                            name, description, displayStyle, emailAddress, inProtocol,
103                                            inServerName, inServerPort, inUseSSL, inUserName,
104                                            inPassword, inReadInterval, outEmailAddress, outCustom,
105                                            outServerName, outServerPort, outUseSSL, outUserName,
106                                            outPassword, mailingListActive, allowAnonymousEmail,
107                                            serviceContext);
108    
109                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
110                    }
111                    catch (Exception e) {
112                            _log.error(e, e);
113    
114                            throw new RemoteException(e.getMessage());
115                    }
116            }
117    
118            public static void deleteCategory(long categoryId,
119                    boolean includeTrashedEntries) throws RemoteException {
120                    try {
121                            MBCategoryServiceUtil.deleteCategory(categoryId,
122                                    includeTrashedEntries);
123                    }
124                    catch (Exception e) {
125                            _log.error(e, e);
126    
127                            throw new RemoteException(e.getMessage());
128                    }
129            }
130    
131            public static void deleteCategory(long groupId, long categoryId)
132                    throws RemoteException {
133                    try {
134                            MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
135                    }
136                    catch (Exception e) {
137                            _log.error(e, e);
138    
139                            throw new RemoteException(e.getMessage());
140                    }
141            }
142    
143            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
144                    long groupId) throws RemoteException {
145                    try {
146                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
147                                    MBCategoryServiceUtil.getCategories(groupId);
148    
149                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
159                    long groupId, int status) throws RemoteException {
160                    try {
161                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
162                                    MBCategoryServiceUtil.getCategories(groupId, status);
163    
164                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
165                    }
166                    catch (Exception e) {
167                            _log.error(e, e);
168    
169                            throw new RemoteException(e.getMessage());
170                    }
171            }
172    
173            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
174                    long groupId, long parentCategoryId, int start, int end)
175                    throws RemoteException {
176                    try {
177                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
178                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
179                                            start, end);
180    
181                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
182                    }
183                    catch (Exception e) {
184                            _log.error(e, e);
185    
186                            throw new RemoteException(e.getMessage());
187                    }
188            }
189    
190            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
191                    long groupId, long parentCategoryId, int status, int start, int end)
192                    throws RemoteException {
193                    try {
194                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
195                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
196                                            status, start, end);
197    
198                            return com.liferay.portlet.messageboards.model.MBCategorySoap.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 com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
208                    long groupId, long[] parentCategoryIds, int start, int end)
209                    throws RemoteException {
210                    try {
211                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
212                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
213                                            start, end);
214    
215                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
216                    }
217                    catch (Exception e) {
218                            _log.error(e, e);
219    
220                            throw new RemoteException(e.getMessage());
221                    }
222            }
223    
224            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
225                    long groupId, long[] parentCategoryIds, int status, int start, int end)
226                    throws RemoteException {
227                    try {
228                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
229                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
230                                            status, start, end);
231    
232                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
233                    }
234                    catch (Exception e) {
235                            _log.error(e, e);
236    
237                            throw new RemoteException(e.getMessage());
238                    }
239            }
240    
241            public static int getCategoriesCount(long groupId, long parentCategoryId)
242                    throws RemoteException {
243                    try {
244                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
245                                            parentCategoryId);
246    
247                            return returnValue;
248                    }
249                    catch (Exception e) {
250                            _log.error(e, e);
251    
252                            throw new RemoteException(e.getMessage());
253                    }
254            }
255    
256            public static int getCategoriesCount(long groupId, long parentCategoryId,
257                    int status) throws RemoteException {
258                    try {
259                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
260                                            parentCategoryId, status);
261    
262                            return returnValue;
263                    }
264                    catch (Exception e) {
265                            _log.error(e, e);
266    
267                            throw new RemoteException(e.getMessage());
268                    }
269            }
270    
271            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
272                    throws RemoteException {
273                    try {
274                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
275                                            parentCategoryIds);
276    
277                            return returnValue;
278                    }
279                    catch (Exception e) {
280                            _log.error(e, e);
281    
282                            throw new RemoteException(e.getMessage());
283                    }
284            }
285    
286            public static int getCategoriesCount(long groupId,
287                    long[] parentCategoryIds, int status) throws RemoteException {
288                    try {
289                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
290                                            parentCategoryIds, status);
291    
292                            return returnValue;
293                    }
294                    catch (Exception e) {
295                            _log.error(e, e);
296    
297                            throw new RemoteException(e.getMessage());
298                    }
299            }
300    
301            public static com.liferay.portlet.messageboards.model.MBCategorySoap getCategory(
302                    long categoryId) throws RemoteException {
303                    try {
304                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
305    
306                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
307                    }
308                    catch (Exception e) {
309                            _log.error(e, e);
310    
311                            throw new RemoteException(e.getMessage());
312                    }
313            }
314    
315            public static long[] getCategoryIds(long groupId, long categoryId)
316                    throws RemoteException {
317                    try {
318                            long[] returnValue = MBCategoryServiceUtil.getCategoryIds(groupId,
319                                            categoryId);
320    
321                            return returnValue;
322                    }
323                    catch (Exception e) {
324                            _log.error(e, e);
325    
326                            throw new RemoteException(e.getMessage());
327                    }
328            }
329    
330            public static java.lang.Long[] getSubcategoryIds(Long[] categoryIds,
331                    long groupId, long categoryId) throws RemoteException {
332                    try {
333                            java.util.List<java.lang.Long> returnValue = MBCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
334                                                    categoryIds), groupId, categoryId);
335    
336                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
337                    }
338                    catch (Exception e) {
339                            _log.error(e, e);
340    
341                            throw new RemoteException(e.getMessage());
342                    }
343            }
344    
345            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getSubscribedCategories(
346                    long groupId, long userId, int start, int end)
347                    throws RemoteException {
348                    try {
349                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
350                                    MBCategoryServiceUtil.getSubscribedCategories(groupId, userId,
351                                            start, end);
352    
353                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
354                    }
355                    catch (Exception e) {
356                            _log.error(e, e);
357    
358                            throw new RemoteException(e.getMessage());
359                    }
360            }
361    
362            public static int getSubscribedCategoriesCount(long groupId, long userId)
363                    throws RemoteException {
364                    try {
365                            int returnValue = MBCategoryServiceUtil.getSubscribedCategoriesCount(groupId,
366                                            userId);
367    
368                            return returnValue;
369                    }
370                    catch (Exception e) {
371                            _log.error(e, e);
372    
373                            throw new RemoteException(e.getMessage());
374                    }
375            }
376    
377            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategory(
378                    long categoryId, long parentCategoryId, boolean mergeWithParentCategory)
379                    throws RemoteException {
380                    try {
381                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategory(categoryId,
382                                            parentCategoryId, mergeWithParentCategory);
383    
384                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
385                    }
386                    catch (Exception e) {
387                            _log.error(e, e);
388    
389                            throw new RemoteException(e.getMessage());
390                    }
391            }
392    
393            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategoryFromTrash(
394                    long categoryId, long newCategoryId) throws RemoteException {
395                    try {
396                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategoryFromTrash(categoryId,
397                                            newCategoryId);
398    
399                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
400                    }
401                    catch (Exception e) {
402                            _log.error(e, e);
403    
404                            throw new RemoteException(e.getMessage());
405                    }
406            }
407    
408            public static com.liferay.portlet.messageboards.model.MBCategorySoap moveCategoryToTrash(
409                    long categoryId) throws RemoteException {
410                    try {
411                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.moveCategoryToTrash(categoryId);
412    
413                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
414                    }
415                    catch (Exception e) {
416                            _log.error(e, e);
417    
418                            throw new RemoteException(e.getMessage());
419                    }
420            }
421    
422            public static void restoreCategoryFromTrash(long categoryId)
423                    throws RemoteException {
424                    try {
425                            MBCategoryServiceUtil.restoreCategoryFromTrash(categoryId);
426                    }
427                    catch (Exception e) {
428                            _log.error(e, e);
429    
430                            throw new RemoteException(e.getMessage());
431                    }
432            }
433    
434            public static void subscribeCategory(long groupId, long categoryId)
435                    throws RemoteException {
436                    try {
437                            MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
438                    }
439                    catch (Exception e) {
440                            _log.error(e, e);
441    
442                            throw new RemoteException(e.getMessage());
443                    }
444            }
445    
446            public static void unsubscribeCategory(long groupId, long categoryId)
447                    throws RemoteException {
448                    try {
449                            MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
450                    }
451                    catch (Exception e) {
452                            _log.error(e, e);
453    
454                            throw new RemoteException(e.getMessage());
455                    }
456            }
457    
458            public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
459                    long categoryId, long parentCategoryId, java.lang.String name,
460                    java.lang.String description, java.lang.String displayStyle,
461                    java.lang.String emailAddress, java.lang.String inProtocol,
462                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
463                    java.lang.String inUserName, java.lang.String inPassword,
464                    int inReadInterval, java.lang.String outEmailAddress,
465                    boolean outCustom, java.lang.String outServerName, int outServerPort,
466                    boolean outUseSSL, java.lang.String outUserName,
467                    java.lang.String outPassword, boolean mailingListActive,
468                    boolean allowAnonymousEmail, boolean mergeWithParentCategory,
469                    com.liferay.portal.service.ServiceContext serviceContext)
470                    throws RemoteException {
471                    try {
472                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
473                                            parentCategoryId, name, description, displayStyle,
474                                            emailAddress, inProtocol, inServerName, inServerPort,
475                                            inUseSSL, inUserName, inPassword, inReadInterval,
476                                            outEmailAddress, outCustom, outServerName, outServerPort,
477                                            outUseSSL, outUserName, outPassword, mailingListActive,
478                                            allowAnonymousEmail, mergeWithParentCategory, serviceContext);
479    
480                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
481                    }
482                    catch (Exception e) {
483                            _log.error(e, e);
484    
485                            throw new RemoteException(e.getMessage());
486                    }
487            }
488    
489            private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
490    }