1
22
23 package com.liferay.portlet.shopping.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.DoubleWrapper;
29 import com.liferay.portal.kernel.util.IntegerWrapper;
30 import com.liferay.portal.kernel.util.LongWrapper;
31 import com.liferay.portal.kernel.util.MethodWrapper;
32 import com.liferay.portal.kernel.util.NullWrapper;
33 import com.liferay.portal.security.auth.HttpPrincipal;
34 import com.liferay.portal.service.http.TunnelUtil;
35
36 import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
37
38
75 public class ShoppingCouponServiceHttp {
76 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
77 HttpPrincipal httpPrincipal, long plid, java.lang.String code,
78 boolean autoCode, java.lang.String name, java.lang.String description,
79 int startDateMonth, int startDateDay, int startDateYear,
80 int startDateHour, int startDateMinute, int endDateMonth,
81 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
82 boolean neverExpire, boolean active, java.lang.String limitCategories,
83 java.lang.String limitSkus, double minOrder, double discount,
84 java.lang.String discountType)
85 throws com.liferay.portal.SystemException,
86 com.liferay.portal.PortalException {
87 try {
88 Object paramObj0 = new LongWrapper(plid);
89 Object paramObj1 = code;
90
91 if (code == null) {
92 paramObj1 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj2 = new BooleanWrapper(autoCode);
96 Object paramObj3 = name;
97
98 if (name == null) {
99 paramObj3 = new NullWrapper("java.lang.String");
100 }
101
102 Object paramObj4 = description;
103
104 if (description == null) {
105 paramObj4 = new NullWrapper("java.lang.String");
106 }
107
108 Object paramObj5 = new IntegerWrapper(startDateMonth);
109 Object paramObj6 = new IntegerWrapper(startDateDay);
110 Object paramObj7 = new IntegerWrapper(startDateYear);
111 Object paramObj8 = new IntegerWrapper(startDateHour);
112 Object paramObj9 = new IntegerWrapper(startDateMinute);
113 Object paramObj10 = new IntegerWrapper(endDateMonth);
114 Object paramObj11 = new IntegerWrapper(endDateDay);
115 Object paramObj12 = new IntegerWrapper(endDateYear);
116 Object paramObj13 = new IntegerWrapper(endDateHour);
117 Object paramObj14 = new IntegerWrapper(endDateMinute);
118 Object paramObj15 = new BooleanWrapper(neverExpire);
119 Object paramObj16 = new BooleanWrapper(active);
120 Object paramObj17 = limitCategories;
121
122 if (limitCategories == null) {
123 paramObj17 = new NullWrapper("java.lang.String");
124 }
125
126 Object paramObj18 = limitSkus;
127
128 if (limitSkus == null) {
129 paramObj18 = new NullWrapper("java.lang.String");
130 }
131
132 Object paramObj19 = new DoubleWrapper(minOrder);
133 Object paramObj20 = new DoubleWrapper(discount);
134 Object paramObj21 = discountType;
135
136 if (discountType == null) {
137 paramObj21 = new NullWrapper("java.lang.String");
138 }
139
140 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCouponServiceUtil.class.getName(),
141 "addCoupon",
142 new Object[] {
143 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
144 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
145 paramObj10, paramObj11, paramObj12, paramObj13,
146 paramObj14, paramObj15, paramObj16, paramObj17,
147 paramObj18, paramObj19, paramObj20, paramObj21
148 });
149 Object returnObj = null;
150
151 try {
152 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
153 }
154 catch (Exception e) {
155 if (e instanceof com.liferay.portal.SystemException) {
156 throw (com.liferay.portal.SystemException)e;
157 }
158
159 if (e instanceof com.liferay.portal.PortalException) {
160 throw (com.liferay.portal.PortalException)e;
161 }
162
163 throw new com.liferay.portal.SystemException(e);
164 }
165
166 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
167 }
168 catch (com.liferay.portal.SystemException se) {
169 _log.error(se, se);
170 throw se;
171 }
172 }
173
174 public static void deleteCoupon(HttpPrincipal httpPrincipal, long plid,
175 long couponId)
176 throws com.liferay.portal.SystemException,
177 com.liferay.portal.PortalException {
178 try {
179 Object paramObj0 = new LongWrapper(plid);
180 Object paramObj1 = new LongWrapper(couponId);
181 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCouponServiceUtil.class.getName(),
182 "deleteCoupon", new Object[] { paramObj0, paramObj1 });
183
184 try {
185 TunnelUtil.invoke(httpPrincipal, methodWrapper);
186 }
187 catch (Exception e) {
188 if (e instanceof com.liferay.portal.SystemException) {
189 throw (com.liferay.portal.SystemException)e;
190 }
191
192 if (e instanceof com.liferay.portal.PortalException) {
193 throw (com.liferay.portal.PortalException)e;
194 }
195
196 throw new com.liferay.portal.SystemException(e);
197 }
198 }
199 catch (com.liferay.portal.SystemException se) {
200 _log.error(se, se);
201 throw se;
202 }
203 }
204
205 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
206 HttpPrincipal httpPrincipal, long plid, long couponId)
207 throws com.liferay.portal.SystemException,
208 com.liferay.portal.PortalException {
209 try {
210 Object paramObj0 = new LongWrapper(plid);
211 Object paramObj1 = new LongWrapper(couponId);
212 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCouponServiceUtil.class.getName(),
213 "getCoupon", new Object[] { paramObj0, paramObj1 });
214 Object returnObj = null;
215
216 try {
217 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
218 }
219 catch (Exception e) {
220 if (e instanceof com.liferay.portal.SystemException) {
221 throw (com.liferay.portal.SystemException)e;
222 }
223
224 if (e instanceof com.liferay.portal.PortalException) {
225 throw (com.liferay.portal.PortalException)e;
226 }
227
228 throw new com.liferay.portal.SystemException(e);
229 }
230
231 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
232 }
233 catch (com.liferay.portal.SystemException se) {
234 _log.error(se, se);
235 throw se;
236 }
237 }
238
239 public static java.util.List search(HttpPrincipal httpPrincipal, long plid,
240 long companyId, java.lang.String code, boolean active,
241 java.lang.String discountType, boolean andOperator, int begin, int end)
242 throws com.liferay.portal.SystemException,
243 com.liferay.portal.PortalException {
244 try {
245 Object paramObj0 = new LongWrapper(plid);
246 Object paramObj1 = new LongWrapper(companyId);
247 Object paramObj2 = code;
248
249 if (code == null) {
250 paramObj2 = new NullWrapper("java.lang.String");
251 }
252
253 Object paramObj3 = new BooleanWrapper(active);
254 Object paramObj4 = discountType;
255
256 if (discountType == null) {
257 paramObj4 = new NullWrapper("java.lang.String");
258 }
259
260 Object paramObj5 = new BooleanWrapper(andOperator);
261 Object paramObj6 = new IntegerWrapper(begin);
262 Object paramObj7 = new IntegerWrapper(end);
263 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCouponServiceUtil.class.getName(),
264 "search",
265 new Object[] {
266 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
267 paramObj5, paramObj6, paramObj7
268 });
269 Object returnObj = null;
270
271 try {
272 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
273 }
274 catch (Exception e) {
275 if (e instanceof com.liferay.portal.SystemException) {
276 throw (com.liferay.portal.SystemException)e;
277 }
278
279 if (e instanceof com.liferay.portal.PortalException) {
280 throw (com.liferay.portal.PortalException)e;
281 }
282
283 throw new com.liferay.portal.SystemException(e);
284 }
285
286 return (java.util.List)returnObj;
287 }
288 catch (com.liferay.portal.SystemException se) {
289 _log.error(se, se);
290 throw se;
291 }
292 }
293
294 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
295 HttpPrincipal httpPrincipal, long plid, long couponId,
296 java.lang.String name, java.lang.String description,
297 int startDateMonth, int startDateDay, int startDateYear,
298 int startDateHour, int startDateMinute, int endDateMonth,
299 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
300 boolean neverExpire, boolean active, java.lang.String limitCategories,
301 java.lang.String limitSkus, double minOrder, double discount,
302 java.lang.String discountType)
303 throws com.liferay.portal.SystemException,
304 com.liferay.portal.PortalException {
305 try {
306 Object paramObj0 = new LongWrapper(plid);
307 Object paramObj1 = new LongWrapper(couponId);
308 Object paramObj2 = name;
309
310 if (name == null) {
311 paramObj2 = new NullWrapper("java.lang.String");
312 }
313
314 Object paramObj3 = description;
315
316 if (description == null) {
317 paramObj3 = new NullWrapper("java.lang.String");
318 }
319
320 Object paramObj4 = new IntegerWrapper(startDateMonth);
321 Object paramObj5 = new IntegerWrapper(startDateDay);
322 Object paramObj6 = new IntegerWrapper(startDateYear);
323 Object paramObj7 = new IntegerWrapper(startDateHour);
324 Object paramObj8 = new IntegerWrapper(startDateMinute);
325 Object paramObj9 = new IntegerWrapper(endDateMonth);
326 Object paramObj10 = new IntegerWrapper(endDateDay);
327 Object paramObj11 = new IntegerWrapper(endDateYear);
328 Object paramObj12 = new IntegerWrapper(endDateHour);
329 Object paramObj13 = new IntegerWrapper(endDateMinute);
330 Object paramObj14 = new BooleanWrapper(neverExpire);
331 Object paramObj15 = new BooleanWrapper(active);
332 Object paramObj16 = limitCategories;
333
334 if (limitCategories == null) {
335 paramObj16 = new NullWrapper("java.lang.String");
336 }
337
338 Object paramObj17 = limitSkus;
339
340 if (limitSkus == null) {
341 paramObj17 = new NullWrapper("java.lang.String");
342 }
343
344 Object paramObj18 = new DoubleWrapper(minOrder);
345 Object paramObj19 = new DoubleWrapper(discount);
346 Object paramObj20 = discountType;
347
348 if (discountType == null) {
349 paramObj20 = new NullWrapper("java.lang.String");
350 }
351
352 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCouponServiceUtil.class.getName(),
353 "updateCoupon",
354 new Object[] {
355 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
356 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
357 paramObj10, paramObj11, paramObj12, paramObj13,
358 paramObj14, paramObj15, paramObj16, paramObj17,
359 paramObj18, paramObj19, paramObj20
360 });
361 Object returnObj = null;
362
363 try {
364 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
365 }
366 catch (Exception e) {
367 if (e instanceof com.liferay.portal.SystemException) {
368 throw (com.liferay.portal.SystemException)e;
369 }
370
371 if (e instanceof com.liferay.portal.PortalException) {
372 throw (com.liferay.portal.PortalException)e;
373 }
374
375 throw new com.liferay.portal.SystemException(e);
376 }
377
378 return (com.liferay.portlet.shopping.model.ShoppingCoupon)returnObj;
379 }
380 catch (com.liferay.portal.SystemException se) {
381 _log.error(se, se);
382 throw se;
383 }
384 }
385
386 private static Log _log = LogFactoryUtil.getLog(ShoppingCouponServiceHttp.class);
387 }