001
014
015 package com.liferay.portlet.asset.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 AssetCategoryServiceUtil {
035
040 public static com.liferay.portlet.asset.model.AssetCategory addCategory(
041 long parentCategoryId,
042 java.util.Map<java.util.Locale, java.lang.String> titleMap,
043 long vocabularyId, java.lang.String[] categoryProperties,
044 com.liferay.portal.service.ServiceContext serviceContext)
045 throws com.liferay.portal.kernel.exception.PortalException,
046 com.liferay.portal.kernel.exception.SystemException {
047 return getService()
048 .addCategory(parentCategoryId, titleMap, vocabularyId,
049 categoryProperties, serviceContext);
050 }
051
052 public static void deleteCategory(long categoryId)
053 throws com.liferay.portal.kernel.exception.PortalException,
054 com.liferay.portal.kernel.exception.SystemException {
055 getService().deleteCategory(categoryId);
056 }
057
058 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories(
059 java.lang.String className, long classPK)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 return getService().getCategories(className, classPK);
063 }
064
065 public static com.liferay.portlet.asset.model.AssetCategory getCategory(
066 long categoryId)
067 throws com.liferay.portal.kernel.exception.PortalException,
068 com.liferay.portal.kernel.exception.SystemException {
069 return getService().getCategory(categoryId);
070 }
071
072 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
073 long parentCategoryId)
074 throws com.liferay.portal.kernel.exception.PortalException,
075 com.liferay.portal.kernel.exception.SystemException {
076 return getService().getChildCategories(parentCategoryId);
077 }
078
079 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
080 long parentCategoryId, int start, int end,
081 com.liferay.portal.kernel.util.OrderByComparator obc)
082 throws com.liferay.portal.kernel.exception.PortalException,
083 com.liferay.portal.kernel.exception.SystemException {
084 return getService().getChildCategories(parentCategoryId, start, end, obc);
085 }
086
087 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
088 long vocabularyId, int start, int end,
089 com.liferay.portal.kernel.util.OrderByComparator obc)
090 throws com.liferay.portal.kernel.exception.PortalException,
091 com.liferay.portal.kernel.exception.SystemException {
092 return getService()
093 .getVocabularyCategories(vocabularyId, start, end, obc);
094 }
095
096 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
097 long parentCategoryId, long vocabularyId, int start, int end,
098 com.liferay.portal.kernel.util.OrderByComparator obc)
099 throws com.liferay.portal.kernel.exception.PortalException,
100 com.liferay.portal.kernel.exception.SystemException {
101 return getService()
102 .getVocabularyCategories(parentCategoryId, vocabularyId,
103 start, end, obc);
104 }
105
106 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyRootCategories(
107 long vocabularyId, int start, int end,
108 com.liferay.portal.kernel.util.OrderByComparator obc)
109 throws com.liferay.portal.kernel.exception.PortalException,
110 com.liferay.portal.kernel.exception.SystemException {
111 return getService()
112 .getVocabularyRootCategories(vocabularyId, start, end, obc);
113 }
114
115 public static com.liferay.portal.kernel.json.JSONArray search(
116 long groupId, java.lang.String name,
117 java.lang.String[] categoryProperties, int start, int end)
118 throws com.liferay.portal.kernel.exception.PortalException,
119 com.liferay.portal.kernel.exception.SystemException {
120 return getService().search(groupId, name, categoryProperties, start, end);
121 }
122
123 public static com.liferay.portlet.asset.model.AssetCategory moveCategory(
124 long categoryId, long parentCategoryId, long vocabularyId,
125 com.liferay.portal.service.ServiceContext serviceContext)
126 throws com.liferay.portal.kernel.exception.PortalException,
127 com.liferay.portal.kernel.exception.SystemException {
128 return getService()
129 .moveCategory(categoryId, parentCategoryId, vocabularyId,
130 serviceContext);
131 }
132
133 public static com.liferay.portlet.asset.model.AssetCategory updateCategory(
134 long categoryId, long parentCategoryId,
135 java.util.Map<java.util.Locale, java.lang.String> titleMap,
136 long vocabularyId, java.lang.String[] categoryProperties,
137 com.liferay.portal.service.ServiceContext serviceContext)
138 throws com.liferay.portal.kernel.exception.PortalException,
139 com.liferay.portal.kernel.exception.SystemException {
140 return getService()
141 .updateCategory(categoryId, parentCategoryId, titleMap,
142 vocabularyId, categoryProperties, serviceContext);
143 }
144
145 public static AssetCategoryService getService() {
146 if (_service == null) {
147 _service = (AssetCategoryService)PortalBeanLocatorUtil.locate(AssetCategoryService.class.getName());
148
149 ReferenceRegistry.registerReference(AssetCategoryServiceUtil.class,
150 "_service");
151 MethodCache.remove(AssetCategoryService.class);
152 }
153
154 return _service;
155 }
156
157 public void setService(AssetCategoryService service) {
158 MethodCache.remove(AssetCategoryService.class);
159
160 _service = service;
161
162 ReferenceRegistry.registerReference(AssetCategoryServiceUtil.class,
163 "_service");
164 MethodCache.remove(AssetCategoryService.class);
165 }
166
167 private static AssetCategoryService _service;
168 }