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    
020    import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
021    
022    import java.rmi.RemoteException;
023    
024    /**
025     * <p>
026     * This class provides a SOAP utility for the
027     * {@link com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil} 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     * </p>
032     *
033     * <p>
034     * ServiceBuilder follows certain rules in translating the methods. For example,
035     * if the method in the service utility returns a {@link java.util.List}, that
036     * is translated to an array of {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}.
037     * If the method in the service utility returns a
038     * {@link com.liferay.portlet.shopping.model.ShoppingCoupon}, that is translated to a
039     * {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}. Methods that SOAP cannot
040     * safely wire are skipped.
041     * </p>
042     *
043     * <p>
044     * The benefits of using the SOAP utility is that it is cross platform
045     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
046     * even Perl, to call the generated services. One drawback of SOAP is that it is
047     * slow because it needs to serialize all calls into a text format (XML).
048     * </p>
049     *
050     * <p>
051     * You can see a list of services at
052     * http://localhost:8080/api/secure/axis. Set the property
053     * <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       ShoppingCouponServiceHttp
063     * @see       com.liferay.portlet.shopping.model.ShoppingCouponSoap
064     * @see       com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil
065     * @generated
066     */
067    public class ShoppingCouponServiceSoap {
068            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap addCoupon(
069                    java.lang.String code, boolean autoCode, java.lang.String name,
070                    java.lang.String description, int startDateMonth, int startDateDay,
071                    int startDateYear, int startDateHour, int startDateMinute,
072                    int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
073                    int endDateMinute, boolean neverExpire, boolean active,
074                    java.lang.String limitCategories, java.lang.String limitSkus,
075                    double minOrder, double discount, java.lang.String discountType,
076                    com.liferay.portal.service.ServiceContext serviceContext)
077                    throws RemoteException {
078                    try {
079                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.addCoupon(code,
080                                            autoCode, name, description, startDateMonth, startDateDay,
081                                            startDateYear, startDateHour, startDateMinute,
082                                            endDateMonth, endDateDay, endDateYear, endDateHour,
083                                            endDateMinute, neverExpire, active, limitCategories,
084                                            limitSkus, minOrder, discount, discountType, serviceContext);
085    
086                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
087                    }
088                    catch (Exception e) {
089                            _log.error(e, e);
090    
091                            throw new RemoteException(e.getMessage());
092                    }
093            }
094    
095            public static void deleteCoupon(long groupId, long couponId)
096                    throws RemoteException {
097                    try {
098                            ShoppingCouponServiceUtil.deleteCoupon(groupId, couponId);
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.ShoppingCouponSoap getCoupon(
108                    long groupId, long couponId) throws RemoteException {
109                    try {
110                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.getCoupon(groupId,
111                                            couponId);
112    
113                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
114                    }
115                    catch (Exception e) {
116                            _log.error(e, e);
117    
118                            throw new RemoteException(e.getMessage());
119                    }
120            }
121    
122            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap[] search(
123                    long groupId, long companyId, java.lang.String code, boolean active,
124                    java.lang.String discountType, boolean andOperator, int start, int end)
125                    throws RemoteException {
126                    try {
127                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> returnValue =
128                                    ShoppingCouponServiceUtil.search(groupId, companyId, code,
129                                            active, discountType, andOperator, start, end);
130    
131                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModels(returnValue);
132                    }
133                    catch (Exception e) {
134                            _log.error(e, e);
135    
136                            throw new RemoteException(e.getMessage());
137                    }
138            }
139    
140            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap updateCoupon(
141                    long couponId, java.lang.String name, java.lang.String description,
142                    int startDateMonth, int startDateDay, int startDateYear,
143                    int startDateHour, int startDateMinute, int endDateMonth,
144                    int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
145                    boolean neverExpire, boolean active, java.lang.String limitCategories,
146                    java.lang.String limitSkus, double minOrder, double discount,
147                    java.lang.String discountType,
148                    com.liferay.portal.service.ServiceContext serviceContext)
149                    throws RemoteException {
150                    try {
151                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.updateCoupon(couponId,
152                                            name, description, startDateMonth, startDateDay,
153                                            startDateYear, startDateHour, startDateMinute,
154                                            endDateMonth, endDateDay, endDateYear, endDateHour,
155                                            endDateMinute, neverExpire, active, limitCategories,
156                                            limitSkus, minOrder, discount, discountType, serviceContext);
157    
158                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
159                    }
160                    catch (Exception e) {
161                            _log.error(e, e);
162    
163                            throw new RemoteException(e.getMessage());
164                    }
165            }
166    
167            private static Log _log = LogFactoryUtil.getLog(ShoppingCouponServiceSoap.class);
168    }