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