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.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.ShoppingItemServiceUtil;
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.ShoppingItemServiceUtil} 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.ShoppingItemSoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portlet.shopping.model.ShoppingItem}, that is translated to a
040     * {@link com.liferay.portlet.shopping.model.ShoppingItemSoap}. 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       ShoppingItemServiceHttp
064     * @see       com.liferay.portlet.shopping.model.ShoppingItemSoap
065     * @see       com.liferay.portlet.shopping.service.ShoppingItemServiceUtil
066     * @generated
067     */
068    public class ShoppingItemServiceSoap {
069            public static void addBookItems(long groupId, long categoryId,
070                    java.lang.String[] isbns) throws RemoteException {
071                    try {
072                            ShoppingItemServiceUtil.addBookItems(groupId, categoryId, isbns);
073                    }
074                    catch (Exception e) {
075                            _log.error(e, e);
076    
077                            throw new RemoteException(e.getMessage());
078                    }
079            }
080    
081            public static void deleteItem(long itemId) throws RemoteException {
082                    try {
083                            ShoppingItemServiceUtil.deleteItem(itemId);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static int getCategoriesItemsCount(long groupId, Long[] categoryIds)
093                    throws RemoteException {
094                    try {
095                            int returnValue = ShoppingItemServiceUtil.getCategoriesItemsCount(groupId,
096                                            ListUtil.toList(categoryIds));
097    
098                            return returnValue;
099                    }
100                    catch (Exception e) {
101                            _log.error(e, e);
102    
103                            throw new RemoteException(e.getMessage());
104                    }
105            }
106    
107            public static com.liferay.portlet.shopping.model.ShoppingItemSoap getItem(
108                    long itemId) throws RemoteException {
109                    try {
110                            com.liferay.portlet.shopping.model.ShoppingItem returnValue = ShoppingItemServiceUtil.getItem(itemId);
111    
112                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModel(returnValue);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItems(
122                    long groupId, long categoryId) throws RemoteException {
123                    try {
124                            java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> returnValue =
125                                    ShoppingItemServiceUtil.getItems(groupId, categoryId);
126    
127                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
128                    }
129                    catch (Exception e) {
130                            _log.error(e, e);
131    
132                            throw new RemoteException(e.getMessage());
133                    }
134            }
135    
136            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItems(
137                    long groupId, long categoryId, int start, int end,
138                    com.liferay.portal.kernel.util.OrderByComparator obc)
139                    throws RemoteException {
140                    try {
141                            java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> returnValue =
142                                    ShoppingItemServiceUtil.getItems(groupId, categoryId, start,
143                                            end, obc);
144    
145                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static int getItemsCount(long groupId, long categoryId)
155                    throws RemoteException {
156                    try {
157                            int returnValue = ShoppingItemServiceUtil.getItemsCount(groupId,
158                                            categoryId);
159    
160                            return returnValue;
161                    }
162                    catch (Exception e) {
163                            _log.error(e, e);
164    
165                            throw new RemoteException(e.getMessage());
166                    }
167            }
168    
169            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItemsPrevAndNext(
170                    long itemId, com.liferay.portal.kernel.util.OrderByComparator obc)
171                    throws RemoteException {
172                    try {
173                            com.liferay.portlet.shopping.model.ShoppingItem[] returnValue = ShoppingItemServiceUtil.getItemsPrevAndNext(itemId,
174                                            obc);
175    
176                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
177                    }
178                    catch (Exception e) {
179                            _log.error(e, e);
180    
181                            throw new RemoteException(e.getMessage());
182                    }
183            }
184    
185            private static Log _log = LogFactoryUtil.getLog(ShoppingItemServiceSoap.class);
186    }