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          long plid, java.lang.String code, boolean autoCode,
49          java.lang.String name, java.lang.String description,
50          int startDateMonth, int startDateDay, int startDateYear,
51          int startDateHour, int startDateMinute, int endDateMonth,
52          int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
53          boolean neverExpire, boolean active, java.lang.String limitCategories,
54          java.lang.String limitSkus, double minOrder, double discount,
55          java.lang.String discountType)
56          throws com.liferay.portal.PortalException,
57              com.liferay.portal.SystemException, java.rmi.RemoteException {
58          return getService()
59                     .addCoupon(plid, 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);
64      }
65  
66      public static void deleteCoupon(long plid, long couponId)
67          throws com.liferay.portal.PortalException,
68              com.liferay.portal.SystemException, java.rmi.RemoteException {
69          getService().deleteCoupon(plid, couponId);
70      }
71  
72      public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
73          long plid, long couponId)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException, java.rmi.RemoteException {
76          return getService().getCoupon(plid, couponId);
77      }
78  
79      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
80          long plid, 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, java.rmi.RemoteException {
84          return getService()
85                     .search(plid, companyId, code, active, discountType,
86              andOperator, start, end);
87      }
88  
89      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
90          long plid, long couponId, java.lang.String name,
91          java.lang.String description, int startDateMonth, int startDateDay,
92          int startDateYear, int startDateHour, int startDateMinute,
93          int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
94          int endDateMinute, boolean neverExpire, boolean active,
95          java.lang.String limitCategories, java.lang.String limitSkus,
96          double minOrder, double discount, java.lang.String discountType)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException, java.rmi.RemoteException {
99          return getService()
100                    .updateCoupon(plid, couponId, name, description,
101             startDateMonth, startDateDay, startDateYear, startDateHour,
102             startDateMinute, endDateMonth, endDateDay, endDateYear,
103             endDateHour, endDateMinute, neverExpire, active, limitCategories,
104             limitSkus, minOrder, discount, discountType);
105     }
106 
107     public static ShoppingCouponService getService() {
108         if (_service == null) {
109             throw new RuntimeException("ShoppingCouponService is not set");
110         }
111 
112         return _service;
113     }
114 
115     public void setService(ShoppingCouponService service) {
116         _service = service;
117     }
118 
119     private static ShoppingCouponService _service;
120 }