1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
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  /**
22   * <a href="ShoppingCouponServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link ShoppingCouponService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       ShoppingCouponService
39   * @generated
40   */
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 }