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.shopping.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.shopping.service.ShoppingCategoryServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * <p>
027     * This class provides a SOAP utility for the
028     * {@link com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil} 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.shopping.model.ShoppingCategorySoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portlet.shopping.model.ShoppingCategory}, that is translated to a
040     * {@link com.liferay.portlet.shopping.model.ShoppingCategorySoap}. 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/api/secure/axis. Set the property
054     * <b>axis.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       ShoppingCategoryServiceHttp
064     * @see       com.liferay.portlet.shopping.model.ShoppingCategorySoap
065     * @see       com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil
066     * @generated
067     */
068    public class ShoppingCategoryServiceSoap {
069            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap addCategory(
070                    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.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.addCategory(parentCategoryId,
076                                            name, description, serviceContext);
077    
078                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.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 void deleteCategory(long categoryId)
088                    throws RemoteException {
089                    try {
090                            ShoppingCategoryServiceUtil.deleteCategory(categoryId);
091                    }
092                    catch (Exception e) {
093                            _log.error(e, e);
094    
095                            throw new RemoteException(e.getMessage());
096                    }
097            }
098    
099            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap[] getCategories(
100                    long groupId) throws RemoteException {
101                    try {
102                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> returnValue =
103                                    ShoppingCategoryServiceUtil.getCategories(groupId);
104    
105                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModels(returnValue);
106                    }
107                    catch (Exception e) {
108                            _log.error(e, e);
109    
110                            throw new RemoteException(e.getMessage());
111                    }
112            }
113    
114            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap[] getCategories(
115                    long groupId, long parentCategoryId, int start, int end)
116                    throws RemoteException {
117                    try {
118                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> returnValue =
119                                    ShoppingCategoryServiceUtil.getCategories(groupId,
120                                            parentCategoryId, start, end);
121    
122                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModels(returnValue);
123                    }
124                    catch (Exception e) {
125                            _log.error(e, e);
126    
127                            throw new RemoteException(e.getMessage());
128                    }
129            }
130    
131            public static int getCategoriesCount(long groupId, long parentCategoryId)
132                    throws RemoteException {
133                    try {
134                            int returnValue = ShoppingCategoryServiceUtil.getCategoriesCount(groupId,
135                                            parentCategoryId);
136    
137                            return returnValue;
138                    }
139                    catch (Exception e) {
140                            _log.error(e, e);
141    
142                            throw new RemoteException(e.getMessage());
143                    }
144            }
145    
146            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap getCategory(
147                    long categoryId) throws RemoteException {
148                    try {
149                            com.liferay.portlet.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.getCategory(categoryId);
150    
151                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModel(returnValue);
152                    }
153                    catch (Exception e) {
154                            _log.error(e, e);
155    
156                            throw new RemoteException(e.getMessage());
157                    }
158            }
159    
160            public static void getSubcategoryIds(Long[] categoryIds, long groupId,
161                    long categoryId) throws RemoteException {
162                    try {
163                            ShoppingCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
164                                            categoryIds), groupId, categoryId);
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.shopping.model.ShoppingCategorySoap updateCategory(
174                    long categoryId, long parentCategoryId, java.lang.String name,
175                    java.lang.String description, boolean mergeWithParentCategory,
176                    com.liferay.portal.service.ServiceContext serviceContext)
177                    throws RemoteException {
178                    try {
179                            com.liferay.portlet.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.updateCategory(categoryId,
180                                            parentCategoryId, name, description,
181                                            mergeWithParentCategory, serviceContext);
182    
183                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModel(returnValue);
184                    }
185                    catch (Exception e) {
186                            _log.error(e, e);
187    
188                            throw new RemoteException(e.getMessage());
189                    }
190            }
191    
192            private static Log _log = LogFactoryUtil.getLog(ShoppingCategoryServiceSoap.class);
193    }