001    /**
002     * Copyright (c) 2000-2012 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    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the shopping coupon remote service. This utility wraps {@link com.liferay.portlet.shopping.service.impl.ShoppingCouponServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ShoppingCouponService
030     * @see com.liferay.portlet.shopping.service.base.ShoppingCouponServiceBaseImpl
031     * @see com.liferay.portlet.shopping.service.impl.ShoppingCouponServiceImpl
032     * @generated
033     */
034    public class ShoppingCouponServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCouponServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
041                    java.lang.String code, boolean autoCode, java.lang.String name,
042                    java.lang.String description, int startDateMonth, int startDateDay,
043                    int startDateYear, int startDateHour, int startDateMinute,
044                    int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
045                    int endDateMinute, boolean neverExpire, boolean active,
046                    java.lang.String limitCategories, java.lang.String limitSkus,
047                    double minOrder, double discount, java.lang.String discountType,
048                    com.liferay.portal.service.ServiceContext serviceContext)
049                    throws com.liferay.portal.kernel.exception.PortalException,
050                            com.liferay.portal.kernel.exception.SystemException {
051                    return getService()
052                                       .addCoupon(code, autoCode, name, description,
053                            startDateMonth, startDateDay, startDateYear, startDateHour,
054                            startDateMinute, endDateMonth, endDateDay, endDateYear,
055                            endDateHour, endDateMinute, neverExpire, active, limitCategories,
056                            limitSkus, minOrder, discount, discountType, serviceContext);
057            }
058    
059            public static void deleteCoupon(long groupId, long couponId)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    getService().deleteCoupon(groupId, couponId);
063            }
064    
065            public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
066                    long groupId, long couponId)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    return getService().getCoupon(groupId, couponId);
070            }
071    
072            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
073                    long groupId, long companyId, java.lang.String code, boolean active,
074                    java.lang.String discountType, boolean andOperator, int start, int end)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    return getService()
078                                       .search(groupId, companyId, code, active, discountType,
079                            andOperator, start, end);
080            }
081    
082            public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
083                    long couponId, java.lang.String name, java.lang.String description,
084                    int startDateMonth, int startDateDay, int startDateYear,
085                    int startDateHour, int startDateMinute, int endDateMonth,
086                    int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
087                    boolean neverExpire, boolean active, java.lang.String limitCategories,
088                    java.lang.String limitSkus, double minOrder, double discount,
089                    java.lang.String discountType,
090                    com.liferay.portal.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    return getService()
094                                       .updateCoupon(couponId, name, description, startDateMonth,
095                            startDateDay, startDateYear, startDateHour, startDateMinute,
096                            endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
097                            neverExpire, active, limitCategories, limitSkus, minOrder,
098                            discount, discountType, serviceContext);
099            }
100    
101            public static ShoppingCouponService getService() {
102                    if (_service == null) {
103                            _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
104    
105                            ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
106                                    "_service");
107                            MethodCache.remove(ShoppingCouponService.class);
108                    }
109    
110                    return _service;
111            }
112    
113            public void setService(ShoppingCouponService service) {
114                    MethodCache.remove(ShoppingCouponService.class);
115    
116                    _service = service;
117    
118                    ReferenceRegistry.registerReference(ShoppingCouponServiceUtil.class,
119                            "_service");
120                    MethodCache.remove(ShoppingCouponService.class);
121            }
122    
123            private static ShoppingCouponService _service;
124    }