1
14
15 package com.liferay.portlet.shopping.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.MethodCache;
19 import com.liferay.portal.kernel.util.ReferenceRegistry;
20
21
41 public class ShoppingCouponServiceUtil {
42 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
43 java.lang.String code, boolean autoCode, java.lang.String name,
44 java.lang.String description, int startDateMonth, int startDateDay,
45 int startDateYear, int startDateHour, int startDateMinute,
46 int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
47 int endDateMinute, boolean neverExpire, boolean active,
48 java.lang.String limitCategories, java.lang.String limitSkus,
49 double minOrder, double discount, java.lang.String discountType,
50 com.liferay.portal.service.ServiceContext serviceContext)
51 throws com.liferay.portal.PortalException,
52 com.liferay.portal.SystemException {
53 return getService()
54 .addCoupon(code, autoCode, name, description,
55 startDateMonth, startDateDay, startDateYear, startDateHour,
56 startDateMinute, endDateMonth, endDateDay, endDateYear,
57 endDateHour, endDateMinute, neverExpire, active, limitCategories,
58 limitSkus, minOrder, discount, discountType, serviceContext);
59 }
60
61 public static void deleteCoupon(long groupId, long couponId)
62 throws com.liferay.portal.PortalException,
63 com.liferay.portal.SystemException {
64 getService().deleteCoupon(groupId, couponId);
65 }
66
67 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
68 long groupId, long couponId)
69 throws com.liferay.portal.PortalException,
70 com.liferay.portal.SystemException {
71 return getService().getCoupon(groupId, couponId);
72 }
73
74 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
75 long groupId, long companyId, java.lang.String code, boolean active,
76 java.lang.String discountType, boolean andOperator, int start, int end)
77 throws com.liferay.portal.PortalException,
78 com.liferay.portal.SystemException {
79 return getService()
80 .search(groupId, companyId, code, active, discountType,
81 andOperator, start, end);
82 }
83
84 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
85 long couponId, java.lang.String name, java.lang.String description,
86 int startDateMonth, int startDateDay, int startDateYear,
87 int startDateHour, int startDateMinute, int endDateMonth,
88 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
89 boolean neverExpire, boolean active, java.lang.String limitCategories,
90 java.lang.String limitSkus, double minOrder, double discount,
91 java.lang.String discountType,
92 com.liferay.portal.service.ServiceContext serviceContext)
93 throws com.liferay.portal.PortalException,
94 com.liferay.portal.SystemException {
95 return getService()
96 .updateCoupon(couponId, name, description, startDateMonth,
97 startDateDay, startDateYear, startDateHour, startDateMinute,
98 endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
99 neverExpire, active, limitCategories, limitSkus, minOrder,
100 discount, discountType, serviceContext);
101 }
102
103 public static ShoppingCouponService getService() {
104 if (_service == null) {
105 _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
106
107 ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
108 "_service");
109 MethodCache.remove(ShoppingCouponService.class);
110 }
111
112 return _service;
113 }
114
115 public void setService(ShoppingCouponService service) {
116 MethodCache.remove(ShoppingCouponService.class);
117
118 _service = service;
119
120 ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
121 "_service");
122 MethodCache.remove(ShoppingCouponService.class);
123 }
124
125 private static ShoppingCouponService _service;
126 }