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 ShoppingCategoryService} 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       ShoppingCategoryService
030     * @generated
031     */
032    public class ShoppingCategoryServiceUtil {
033            public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
034                    long parentCategoryId, java.lang.String name,
035                    java.lang.String description,
036                    com.liferay.portal.service.ServiceContext serviceContext)
037                    throws com.liferay.portal.kernel.exception.PortalException,
038                            com.liferay.portal.kernel.exception.SystemException {
039                    return getService()
040                                       .addCategory(parentCategoryId, name, description,
041                            serviceContext);
042            }
043    
044            public static void deleteCategory(long categoryId)
045                    throws com.liferay.portal.kernel.exception.PortalException,
046                            com.liferay.portal.kernel.exception.SystemException {
047                    getService().deleteCategory(categoryId);
048            }
049    
050            public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
051                    long categoryId)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    return getService().getCategory(categoryId);
055            }
056    
057            public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
058                    long categoryId, long parentCategoryId, java.lang.String name,
059                    java.lang.String description, boolean mergeWithParentCategory,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    return getService()
064                                       .updateCategory(categoryId, parentCategoryId, name,
065                            description, mergeWithParentCategory, serviceContext);
066            }
067    
068            public static ShoppingCategoryService getService() {
069                    if (_service == null) {
070                            _service = (ShoppingCategoryService)PortalBeanLocatorUtil.locate(ShoppingCategoryService.class.getName());
071                    }
072    
073                    return _service;
074            }
075    
076            public void setService(ShoppingCategoryService service) {
077                    _service = service;
078            }
079    
080            private static ShoppingCategoryService _service;
081    }