001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link ShoppingCouponService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       ShoppingCouponService
030     * @generated
031     */
032    public class ShoppingCouponServiceUtil {
033            public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
034                    java.lang.String code, boolean autoCode, java.lang.String name,
035                    java.lang.String description, int startDateMonth, int startDateDay,
036                    int startDateYear, int startDateHour, int startDateMinute,
037                    int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
038                    int endDateMinute, boolean neverExpire, boolean active,
039                    java.lang.String limitCategories, java.lang.String limitSkus,
040                    double minOrder, double discount, java.lang.String discountType,
041                    com.liferay.portal.service.ServiceContext serviceContext)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    return getService()
045                                       .addCoupon(code, autoCode, name, description,
046                            startDateMonth, startDateDay, startDateYear, startDateHour,
047                            startDateMinute, endDateMonth, endDateDay, endDateYear,
048                            endDateHour, endDateMinute, neverExpire, active, limitCategories,
049                            limitSkus, minOrder, discount, discountType, serviceContext);
050            }
051    
052            public static void deleteCoupon(long groupId, long couponId)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    getService().deleteCoupon(groupId, couponId);
056            }
057    
058            public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
059                    long groupId, long couponId)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    return getService().getCoupon(groupId, couponId);
063            }
064    
065            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
066                    long groupId, long companyId, java.lang.String code, boolean active,
067                    java.lang.String discountType, boolean andOperator, int start, int end)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    return getService()
071                                       .search(groupId, companyId, code, active, discountType,
072                            andOperator, start, end);
073            }
074    
075            public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
076                    long couponId, java.lang.String name, java.lang.String description,
077                    int startDateMonth, int startDateDay, int startDateYear,
078                    int startDateHour, int startDateMinute, int endDateMonth,
079                    int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
080                    boolean neverExpire, boolean active, java.lang.String limitCategories,
081                    java.lang.String limitSkus, double minOrder, double discount,
082                    java.lang.String discountType,
083                    com.liferay.portal.service.ServiceContext serviceContext)
084                    throws com.liferay.portal.kernel.exception.PortalException,
085                            com.liferay.portal.kernel.exception.SystemException {
086                    return getService()
087                                       .updateCoupon(couponId, name, description, startDateMonth,
088                            startDateDay, startDateYear, startDateHour, startDateMinute,
089                            endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
090                            neverExpire, active, limitCategories, limitSkus, minOrder,
091                            discount, discountType, serviceContext);
092            }
093    
094            public static ShoppingCouponService getService() {
095                    if (_service == null) {
096                            _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
097                    }
098    
099                    return _service;
100            }
101    
102            public void setService(ShoppingCouponService service) {
103                    _service = service;
104            }
105    
106            private static ShoppingCouponService _service;
107    }