1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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   * <a href="ShoppingCouponLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portlet.shopping.service.ShoppingCouponLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceFactory</code>
42   * is responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalService
48   * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceFactory
49   *
50   */
51  public class ShoppingCouponLocalServiceUtil {
52      public static com.liferay.portlet.shopping.model.ShoppingCoupon addShoppingCoupon(
53          com.liferay.portlet.shopping.model.ShoppingCoupon model)
54          throws com.liferay.portal.SystemException {
55          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
56  
57          return shoppingCouponLocalService.addShoppingCoupon(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
64  
65          return shoppingCouponLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
72  
73          return shoppingCouponLocalService.dynamicQuery(queryInitializer, begin,
74              end);
75      }
76  
77      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateShoppingCoupon(
78          com.liferay.portlet.shopping.model.ShoppingCoupon model)
79          throws com.liferay.portal.SystemException {
80          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
81  
82          return shoppingCouponLocalService.updateShoppingCoupon(model);
83      }
84  
85      public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
86          long userId, long plid, java.lang.String code, boolean autoCode,
87          java.lang.String name, java.lang.String description,
88          int startDateMonth, int startDateDay, int startDateYear,
89          int startDateHour, int startDateMinute, int endDateMonth,
90          int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
91          boolean neverExpire, boolean active, java.lang.String limitCategories,
92          java.lang.String limitSkus, double minOrder, double discount,
93          java.lang.String discountType)
94          throws com.liferay.portal.PortalException, 
95              com.liferay.portal.SystemException {
96          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
97  
98          return shoppingCouponLocalService.addCoupon(userId, plid, code,
99              autoCode, name, description, startDateMonth, startDateDay,
100             startDateYear, startDateHour, startDateMinute, endDateMonth,
101             endDateDay, endDateYear, endDateHour, endDateMinute, neverExpire,
102             active, limitCategories, limitSkus, minOrder, discount, discountType);
103     }
104 
105     public static void deleteCoupon(long couponId)
106         throws com.liferay.portal.PortalException, 
107             com.liferay.portal.SystemException {
108         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
109         shoppingCouponLocalService.deleteCoupon(couponId);
110     }
111 
112     public static void deleteCoupons(long groupId)
113         throws com.liferay.portal.SystemException {
114         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
115         shoppingCouponLocalService.deleteCoupons(groupId);
116     }
117 
118     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
119         long couponId)
120         throws com.liferay.portal.PortalException, 
121             com.liferay.portal.SystemException {
122         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
123 
124         return shoppingCouponLocalService.getCoupon(couponId);
125     }
126 
127     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
128         java.lang.String code)
129         throws com.liferay.portal.PortalException, 
130             com.liferay.portal.SystemException {
131         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
132 
133         return shoppingCouponLocalService.getCoupon(code);
134     }
135 
136     public static java.util.List search(long plid, long companyId,
137         java.lang.String code, boolean active, java.lang.String discountType,
138         boolean andOperator, int begin, int end)
139         throws com.liferay.portal.SystemException {
140         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
141 
142         return shoppingCouponLocalService.search(plid, companyId, code, active,
143             discountType, andOperator, begin, end);
144     }
145 
146     public static int searchCount(long groupId, long companyId,
147         java.lang.String code, boolean active, java.lang.String discountType,
148         boolean andOperator) throws com.liferay.portal.SystemException {
149         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
150 
151         return shoppingCouponLocalService.searchCount(groupId, companyId, code,
152             active, discountType, andOperator);
153     }
154 
155     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
156         long userId, long couponId, java.lang.String name,
157         java.lang.String description, int startDateMonth, int startDateDay,
158         int startDateYear, int startDateHour, int startDateMinute,
159         int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
160         int endDateMinute, boolean neverExpire, boolean active,
161         java.lang.String limitCategories, java.lang.String limitSkus,
162         double minOrder, double discount, java.lang.String discountType)
163         throws com.liferay.portal.PortalException, 
164             com.liferay.portal.SystemException {
165         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
166 
167         return shoppingCouponLocalService.updateCoupon(userId, couponId, name,
168             description, startDateMonth, startDateDay, startDateYear,
169             startDateHour, startDateMinute, endDateMonth, endDateDay,
170             endDateYear, endDateHour, endDateMinute, neverExpire, active,
171             limitCategories, limitSkus, minOrder, discount, discountType);
172     }
173 }