1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.shopping.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  
20  import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
21  
22  import java.rmi.RemoteException;
23  
24  /**
25   * <a href="ShoppingCouponServiceSoap.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * <p>
33   * This class provides a SOAP utility for the
34   * {@link com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil} service utility. The
35   * static methods of this class calls the same methods of the service utility.
36   * However, the signatures are different because it is difficult for SOAP to
37   * support certain types.
38   * </p>
39   *
40   * <p>
41   * ServiceBuilder follows certain rules in translating the methods. For example,
42   * if the method in the service utility returns a {@link java.util.List}, that
43   * is translated to an array of {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}.
44   * If the method in the service utility returns a
45   * {@link com.liferay.portlet.shopping.model.ShoppingCoupon}, that is translated to a
46   * {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}. Methods that SOAP cannot
47   * safely wire are skipped.
48   * </p>
49   *
50   * <p>
51   * The benefits of using the SOAP utility is that it is cross platform
52   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
53   * even Perl, to call the generated services. One drawback of SOAP is that it is
54   * slow because it needs to serialize all calls into a text format (XML).
55   * </p>
56   *
57   * <p>
58   * You can see a list of services at
59   * http://localhost:8080/tunnel-web/secure/axis. Set the property
60   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
61   * security.
62   * </p>
63   *
64   * <p>
65   * The SOAP utility is only generated for remote services.
66   * </p>
67   *
68   * @author    Brian Wing Shun Chan
69   * @see       ShoppingCouponServiceHttp
70   * @see       com.liferay.portlet.shopping.model.ShoppingCouponSoap
71   * @see       com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil
72   * @generated
73   */
74  public class ShoppingCouponServiceSoap {
75      public static com.liferay.portlet.shopping.model.ShoppingCouponSoap addCoupon(
76          java.lang.String code, boolean autoCode, java.lang.String name,
77          java.lang.String description, int startDateMonth, int startDateDay,
78          int startDateYear, int startDateHour, int startDateMinute,
79          int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
80          int endDateMinute, boolean neverExpire, boolean active,
81          java.lang.String limitCategories, java.lang.String limitSkus,
82          double minOrder, double discount, java.lang.String discountType,
83          com.liferay.portal.service.ServiceContext serviceContext)
84          throws RemoteException {
85          try {
86              com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.addCoupon(code,
87                      autoCode, name, description, startDateMonth, startDateDay,
88                      startDateYear, startDateHour, startDateMinute,
89                      endDateMonth, endDateDay, endDateYear, endDateHour,
90                      endDateMinute, neverExpire, active, limitCategories,
91                      limitSkus, minOrder, discount, discountType, serviceContext);
92  
93              return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
94          }
95          catch (Exception e) {
96              _log.error(e, e);
97  
98              throw new RemoteException(e.getMessage());
99          }
100     }
101 
102     public static void deleteCoupon(long groupId, long couponId)
103         throws RemoteException {
104         try {
105             ShoppingCouponServiceUtil.deleteCoupon(groupId, couponId);
106         }
107         catch (Exception e) {
108             _log.error(e, e);
109 
110             throw new RemoteException(e.getMessage());
111         }
112     }
113 
114     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap getCoupon(
115         long groupId, long couponId) throws RemoteException {
116         try {
117             com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.getCoupon(groupId,
118                     couponId);
119 
120             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
121         }
122         catch (Exception e) {
123             _log.error(e, e);
124 
125             throw new RemoteException(e.getMessage());
126         }
127     }
128 
129     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap[] search(
130         long groupId, long companyId, java.lang.String code, boolean active,
131         java.lang.String discountType, boolean andOperator, int start, int end)
132         throws RemoteException {
133         try {
134             java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> returnValue =
135                 ShoppingCouponServiceUtil.search(groupId, companyId, code,
136                     active, discountType, andOperator, start, end);
137 
138             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModels(returnValue);
139         }
140         catch (Exception e) {
141             _log.error(e, e);
142 
143             throw new RemoteException(e.getMessage());
144         }
145     }
146 
147     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap updateCoupon(
148         long couponId, java.lang.String name, java.lang.String description,
149         int startDateMonth, int startDateDay, int startDateYear,
150         int startDateHour, int startDateMinute, int endDateMonth,
151         int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
152         boolean neverExpire, boolean active, java.lang.String limitCategories,
153         java.lang.String limitSkus, double minOrder, double discount,
154         java.lang.String discountType,
155         com.liferay.portal.service.ServiceContext serviceContext)
156         throws RemoteException {
157         try {
158             com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.updateCoupon(couponId,
159                     name, description, startDateMonth, startDateDay,
160                     startDateYear, startDateHour, startDateMinute,
161                     endDateMonth, endDateDay, endDateYear, endDateHour,
162                     endDateMinute, neverExpire, active, limitCategories,
163                     limitSkus, minOrder, discount, discountType, serviceContext);
164 
165             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(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(ShoppingCouponServiceSoap.class);
175 }