1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.shopping.service;
21  
22  
23  /**
24   * <a href="ShoppingCouponLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.shopping.service.ShoppingCouponLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalService
42   *
43   */
44  public class ShoppingCouponLocalServiceUtil {
45      public static com.liferay.portlet.shopping.model.ShoppingCoupon addShoppingCoupon(
46          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
47          throws com.liferay.portal.SystemException {
48          return getService().addShoppingCoupon(shoppingCoupon);
49      }
50  
51      public static com.liferay.portlet.shopping.model.ShoppingCoupon createShoppingCoupon(
52          long couponId) {
53          return getService().createShoppingCoupon(couponId);
54      }
55  
56      public static void deleteShoppingCoupon(long couponId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteShoppingCoupon(couponId);
60      }
61  
62      public static void deleteShoppingCoupon(
63          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
64          throws com.liferay.portal.SystemException {
65          getService().deleteShoppingCoupon(shoppingCoupon);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portlet.shopping.model.ShoppingCoupon getShoppingCoupon(
81          long couponId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getShoppingCoupon(couponId);
85      }
86  
87      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> getShoppingCoupons(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getShoppingCoupons(start, end);
90      }
91  
92      public static int getShoppingCouponsCount()
93          throws com.liferay.portal.SystemException {
94          return getService().getShoppingCouponsCount();
95      }
96  
97      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateShoppingCoupon(
98          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
99          throws com.liferay.portal.SystemException {
100         return getService().updateShoppingCoupon(shoppingCoupon);
101     }
102 
103     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateShoppingCoupon(
104         com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
105         boolean merge) throws com.liferay.portal.SystemException {
106         return getService().updateShoppingCoupon(shoppingCoupon, merge);
107     }
108 
109     public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
110         long userId, java.lang.String code, boolean autoCode,
111         java.lang.String name, java.lang.String description,
112         int startDateMonth, int startDateDay, int startDateYear,
113         int startDateHour, int startDateMinute, int endDateMonth,
114         int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
115         boolean neverExpire, boolean active, java.lang.String limitCategories,
116         java.lang.String limitSkus, double minOrder, double discount,
117         java.lang.String discountType,
118         com.liferay.portal.service.ServiceContext serviceContext)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException {
121         return getService()
122                    .addCoupon(userId, code, autoCode, name, description,
123             startDateMonth, startDateDay, startDateYear, startDateHour,
124             startDateMinute, endDateMonth, endDateDay, endDateYear,
125             endDateHour, endDateMinute, neverExpire, active, limitCategories,
126             limitSkus, minOrder, discount, discountType, serviceContext);
127     }
128 
129     public static void deleteCoupon(long couponId)
130         throws com.liferay.portal.PortalException,
131             com.liferay.portal.SystemException {
132         getService().deleteCoupon(couponId);
133     }
134 
135     public static void deleteCoupons(long groupId)
136         throws com.liferay.portal.SystemException {
137         getService().deleteCoupons(groupId);
138     }
139 
140     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
141         long couponId)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException {
144         return getService().getCoupon(couponId);
145     }
146 
147     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
148         java.lang.String code)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException {
151         return getService().getCoupon(code);
152     }
153 
154     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
155         long groupId, long companyId, java.lang.String code, boolean active,
156         java.lang.String discountType, boolean andOperator, int start, int end)
157         throws com.liferay.portal.SystemException {
158         return getService()
159                    .search(groupId, companyId, code, active, discountType,
160             andOperator, start, end);
161     }
162 
163     public static int searchCount(long groupId, long companyId,
164         java.lang.String code, boolean active, java.lang.String discountType,
165         boolean andOperator) throws com.liferay.portal.SystemException {
166         return getService()
167                    .searchCount(groupId, companyId, code, active, discountType,
168             andOperator);
169     }
170 
171     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
172         long userId, long couponId, java.lang.String name,
173         java.lang.String description, int startDateMonth, int startDateDay,
174         int startDateYear, int startDateHour, int startDateMinute,
175         int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
176         int endDateMinute, boolean neverExpire, boolean active,
177         java.lang.String limitCategories, java.lang.String limitSkus,
178         double minOrder, double discount, java.lang.String discountType,
179         com.liferay.portal.service.ServiceContext serviceContext)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         return getService()
183                    .updateCoupon(userId, couponId, name, description,
184             startDateMonth, startDateDay, startDateYear, startDateHour,
185             startDateMinute, endDateMonth, endDateDay, endDateYear,
186             endDateHour, endDateMinute, neverExpire, active, limitCategories,
187             limitSkus, minOrder, discount, discountType, serviceContext);
188     }
189 
190     public static ShoppingCouponLocalService getService() {
191         if (_service == null) {
192             throw new RuntimeException("ShoppingCouponLocalService is not set");
193         }
194 
195         return _service;
196     }
197 
198     public void setService(ShoppingCouponLocalService service) {
199         _service = service;
200     }
201 
202     private static ShoppingCouponLocalService _service;
203 }