001
014
015 package com.liferay.portlet.shopping.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class ShoppingCouponServiceUtil {
035
040 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
041 java.lang.String code, boolean autoCode, java.lang.String name,
042 java.lang.String description, int startDateMonth, int startDateDay,
043 int startDateYear, int startDateHour, int startDateMinute,
044 int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
045 int endDateMinute, boolean neverExpire, boolean active,
046 java.lang.String limitCategories, java.lang.String limitSkus,
047 double minOrder, double discount, java.lang.String discountType,
048 com.liferay.portal.service.ServiceContext serviceContext)
049 throws com.liferay.portal.kernel.exception.PortalException,
050 com.liferay.portal.kernel.exception.SystemException {
051 return getService()
052 .addCoupon(code, autoCode, name, description,
053 startDateMonth, startDateDay, startDateYear, startDateHour,
054 startDateMinute, endDateMonth, endDateDay, endDateYear,
055 endDateHour, endDateMinute, neverExpire, active, limitCategories,
056 limitSkus, minOrder, discount, discountType, serviceContext);
057 }
058
059 public static void deleteCoupon(long groupId, long couponId)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 getService().deleteCoupon(groupId, couponId);
063 }
064
065 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
066 long groupId, long couponId)
067 throws com.liferay.portal.kernel.exception.PortalException,
068 com.liferay.portal.kernel.exception.SystemException {
069 return getService().getCoupon(groupId, couponId);
070 }
071
072 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
073 long groupId, long companyId, java.lang.String code, boolean active,
074 java.lang.String discountType, boolean andOperator, int start, int end)
075 throws com.liferay.portal.kernel.exception.PortalException,
076 com.liferay.portal.kernel.exception.SystemException {
077 return getService()
078 .search(groupId, companyId, code, active, discountType,
079 andOperator, start, end);
080 }
081
082 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
083 long couponId, java.lang.String name, java.lang.String description,
084 int startDateMonth, int startDateDay, int startDateYear,
085 int startDateHour, int startDateMinute, int endDateMonth,
086 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
087 boolean neverExpire, boolean active, java.lang.String limitCategories,
088 java.lang.String limitSkus, double minOrder, double discount,
089 java.lang.String discountType,
090 com.liferay.portal.service.ServiceContext serviceContext)
091 throws com.liferay.portal.kernel.exception.PortalException,
092 com.liferay.portal.kernel.exception.SystemException {
093 return getService()
094 .updateCoupon(couponId, name, description, startDateMonth,
095 startDateDay, startDateYear, startDateHour, startDateMinute,
096 endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
097 neverExpire, active, limitCategories, limitSkus, minOrder,
098 discount, discountType, serviceContext);
099 }
100
101 public static ShoppingCouponService getService() {
102 if (_service == null) {
103 _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
104
105 ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
106 "_service");
107 MethodCache.remove(ShoppingCouponService.class);
108 }
109
110 return _service;
111 }
112
113 public void setService(ShoppingCouponService service) {
114 MethodCache.remove(ShoppingCouponService.class);
115
116 _service = service;
117
118 ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
119 "_service");
120 MethodCache.remove(ShoppingCouponService.class);
121 }
122
123 private static ShoppingCouponService _service;
124 }