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.asset.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link AssetCategoryService} 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       AssetCategoryService
030     * @generated
031     */
032    public class AssetCategoryServiceUtil {
033            public static com.liferay.portlet.asset.model.AssetCategory addCategory(
034                    long parentCategoryId,
035                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
036                    long vocabularyId, java.lang.String[] categoryProperties,
037                    com.liferay.portal.service.ServiceContext serviceContext)
038                    throws com.liferay.portal.kernel.exception.PortalException,
039                            com.liferay.portal.kernel.exception.SystemException {
040                    return getService()
041                                       .addCategory(parentCategoryId, titleMap, vocabularyId,
042                            categoryProperties, serviceContext);
043            }
044    
045            public static void deleteCategory(long categoryId)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    getService().deleteCategory(categoryId);
049            }
050    
051            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories(
052                    java.lang.String className, long classPK)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    return getService().getCategories(className, classPK);
056            }
057    
058            public static com.liferay.portlet.asset.model.AssetCategory getCategory(
059                    long categoryId)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    return getService().getCategory(categoryId);
063            }
064    
065            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
066                    long parentCategoryId, int start, int end,
067                    com.liferay.portal.kernel.util.OrderByComparator obc)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    return getService().getChildCategories(parentCategoryId, start, end, obc);
071            }
072    
073            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
074                    long vocabularyId, int start, int end,
075                    com.liferay.portal.kernel.util.OrderByComparator obc)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    return getService()
079                                       .getVocabularyCategories(vocabularyId, start, end, obc);
080            }
081    
082            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyRootCategories(
083                    long vocabularyId, int start, int end,
084                    com.liferay.portal.kernel.util.OrderByComparator obc)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    return getService()
088                                       .getVocabularyRootCategories(vocabularyId, start, end, obc);
089            }
090    
091            public static com.liferay.portal.kernel.json.JSONArray search(
092                    long groupId, java.lang.String name,
093                    java.lang.String[] categoryProperties, int start, int end)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getService().search(groupId, name, categoryProperties, start, end);
096            }
097    
098            public static com.liferay.portlet.asset.model.AssetCategory updateCategory(
099                    long categoryId, long parentCategoryId,
100                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
101                    long vocabularyId, java.lang.String[] categoryProperties,
102                    com.liferay.portal.service.ServiceContext serviceContext)
103                    throws com.liferay.portal.kernel.exception.PortalException,
104                            com.liferay.portal.kernel.exception.SystemException {
105                    return getService()
106                                       .updateCategory(categoryId, parentCategoryId, titleMap,
107                            vocabularyId, categoryProperties, serviceContext);
108            }
109    
110            public static AssetCategoryService getService() {
111                    if (_service == null) {
112                            _service = (AssetCategoryService)PortalBeanLocatorUtil.locate(AssetCategoryService.class.getName());
113                    }
114    
115                    return _service;
116            }
117    
118            public void setService(AssetCategoryService service) {
119                    _service = service;
120            }
121    
122            private static AssetCategoryService _service;
123    }