001    /**
002     * Copyright (c) 2000-2012 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     * <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 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    public class MBCategoryServiceSoap {
068            public static com.liferay.portlet.messageboards.model.MBCategorySoap addCategory(
069                    long parentCategoryId, java.lang.String name,
070                    java.lang.String description, java.lang.String displayStyle,
071                    java.lang.String emailAddress, java.lang.String inProtocol,
072                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
073                    java.lang.String inUserName, java.lang.String inPassword,
074                    int inReadInterval, java.lang.String outEmailAddress,
075                    boolean outCustom, java.lang.String outServerName, int outServerPort,
076                    boolean outUseSSL, java.lang.String outUserName,
077                    java.lang.String outPassword, boolean mailingListActive,
078                    boolean allowAnonymousEmail,
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, displayStyle, emailAddress, inProtocol,
084                                            inServerName, inServerPort, inUseSSL, inUserName,
085                                            inPassword, inReadInterval, outEmailAddress, outCustom,
086                                            outServerName, outServerPort, outUseSSL, outUserName,
087                                            outPassword, mailingListActive, allowAnonymousEmail,
088                                            serviceContext);
089    
090                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
091                    }
092                    catch (Exception e) {
093                            _log.error(e, e);
094    
095                            throw new RemoteException(e.getMessage());
096                    }
097            }
098    
099            public static void deleteCategory(long groupId, long categoryId)
100                    throws RemoteException {
101                    try {
102                            MBCategoryServiceUtil.deleteCategory(groupId, categoryId);
103                    }
104                    catch (Exception e) {
105                            _log.error(e, e);
106    
107                            throw new RemoteException(e.getMessage());
108                    }
109            }
110    
111            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
112                    long groupId) throws RemoteException {
113                    try {
114                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
115                                    MBCategoryServiceUtil.getCategories(groupId);
116    
117                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
118                    }
119                    catch (Exception e) {
120                            _log.error(e, e);
121    
122                            throw new RemoteException(e.getMessage());
123                    }
124            }
125    
126            public static com.liferay.portlet.messageboards.model.MBCategorySoap[] getCategories(
127                    long groupId, long parentCategoryId, int start, int end)
128                    throws RemoteException {
129                    try {
130                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
131                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
132                                            start, end);
133    
134                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
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, long[] parentCategoryIds, int start, int end)
145                    throws RemoteException {
146                    try {
147                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
148                                    MBCategoryServiceUtil.getCategories(groupId, parentCategoryIds,
149                                            start, end);
150    
151                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static int getCategoriesCount(long groupId, long parentCategoryId)
161                    throws RemoteException {
162                    try {
163                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
164                                            parentCategoryId);
165    
166                            return returnValue;
167                    }
168                    catch (Exception e) {
169                            _log.error(e, e);
170    
171                            throw new RemoteException(e.getMessage());
172                    }
173            }
174    
175            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
176                    throws RemoteException {
177                    try {
178                            int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
179                                            parentCategoryIds);
180    
181                            return 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 getCategory(
191                    long categoryId) throws RemoteException {
192                    try {
193                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
194    
195                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            public static long[] getCategoryIds(long groupId, long categoryId)
205                    throws RemoteException {
206                    try {
207                            long[] returnValue = MBCategoryServiceUtil.getCategoryIds(groupId,
208                                            categoryId);
209    
210                            return returnValue;
211                    }
212                    catch (Exception e) {
213                            _log.error(e, e);
214    
215                            throw new RemoteException(e.getMessage());
216                    }
217            }
218    
219            public static java.lang.Long[] getSubcategoryIds(Long[] categoryIds,
220                    long groupId, long categoryId) throws RemoteException {
221                    try {
222                            java.util.List<java.lang.Long> returnValue = MBCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
223                                                    categoryIds), groupId, categoryId);
224    
225                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
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[] getSubscribedCategories(
235                    long groupId, long userId, int start, int end)
236                    throws RemoteException {
237                    try {
238                            java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
239                                    MBCategoryServiceUtil.getSubscribedCategories(groupId, userId,
240                                            start, end);
241    
242                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModels(returnValue);
243                    }
244                    catch (Exception e) {
245                            _log.error(e, e);
246    
247                            throw new RemoteException(e.getMessage());
248                    }
249            }
250    
251            public static int getSubscribedCategoriesCount(long groupId, long userId)
252                    throws RemoteException {
253                    try {
254                            int returnValue = MBCategoryServiceUtil.getSubscribedCategoriesCount(groupId,
255                                            userId);
256    
257                            return returnValue;
258                    }
259                    catch (Exception e) {
260                            _log.error(e, e);
261    
262                            throw new RemoteException(e.getMessage());
263                    }
264            }
265    
266            public static void subscribeCategory(long groupId, long categoryId)
267                    throws RemoteException {
268                    try {
269                            MBCategoryServiceUtil.subscribeCategory(groupId, categoryId);
270                    }
271                    catch (Exception e) {
272                            _log.error(e, e);
273    
274                            throw new RemoteException(e.getMessage());
275                    }
276            }
277    
278            public static void unsubscribeCategory(long groupId, long categoryId)
279                    throws RemoteException {
280                    try {
281                            MBCategoryServiceUtil.unsubscribeCategory(groupId, categoryId);
282                    }
283                    catch (Exception e) {
284                            _log.error(e, e);
285    
286                            throw new RemoteException(e.getMessage());
287                    }
288            }
289    
290            public static com.liferay.portlet.messageboards.model.MBCategorySoap updateCategory(
291                    long categoryId, long parentCategoryId, java.lang.String name,
292                    java.lang.String description, java.lang.String displayStyle,
293                    java.lang.String emailAddress, java.lang.String inProtocol,
294                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
295                    java.lang.String inUserName, java.lang.String inPassword,
296                    int inReadInterval, java.lang.String outEmailAddress,
297                    boolean outCustom, java.lang.String outServerName, int outServerPort,
298                    boolean outUseSSL, java.lang.String outUserName,
299                    java.lang.String outPassword, boolean mailingListActive,
300                    boolean allowAnonymousEmail, boolean mergeWithParentCategory,
301                    com.liferay.portal.service.ServiceContext serviceContext)
302                    throws RemoteException {
303                    try {
304                            com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
305                                            parentCategoryId, name, description, displayStyle,
306                                            emailAddress, inProtocol, inServerName, inServerPort,
307                                            inUseSSL, inUserName, inPassword, inReadInterval,
308                                            outEmailAddress, outCustom, outServerName, outServerPort,
309                                            outUseSSL, outUserName, outPassword, mailingListActive,
310                                            allowAnonymousEmail, mergeWithParentCategory, serviceContext);
311    
312                            return com.liferay.portlet.messageboards.model.MBCategorySoap.toSoapModel(returnValue);
313                    }
314                    catch (Exception e) {
315                            _log.error(e, e);
316    
317                            throw new RemoteException(e.getMessage());
318                    }
319            }
320    
321            private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceSoap.class);
322    }