001
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
034 public class ShoppingCategoryServiceUtil {
035
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 }