001
014
015 package com.liferay.portlet.asset.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LocalizationUtil;
020
021 import com.liferay.portlet.asset.service.AssetCategoryServiceUtil;
022
023 import java.rmi.RemoteException;
024
025 import java.util.Locale;
026 import java.util.Map;
027
028
070 public class AssetCategoryServiceSoap {
071 public static com.liferay.portlet.asset.model.AssetCategorySoap addCategory(
072 long parentCategoryId, java.lang.String[] titleMapLanguageIds,
073 java.lang.String[] titleMapValues,
074 java.lang.String[] descriptionMapLanguageIds,
075 java.lang.String[] descriptionMapValues, long vocabularyId,
076 java.lang.String[] categoryProperties,
077 com.liferay.portal.service.ServiceContext serviceContext)
078 throws RemoteException {
079 try {
080 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
081 titleMapValues);
082 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
083 descriptionMapValues);
084
085 com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.addCategory(parentCategoryId,
086 titleMap, descriptionMap, vocabularyId, categoryProperties,
087 serviceContext);
088
089 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
090 }
091 catch (Exception e) {
092 _log.error(e, e);
093
094 throw new RemoteException(e.getMessage());
095 }
096 }
097
098 public static void deleteCategories(long[] categoryIds)
099 throws RemoteException {
100 try {
101 AssetCategoryServiceUtil.deleteCategories(categoryIds);
102 }
103 catch (Exception e) {
104 _log.error(e, e);
105
106 throw new RemoteException(e.getMessage());
107 }
108 }
109
110 public static void deleteCategory(long categoryId)
111 throws RemoteException {
112 try {
113 AssetCategoryServiceUtil.deleteCategory(categoryId);
114 }
115 catch (Exception e) {
116 _log.error(e, e);
117
118 throw new RemoteException(e.getMessage());
119 }
120 }
121
122 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getCategories(
123 java.lang.String className, long classPK) throws RemoteException {
124 try {
125 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
126 AssetCategoryServiceUtil.getCategories(className, classPK);
127
128 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
129 }
130 catch (Exception e) {
131 _log.error(e, e);
132
133 throw new RemoteException(e.getMessage());
134 }
135 }
136
137 public static com.liferay.portlet.asset.model.AssetCategorySoap getCategory(
138 long categoryId) throws RemoteException {
139 try {
140 com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.getCategory(categoryId);
141
142 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
143 }
144 catch (Exception e) {
145 _log.error(e, e);
146
147 throw new RemoteException(e.getMessage());
148 }
149 }
150
151 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
152 long parentCategoryId) throws RemoteException {
153 try {
154 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
155 AssetCategoryServiceUtil.getChildCategories(parentCategoryId);
156
157 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
158 }
159 catch (Exception e) {
160 _log.error(e, e);
161
162 throw new RemoteException(e.getMessage());
163 }
164 }
165
166 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getChildCategories(
167 long parentCategoryId, int start, int end,
168 com.liferay.portal.kernel.util.OrderByComparator obc)
169 throws RemoteException {
170 try {
171 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
172 AssetCategoryServiceUtil.getChildCategories(parentCategoryId,
173 start, end, obc);
174
175 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
176 }
177 catch (Exception e) {
178 _log.error(e, e);
179
180 throw new RemoteException(e.getMessage());
181 }
182 }
183
184 public static java.lang.String getJSONSearch(long groupId,
185 java.lang.String name, long[] vocabularyIds, int start, int end)
186 throws RemoteException {
187 try {
188 com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.getJSONSearch(groupId,
189 name, vocabularyIds, start, end);
190
191 return returnValue.toString();
192 }
193 catch (Exception e) {
194 _log.error(e, e);
195
196 throw new RemoteException(e.getMessage());
197 }
198 }
199
200 public static java.lang.String getJSONVocabularyCategories(
201 long vocabularyId, int start, int end,
202 com.liferay.portal.kernel.util.OrderByComparator obc)
203 throws RemoteException {
204 try {
205 com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(vocabularyId,
206 start, end, obc);
207
208 return returnValue.toString();
209 }
210 catch (Exception e) {
211 _log.error(e, e);
212
213 throw new RemoteException(e.getMessage());
214 }
215 }
216
217 public static java.lang.String getJSONVocabularyCategories(long groupId,
218 java.lang.String name, long vocabularyId, int start, int end,
219 com.liferay.portal.kernel.util.OrderByComparator obc)
220 throws RemoteException {
221 try {
222 com.liferay.portal.kernel.json.JSONObject returnValue = AssetCategoryServiceUtil.getJSONVocabularyCategories(groupId,
223 name, vocabularyId, start, end, obc);
224
225 return returnValue.toString();
226 }
227 catch (Exception e) {
228 _log.error(e, e);
229
230 throw new RemoteException(e.getMessage());
231 }
232 }
233
234 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
235 long vocabularyId, int start, int end,
236 com.liferay.portal.kernel.util.OrderByComparator obc)
237 throws RemoteException {
238 try {
239 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
240 AssetCategoryServiceUtil.getVocabularyCategories(vocabularyId,
241 start, end, obc);
242
243 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
244 }
245 catch (Exception e) {
246 _log.error(e, e);
247
248 throw new RemoteException(e.getMessage());
249 }
250 }
251
252 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
253 long parentCategoryId, long vocabularyId, int start, int end,
254 com.liferay.portal.kernel.util.OrderByComparator obc)
255 throws RemoteException {
256 try {
257 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
258 AssetCategoryServiceUtil.getVocabularyCategories(parentCategoryId,
259 vocabularyId, start, end, obc);
260
261 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
262 }
263 catch (Exception e) {
264 _log.error(e, e);
265
266 throw new RemoteException(e.getMessage());
267 }
268 }
269
270 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyCategories(
271 long groupId, java.lang.String name, long vocabularyId, int start,
272 int end, com.liferay.portal.kernel.util.OrderByComparator obc)
273 throws RemoteException {
274 try {
275 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
276 AssetCategoryServiceUtil.getVocabularyCategories(groupId, name,
277 vocabularyId, start, end, obc);
278
279 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
280 }
281 catch (Exception e) {
282 _log.error(e, e);
283
284 throw new RemoteException(e.getMessage());
285 }
286 }
287
288 public static int getVocabularyCategoriesCount(long groupId,
289 long vocabularyId) throws RemoteException {
290 try {
291 int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
292 vocabularyId);
293
294 return returnValue;
295 }
296 catch (Exception e) {
297 _log.error(e, e);
298
299 throw new RemoteException(e.getMessage());
300 }
301 }
302
303 public static int getVocabularyCategoriesCount(long groupId,
304 java.lang.String name, long vocabularyId) throws RemoteException {
305 try {
306 int returnValue = AssetCategoryServiceUtil.getVocabularyCategoriesCount(groupId,
307 name, vocabularyId);
308
309 return returnValue;
310 }
311 catch (Exception e) {
312 _log.error(e, e);
313
314 throw new RemoteException(e.getMessage());
315 }
316 }
317
318 public static com.liferay.portlet.asset.model.AssetCategorySoap[] getVocabularyRootCategories(
319 long vocabularyId, int start, int end,
320 com.liferay.portal.kernel.util.OrderByComparator obc)
321 throws RemoteException {
322 try {
323 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
324 AssetCategoryServiceUtil.getVocabularyRootCategories(vocabularyId,
325 start, end, obc);
326
327 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
328 }
329 catch (Exception e) {
330 _log.error(e, e);
331
332 throw new RemoteException(e.getMessage());
333 }
334 }
335
336 public static com.liferay.portlet.asset.model.AssetCategorySoap moveCategory(
337 long categoryId, long parentCategoryId, long vocabularyId,
338 com.liferay.portal.service.ServiceContext serviceContext)
339 throws RemoteException {
340 try {
341 com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.moveCategory(categoryId,
342 parentCategoryId, vocabularyId, serviceContext);
343
344 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
345 }
346 catch (Exception e) {
347 _log.error(e, e);
348
349 throw new RemoteException(e.getMessage());
350 }
351 }
352
353 public static com.liferay.portlet.asset.model.AssetCategorySoap[] search(
354 long groupId, java.lang.String keywords, long vocabularyId, int start,
355 int end, com.liferay.portal.kernel.util.OrderByComparator obc)
356 throws RemoteException {
357 try {
358 java.util.List<com.liferay.portlet.asset.model.AssetCategory> returnValue =
359 AssetCategoryServiceUtil.search(groupId, keywords,
360 vocabularyId, start, end, obc);
361
362 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModels(returnValue);
363 }
364 catch (Exception e) {
365 _log.error(e, e);
366
367 throw new RemoteException(e.getMessage());
368 }
369 }
370
371 public static java.lang.String search(long groupId, java.lang.String name,
372 java.lang.String[] categoryProperties, int start, int end)
373 throws RemoteException {
374 try {
375 com.liferay.portal.kernel.json.JSONArray returnValue = AssetCategoryServiceUtil.search(groupId,
376 name, categoryProperties, start, end);
377
378 return returnValue.toString();
379 }
380 catch (Exception e) {
381 _log.error(e, e);
382
383 throw new RemoteException(e.getMessage());
384 }
385 }
386
387 public static com.liferay.portlet.asset.model.AssetCategorySoap updateCategory(
388 long categoryId, long parentCategoryId,
389 java.lang.String[] titleMapLanguageIds,
390 java.lang.String[] titleMapValues,
391 java.lang.String[] descriptionMapLanguageIds,
392 java.lang.String[] descriptionMapValues, long vocabularyId,
393 java.lang.String[] categoryProperties,
394 com.liferay.portal.service.ServiceContext serviceContext)
395 throws RemoteException {
396 try {
397 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
398 titleMapValues);
399 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
400 descriptionMapValues);
401
402 com.liferay.portlet.asset.model.AssetCategory returnValue = AssetCategoryServiceUtil.updateCategory(categoryId,
403 parentCategoryId, titleMap, descriptionMap, vocabularyId,
404 categoryProperties, serviceContext);
405
406 return com.liferay.portlet.asset.model.AssetCategorySoap.toSoapModel(returnValue);
407 }
408 catch (Exception e) {
409 _log.error(e, e);
410
411 throw new RemoteException(e.getMessage());
412 }
413 }
414
415 private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceSoap.class);
416 }