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     * Provides the SOAP utility for the
027     * {@link com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil} 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.shopping.model.ShoppingCategorySoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portlet.shopping.model.ShoppingCategory}, that is translated to a
038     * {@link com.liferay.portlet.shopping.model.ShoppingCategorySoap}. 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 ShoppingCategoryServiceHttp
061     * @see com.liferay.portlet.shopping.model.ShoppingCategorySoap
062     * @see com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil
063     * @generated
064     */
065    public class ShoppingCategoryServiceSoap {
066            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap addCategory(
067                    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.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.addCategory(parentCategoryId,
073                                            name, description, serviceContext);
074    
075                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.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 void deleteCategory(long categoryId)
085                    throws RemoteException {
086                    try {
087                            ShoppingCategoryServiceUtil.deleteCategory(categoryId);
088                    }
089                    catch (Exception e) {
090                            _log.error(e, e);
091    
092                            throw new RemoteException(e.getMessage());
093                    }
094            }
095    
096            public static com.liferay.portlet.shopping.model.ShoppingCategorySoap[] getCategories(
097                    long groupId) throws RemoteException {
098                    try {
099                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> returnValue =
100                                    ShoppingCategoryServiceUtil.getCategories(groupId);
101    
102                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModels(returnValue);
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.shopping.model.ShoppingCategorySoap[] getCategories(
112                    long groupId, long parentCategoryId, int start, int end)
113                    throws RemoteException {
114                    try {
115                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> returnValue =
116                                    ShoppingCategoryServiceUtil.getCategories(groupId,
117                                            parentCategoryId, start, end);
118    
119                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModels(returnValue);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            public static int getCategoriesCount(long groupId, long parentCategoryId)
129                    throws RemoteException {
130                    try {
131                            int returnValue = ShoppingCategoryServiceUtil.getCategoriesCount(groupId,
132                                            parentCategoryId);
133    
134                            return 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.shopping.model.ShoppingCategorySoap getCategory(
144                    long categoryId) throws RemoteException {
145                    try {
146                            com.liferay.portlet.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.getCategory(categoryId);
147    
148                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModel(returnValue);
149                    }
150                    catch (Exception e) {
151                            _log.error(e, e);
152    
153                            throw new RemoteException(e.getMessage());
154                    }
155            }
156    
157            public static void getSubcategoryIds(Long[] categoryIds, long groupId,
158                    long categoryId) throws RemoteException {
159                    try {
160                            ShoppingCategoryServiceUtil.getSubcategoryIds(ListUtil.toList(
161                                            categoryIds), groupId, categoryId);
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.shopping.model.ShoppingCategorySoap updateCategory(
171                    long categoryId, long parentCategoryId, java.lang.String name,
172                    java.lang.String description, boolean mergeWithParentCategory,
173                    com.liferay.portal.service.ServiceContext serviceContext)
174                    throws RemoteException {
175                    try {
176                            com.liferay.portlet.shopping.model.ShoppingCategory returnValue = ShoppingCategoryServiceUtil.updateCategory(categoryId,
177                                            parentCategoryId, name, description,
178                                            mergeWithParentCategory, serviceContext);
179    
180                            return com.liferay.portlet.shopping.model.ShoppingCategorySoap.toSoapModel(returnValue);
181                    }
182                    catch (Exception e) {
183                            _log.error(e, e);
184    
185                            throw new RemoteException(e.getMessage());
186                    }
187            }
188    
189            private static Log _log = LogFactoryUtil.getLog(ShoppingCategoryServiceSoap.class);
190    }