1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.service;
24  
25  
26  /**
27   * <a href="ShoppingCouponServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * {@link ShoppingCouponService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       ShoppingCouponService
44   * @generated
45   */
46  public class ShoppingCouponServiceUtil {
47      public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
48          java.lang.String code, boolean autoCode, java.lang.String name,
49          java.lang.String description, int startDateMonth, int startDateDay,
50          int startDateYear, int startDateHour, int startDateMinute,
51          int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
52          int endDateMinute, boolean neverExpire, boolean active,
53          java.lang.String limitCategories, java.lang.String limitSkus,
54          double minOrder, double discount, java.lang.String discountType,
55          com.liferay.portal.service.ServiceContext serviceContext)
56          throws com.liferay.portal.PortalException,
57              com.liferay.portal.SystemException {
58          return getService()
59                     .addCoupon(code, autoCode, name, description,
60              startDateMonth, startDateDay, startDateYear, startDateHour,
61              startDateMinute, endDateMonth, endDateDay, endDateYear,
62              endDateHour, endDateMinute, neverExpire, active, limitCategories,
63              limitSkus, minOrder, discount, discountType, serviceContext);
64      }
65  
66      public static void deleteCoupon(long groupId, long couponId)
67          throws com.liferay.portal.PortalException,
68              com.liferay.portal.SystemException {
69          getService().deleteCoupon(groupId, couponId);
70      }
71  
72      public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
73          long groupId, long couponId)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException {
76          return getService().getCoupon(groupId, couponId);
77      }
78  
79      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
80          long groupId, long companyId, java.lang.String code, boolean active,
81          java.lang.String discountType, boolean andOperator, int start, int end)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService()
85                     .search(groupId, companyId, code, active, discountType,
86              andOperator, start, end);
87      }
88  
89      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
90          long couponId, java.lang.String name, java.lang.String description,
91          int startDateMonth, int startDateDay, int startDateYear,
92          int startDateHour, int startDateMinute, int endDateMonth,
93          int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
94          boolean neverExpire, boolean active, java.lang.String limitCategories,
95          java.lang.String limitSkus, double minOrder, double discount,
96          java.lang.String discountType,
97          com.liferay.portal.service.ServiceContext serviceContext)
98          throws com.liferay.portal.PortalException,
99              com.liferay.portal.SystemException {
100         return getService()
101                    .updateCoupon(couponId, name, description, startDateMonth,
102             startDateDay, startDateYear, startDateHour, startDateMinute,
103             endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
104             neverExpire, active, limitCategories, limitSkus, minOrder,
105             discount, discountType, serviceContext);
106     }
107 
108     public static ShoppingCouponService getService() {
109         if (_service == null) {
110             throw new RuntimeException("ShoppingCouponService is not set");
111         }
112 
113         return _service;
114     }
115 
116     public void setService(ShoppingCouponService service) {
117         _service = service;
118     }
119 
120     private static ShoppingCouponService _service;
121 }