1
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 import com.liferay.portal.kernel.util.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
25
26
63 public class ShoppingCouponServiceHttp {
64 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
65 HttpPrincipal httpPrincipal, java.lang.String code, boolean autoCode,
66 java.lang.String name, java.lang.String description,
67 int startDateMonth, int startDateDay, int startDateYear,
68 int startDateHour, int startDateMinute, int endDateMonth,
69 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
70 boolean neverExpire, boolean active, java.lang.String limitCategories,
71 java.lang.String limitSkus, double minOrder, double discount,
72 java.lang.String discountType,
73 com.liferay.portal.service.ServiceContext serviceContext)
74 throws com.liferay.portal.PortalException,
75 com.liferay.portal.SystemException {
76 try {
77 MethodKey methodKey = new MethodKey(ShoppingCouponServiceUtil.class.getName(),
78 "addCoupon", _addCouponParameterTypes0);
79
80 MethodHandler methodHandler = new MethodHandler(methodKey, code,
81 autoCode, name, description, startDateMonth, startDateDay,
82 startDateYear, startDateHour, startDateMinute,
83 endDateMonth, endDateDay, endDateYear, endDateHour,
84 endDateMinute, neverExpire, active, limitCategories,
85 limitSkus, minOrder, discount, discountType, serviceContext);
86
87 Object returnObj = null;
88
89 try {
90 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
91 }
92 catch (Exception e) {
93 if (e instanceof com.liferay.portal.PortalException) {
94 throw (com.liferay.portal.PortalException)e;
95 }
96
97 if (e instanceof com.liferay.portal.SystemException) {
98 throw (com.liferay.portal.SystemException)e;
99 }
100
101 throw new com.liferay.portal.SystemException(e);
102 }
103
104 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
105 }
106 catch (com.liferay.portal.SystemException se) {
107 _log.error(se, se);
108
109 throw se;
110 }
111 }
112
113 public static void deleteCoupon(HttpPrincipal httpPrincipal, long groupId,
114 long couponId)
115 throws com.liferay.portal.PortalException,
116 com.liferay.portal.SystemException {
117 try {
118 MethodKey methodKey = new MethodKey(ShoppingCouponServiceUtil.class.getName(),
119 "deleteCoupon", _deleteCouponParameterTypes1);
120
121 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
122 couponId);
123
124 try {
125 TunnelUtil.invoke(httpPrincipal, methodHandler);
126 }
127 catch (Exception e) {
128 if (e instanceof com.liferay.portal.PortalException) {
129 throw (com.liferay.portal.PortalException)e;
130 }
131
132 if (e instanceof com.liferay.portal.SystemException) {
133 throw (com.liferay.portal.SystemException)e;
134 }
135
136 throw new com.liferay.portal.SystemException(e);
137 }
138 }
139 catch (com.liferay.portal.SystemException se) {
140 _log.error(se, se);
141
142 throw se;
143 }
144 }
145
146 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
147 HttpPrincipal httpPrincipal, long groupId, long couponId)
148 throws com.liferay.portal.PortalException,
149 com.liferay.portal.SystemException {
150 try {
151 MethodKey methodKey = new MethodKey(ShoppingCouponServiceUtil.class.getName(),
152 "getCoupon", _getCouponParameterTypes2);
153
154 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
155 couponId);
156
157 Object returnObj = null;
158
159 try {
160 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
161 }
162 catch (Exception e) {
163 if (e instanceof com.liferay.portal.PortalException) {
164 throw (com.liferay.portal.PortalException)e;
165 }
166
167 if (e instanceof com.liferay.portal.SystemException) {
168 throw (com.liferay.portal.SystemException)e;
169 }
170
171 throw new com.liferay.portal.SystemException(e);
172 }
173
174 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
175 }
176 catch (com.liferay.portal.SystemException se) {
177 _log.error(se, se);
178
179 throw se;
180 }
181 }
182
183 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
184 HttpPrincipal httpPrincipal, long groupId, long companyId,
185 java.lang.String code, boolean active, java.lang.String discountType,
186 boolean andOperator, int start, int end)
187 throws com.liferay.portal.PortalException,
188 com.liferay.portal.SystemException {
189 try {
190 MethodKey methodKey = new MethodKey(ShoppingCouponServiceUtil.class.getName(),
191 "search", _searchParameterTypes3);
192
193 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
194 companyId, code, active, discountType, andOperator, start,
195 end);
196
197 Object returnObj = null;
198
199 try {
200 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
201 }
202 catch (Exception e) {
203 if (e instanceof com.liferay.portal.PortalException) {
204 throw (com.liferay.portal.PortalException)e;
205 }
206
207 if (e instanceof com.liferay.portal.SystemException) {
208 throw (com.liferay.portal.SystemException)e;
209 }
210
211 throw new com.liferay.portal.SystemException(e);
212 }
213
214 return (java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon>)returnObj;
215 }
216 catch (com.liferay.portal.SystemException se) {
217 _log.error(se, se);
218
219 throw se;
220 }
221 }
222
223 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
224 HttpPrincipal httpPrincipal, long couponId, java.lang.String name,
225 java.lang.String description, int startDateMonth, int startDateDay,
226 int startDateYear, int startDateHour, int startDateMinute,
227 int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
228 int endDateMinute, boolean neverExpire, boolean active,
229 java.lang.String limitCategories, java.lang.String limitSkus,
230 double minOrder, double discount, java.lang.String discountType,
231 com.liferay.portal.service.ServiceContext serviceContext)
232 throws com.liferay.portal.PortalException,
233 com.liferay.portal.SystemException {
234 try {
235 MethodKey methodKey = new MethodKey(ShoppingCouponServiceUtil.class.getName(),
236 "updateCoupon", _updateCouponParameterTypes4);
237
238 MethodHandler methodHandler = new MethodHandler(methodKey,
239 couponId, name, description, startDateMonth, startDateDay,
240 startDateYear, startDateHour, startDateMinute,
241 endDateMonth, endDateDay, endDateYear, endDateHour,
242 endDateMinute, neverExpire, active, limitCategories,
243 limitSkus, minOrder, discount, discountType, serviceContext);
244
245 Object returnObj = null;
246
247 try {
248 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
249 }
250 catch (Exception e) {
251 if (e instanceof com.liferay.portal.PortalException) {
252 throw (com.liferay.portal.PortalException)e;
253 }
254
255 if (e instanceof com.liferay.portal.SystemException) {
256 throw (com.liferay.portal.SystemException)e;
257 }
258
259 throw new com.liferay.portal.SystemException(e);
260 }
261
262 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
263 }
264 catch (com.liferay.portal.SystemException se) {
265 _log.error(se, se);
266
267 throw se;
268 }
269 }
270
271 private static Log _log = LogFactoryUtil.getLog(ShoppingCouponServiceHttp.class);
272 private static final Class<?>[] _addCouponParameterTypes0 = new Class[] {
273 java.lang.String.class, boolean.class, java.lang.String.class,
274 java.lang.String.class, int.class, int.class, int.class, int.class,
275 int.class, int.class, int.class, int.class, int.class, int.class,
276 boolean.class, boolean.class, java.lang.String.class,
277 java.lang.String.class, double.class, double.class,
278 java.lang.String.class,
279 com.liferay.portal.service.ServiceContext.class
280 };
281 private static final Class<?>[] _deleteCouponParameterTypes1 = new Class[] {
282 long.class, long.class
283 };
284 private static final Class<?>[] _getCouponParameterTypes2 = new Class[] {
285 long.class, long.class
286 };
287 private static final Class<?>[] _searchParameterTypes3 = new Class[] {
288 long.class, long.class, java.lang.String.class, boolean.class,
289 java.lang.String.class, boolean.class, int.class, int.class
290 };
291 private static final Class<?>[] _updateCouponParameterTypes4 = new Class[] {
292 long.class, java.lang.String.class, java.lang.String.class,
293 int.class, int.class, int.class, int.class, int.class, int.class,
294 int.class, int.class, int.class, int.class, boolean.class,
295 boolean.class, java.lang.String.class, java.lang.String.class,
296 double.class, double.class, java.lang.String.class,
297 com.liferay.portal.service.ServiceContext.class
298 };
299 }