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 category remote service. This utility wraps {@link com.liferay.portlet.shopping.service.impl.ShoppingCategoryServiceImpl} 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 ShoppingCategoryService
030     * @see com.liferay.portlet.shopping.service.base.ShoppingCategoryServiceBaseImpl
031     * @see com.liferay.portlet.shopping.service.impl.ShoppingCategoryServiceImpl
032     * @generated
033     */
034    public class ShoppingCategoryServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCategoryServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
041                    long parentCategoryId, java.lang.String name,
042                    java.lang.String description,
043                    com.liferay.portal.service.ServiceContext serviceContext)
044                    throws com.liferay.portal.kernel.exception.PortalException,
045                            com.liferay.portal.kernel.exception.SystemException {
046                    return getService()
047                                       .addCategory(parentCategoryId, name, description,
048                            serviceContext);
049            }
050    
051            public static void deleteCategory(long categoryId)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    getService().deleteCategory(categoryId);
055            }
056    
057            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
058                    long groupId)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    return getService().getCategories(groupId);
061            }
062    
063            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
064                    long groupId, long parentCategoryId, int start, int end)
065                    throws com.liferay.portal.kernel.exception.SystemException {
066                    return getService().getCategories(groupId, parentCategoryId, start, end);
067            }
068    
069            public static int getCategoriesCount(long groupId, long parentCategoryId)
070                    throws com.liferay.portal.kernel.exception.SystemException {
071                    return getService().getCategoriesCount(groupId, parentCategoryId);
072            }
073    
074            public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
075                    long categoryId)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    return getService().getCategory(categoryId);
079            }
080    
081            public static void getSubcategoryIds(
082                    java.util.List<java.lang.Long> categoryIds, long groupId,
083                    long categoryId)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    getService().getSubcategoryIds(categoryIds, groupId, categoryId);
086            }
087    
088            public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
089                    long categoryId, long parentCategoryId, java.lang.String name,
090                    java.lang.String description, boolean mergeWithParentCategory,
091                    com.liferay.portal.service.ServiceContext serviceContext)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    return getService()
095                                       .updateCategory(categoryId, parentCategoryId, name,
096                            description, mergeWithParentCategory, serviceContext);
097            }
098    
099            public static ShoppingCategoryService getService() {
100                    if (_service == null) {
101                            _service = (ShoppingCategoryService)PortalBeanLocatorUtil.locate(ShoppingCategoryService.class.getName());
102    
103                            ReferenceRegistry.registerReference(ShoppingCategoryServiceUtil.class,
104                                    "_service");
105                            MethodCache.remove(ShoppingCategoryService.class);
106                    }
107    
108                    return _service;
109            }
110    
111            public void setService(ShoppingCategoryService service) {
112                    MethodCache.remove(ShoppingCategoryService.class);
113    
114                    _service = service;
115    
116                    ReferenceRegistry.registerReference(ShoppingCategoryServiceUtil.class,
117                            "_service");
118                    MethodCache.remove(ShoppingCategoryService.class);
119            }
120    
121            private static ShoppingCategoryService _service;
122    }