001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.ListUtil;
022    
023    import com.liferay.portlet.shopping.service.ShoppingItemServiceUtil;
024    
025    import java.rmi.RemoteException;
026    
027    /**
028     * Provides the SOAP utility for the
029     * {@link com.liferay.portlet.shopping.service.ShoppingItemServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it is difficult for SOAP to
032     * support certain types.
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    @ProviderType
068    public class ShoppingItemServiceSoap {
069            public static void deleteItem(long itemId) throws RemoteException {
070                    try {
071                            ShoppingItemServiceUtil.deleteItem(itemId);
072                    }
073                    catch (Exception e) {
074                            _log.error(e, e);
075    
076                            throw new RemoteException(e.getMessage());
077                    }
078            }
079    
080            public static int getCategoriesItemsCount(long groupId, Long[] categoryIds)
081                    throws RemoteException {
082                    try {
083                            int returnValue = ShoppingItemServiceUtil.getCategoriesItemsCount(groupId,
084                                            ListUtil.toList(categoryIds));
085    
086                            return returnValue;
087                    }
088                    catch (Exception e) {
089                            _log.error(e, e);
090    
091                            throw new RemoteException(e.getMessage());
092                    }
093            }
094    
095            public static com.liferay.portlet.shopping.model.ShoppingItemSoap getItem(
096                    long itemId) throws RemoteException {
097                    try {
098                            com.liferay.portlet.shopping.model.ShoppingItem returnValue = ShoppingItemServiceUtil.getItem(itemId);
099    
100                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModel(returnValue);
101                    }
102                    catch (Exception e) {
103                            _log.error(e, e);
104    
105                            throw new RemoteException(e.getMessage());
106                    }
107            }
108    
109            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItems(
110                    long groupId, long categoryId) throws RemoteException {
111                    try {
112                            java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> returnValue =
113                                    ShoppingItemServiceUtil.getItems(groupId, categoryId);
114    
115                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
116                    }
117                    catch (Exception e) {
118                            _log.error(e, e);
119    
120                            throw new RemoteException(e.getMessage());
121                    }
122            }
123    
124            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItems(
125                    long groupId, long categoryId, int start, int end,
126                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc)
127                    throws RemoteException {
128                    try {
129                            java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> returnValue =
130                                    ShoppingItemServiceUtil.getItems(groupId, categoryId, start,
131                                            end, obc);
132    
133                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
134                    }
135                    catch (Exception e) {
136                            _log.error(e, e);
137    
138                            throw new RemoteException(e.getMessage());
139                    }
140            }
141    
142            public static int getItemsCount(long groupId, long categoryId)
143                    throws RemoteException {
144                    try {
145                            int returnValue = ShoppingItemServiceUtil.getItemsCount(groupId,
146                                            categoryId);
147    
148                            return returnValue;
149                    }
150                    catch (Exception e) {
151                            _log.error(e, e);
152    
153                            throw new RemoteException(e.getMessage());
154                    }
155            }
156    
157            public static com.liferay.portlet.shopping.model.ShoppingItemSoap[] getItemsPrevAndNext(
158                    long itemId,
159                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc)
160                    throws RemoteException {
161                    try {
162                            com.liferay.portlet.shopping.model.ShoppingItem[] returnValue = ShoppingItemServiceUtil.getItemsPrevAndNext(itemId,
163                                            obc);
164    
165                            return com.liferay.portlet.shopping.model.ShoppingItemSoap.toSoapModels(returnValue);
166                    }
167                    catch (Exception e) {
168                            _log.error(e, e);
169    
170                            throw new RemoteException(e.getMessage());
171                    }
172            }
173    
174            private static Log _log = LogFactoryUtil.getLog(ShoppingItemServiceSoap.class);
175    }