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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.asset.service.AssetCategoryServiceUtil;
025
026
056 public class AssetCategoryServiceHttp {
057 public static com.liferay.portlet.asset.model.AssetCategory addCategory(
058 HttpPrincipal httpPrincipal, long parentCategoryId,
059 java.util.Map<java.util.Locale, java.lang.String> titleMap,
060 long vocabularyId, java.lang.String[] categoryProperties,
061 com.liferay.portal.service.ServiceContext serviceContext)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 try {
065 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
066 "addCategory", _addCategoryParameterTypes0);
067
068 MethodHandler methodHandler = new MethodHandler(methodKey,
069 parentCategoryId, titleMap, vocabularyId,
070 categoryProperties, serviceContext);
071
072 Object returnObj = null;
073
074 try {
075 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076 }
077 catch (Exception e) {
078 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079 throw (com.liferay.portal.kernel.exception.PortalException)e;
080 }
081
082 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083 throw (com.liferay.portal.kernel.exception.SystemException)e;
084 }
085
086 throw new com.liferay.portal.kernel.exception.SystemException(e);
087 }
088
089 return (com.liferay.portlet.asset.model.AssetCategory)returnObj;
090 }
091 catch (com.liferay.portal.kernel.exception.SystemException se) {
092 _log.error(se, se);
093
094 throw se;
095 }
096 }
097
098 public static void deleteCategory(HttpPrincipal httpPrincipal,
099 long categoryId)
100 throws com.liferay.portal.kernel.exception.PortalException,
101 com.liferay.portal.kernel.exception.SystemException {
102 try {
103 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
104 "deleteCategory", _deleteCategoryParameterTypes1);
105
106 MethodHandler methodHandler = new MethodHandler(methodKey,
107 categoryId);
108
109 try {
110 TunnelUtil.invoke(httpPrincipal, methodHandler);
111 }
112 catch (Exception e) {
113 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
114 throw (com.liferay.portal.kernel.exception.PortalException)e;
115 }
116
117 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
118 throw (com.liferay.portal.kernel.exception.SystemException)e;
119 }
120
121 throw new com.liferay.portal.kernel.exception.SystemException(e);
122 }
123 }
124 catch (com.liferay.portal.kernel.exception.SystemException se) {
125 _log.error(se, se);
126
127 throw se;
128 }
129 }
130
131 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories(
132 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
133 throws com.liferay.portal.kernel.exception.PortalException,
134 com.liferay.portal.kernel.exception.SystemException {
135 try {
136 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
137 "getCategories", _getCategoriesParameterTypes2);
138
139 MethodHandler methodHandler = new MethodHandler(methodKey,
140 className, classPK);
141
142 Object returnObj = null;
143
144 try {
145 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
146 }
147 catch (Exception e) {
148 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
149 throw (com.liferay.portal.kernel.exception.PortalException)e;
150 }
151
152 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
153 throw (com.liferay.portal.kernel.exception.SystemException)e;
154 }
155
156 throw new com.liferay.portal.kernel.exception.SystemException(e);
157 }
158
159 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
160 }
161 catch (com.liferay.portal.kernel.exception.SystemException se) {
162 _log.error(se, se);
163
164 throw se;
165 }
166 }
167
168 public static com.liferay.portlet.asset.model.AssetCategory getCategory(
169 HttpPrincipal httpPrincipal, long categoryId)
170 throws com.liferay.portal.kernel.exception.PortalException,
171 com.liferay.portal.kernel.exception.SystemException {
172 try {
173 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
174 "getCategory", _getCategoryParameterTypes3);
175
176 MethodHandler methodHandler = new MethodHandler(methodKey,
177 categoryId);
178
179 Object returnObj = null;
180
181 try {
182 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
183 }
184 catch (Exception e) {
185 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
186 throw (com.liferay.portal.kernel.exception.PortalException)e;
187 }
188
189 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
190 throw (com.liferay.portal.kernel.exception.SystemException)e;
191 }
192
193 throw new com.liferay.portal.kernel.exception.SystemException(e);
194 }
195
196 return (com.liferay.portlet.asset.model.AssetCategory)returnObj;
197 }
198 catch (com.liferay.portal.kernel.exception.SystemException se) {
199 _log.error(se, se);
200
201 throw se;
202 }
203 }
204
205 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
206 HttpPrincipal httpPrincipal, long parentCategoryId)
207 throws com.liferay.portal.kernel.exception.PortalException,
208 com.liferay.portal.kernel.exception.SystemException {
209 try {
210 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
211 "getChildCategories", _getChildCategoriesParameterTypes4);
212
213 MethodHandler methodHandler = new MethodHandler(methodKey,
214 parentCategoryId);
215
216 Object returnObj = null;
217
218 try {
219 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
220 }
221 catch (Exception e) {
222 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
223 throw (com.liferay.portal.kernel.exception.PortalException)e;
224 }
225
226 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
227 throw (com.liferay.portal.kernel.exception.SystemException)e;
228 }
229
230 throw new com.liferay.portal.kernel.exception.SystemException(e);
231 }
232
233 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
234 }
235 catch (com.liferay.portal.kernel.exception.SystemException se) {
236 _log.error(se, se);
237
238 throw se;
239 }
240 }
241
242 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
243 HttpPrincipal httpPrincipal, long parentCategoryId, int start, int end,
244 com.liferay.portal.kernel.util.OrderByComparator obc)
245 throws com.liferay.portal.kernel.exception.PortalException,
246 com.liferay.portal.kernel.exception.SystemException {
247 try {
248 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
249 "getChildCategories", _getChildCategoriesParameterTypes5);
250
251 MethodHandler methodHandler = new MethodHandler(methodKey,
252 parentCategoryId, start, end, obc);
253
254 Object returnObj = null;
255
256 try {
257 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
258 }
259 catch (Exception e) {
260 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
261 throw (com.liferay.portal.kernel.exception.PortalException)e;
262 }
263
264 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
265 throw (com.liferay.portal.kernel.exception.SystemException)e;
266 }
267
268 throw new com.liferay.portal.kernel.exception.SystemException(e);
269 }
270
271 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
272 }
273 catch (com.liferay.portal.kernel.exception.SystemException se) {
274 _log.error(se, se);
275
276 throw se;
277 }
278 }
279
280 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
281 HttpPrincipal httpPrincipal, long vocabularyId, int start, int end,
282 com.liferay.portal.kernel.util.OrderByComparator obc)
283 throws com.liferay.portal.kernel.exception.PortalException,
284 com.liferay.portal.kernel.exception.SystemException {
285 try {
286 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
287 "getVocabularyCategories",
288 _getVocabularyCategoriesParameterTypes6);
289
290 MethodHandler methodHandler = new MethodHandler(methodKey,
291 vocabularyId, start, end, obc);
292
293 Object returnObj = null;
294
295 try {
296 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
297 }
298 catch (Exception e) {
299 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
300 throw (com.liferay.portal.kernel.exception.PortalException)e;
301 }
302
303 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
304 throw (com.liferay.portal.kernel.exception.SystemException)e;
305 }
306
307 throw new com.liferay.portal.kernel.exception.SystemException(e);
308 }
309
310 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
311 }
312 catch (com.liferay.portal.kernel.exception.SystemException se) {
313 _log.error(se, se);
314
315 throw se;
316 }
317 }
318
319 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
320 HttpPrincipal httpPrincipal, long parentCategoryId, long vocabularyId,
321 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
322 throws com.liferay.portal.kernel.exception.PortalException,
323 com.liferay.portal.kernel.exception.SystemException {
324 try {
325 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
326 "getVocabularyCategories",
327 _getVocabularyCategoriesParameterTypes7);
328
329 MethodHandler methodHandler = new MethodHandler(methodKey,
330 parentCategoryId, vocabularyId, start, end, obc);
331
332 Object returnObj = null;
333
334 try {
335 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
336 }
337 catch (Exception e) {
338 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
339 throw (com.liferay.portal.kernel.exception.PortalException)e;
340 }
341
342 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
343 throw (com.liferay.portal.kernel.exception.SystemException)e;
344 }
345
346 throw new com.liferay.portal.kernel.exception.SystemException(e);
347 }
348
349 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
350 }
351 catch (com.liferay.portal.kernel.exception.SystemException se) {
352 _log.error(se, se);
353
354 throw se;
355 }
356 }
357
358 public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyRootCategories(
359 HttpPrincipal httpPrincipal, long vocabularyId, int start, int end,
360 com.liferay.portal.kernel.util.OrderByComparator obc)
361 throws com.liferay.portal.kernel.exception.PortalException,
362 com.liferay.portal.kernel.exception.SystemException {
363 try {
364 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
365 "getVocabularyRootCategories",
366 _getVocabularyRootCategoriesParameterTypes8);
367
368 MethodHandler methodHandler = new MethodHandler(methodKey,
369 vocabularyId, start, end, obc);
370
371 Object returnObj = null;
372
373 try {
374 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
375 }
376 catch (Exception e) {
377 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
378 throw (com.liferay.portal.kernel.exception.PortalException)e;
379 }
380
381 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
382 throw (com.liferay.portal.kernel.exception.SystemException)e;
383 }
384
385 throw new com.liferay.portal.kernel.exception.SystemException(e);
386 }
387
388 return (java.util.List<com.liferay.portlet.asset.model.AssetCategory>)returnObj;
389 }
390 catch (com.liferay.portal.kernel.exception.SystemException se) {
391 _log.error(se, se);
392
393 throw se;
394 }
395 }
396
397 public static com.liferay.portal.kernel.json.JSONArray search(
398 HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
399 java.lang.String[] categoryProperties, int start, int end)
400 throws com.liferay.portal.kernel.exception.PortalException,
401 com.liferay.portal.kernel.exception.SystemException {
402 try {
403 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
404 "search", _searchParameterTypes9);
405
406 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
407 name, categoryProperties, start, end);
408
409 Object returnObj = null;
410
411 try {
412 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
413 }
414 catch (Exception e) {
415 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
416 throw (com.liferay.portal.kernel.exception.PortalException)e;
417 }
418
419 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
420 throw (com.liferay.portal.kernel.exception.SystemException)e;
421 }
422
423 throw new com.liferay.portal.kernel.exception.SystemException(e);
424 }
425
426 return (com.liferay.portal.kernel.json.JSONArray)returnObj;
427 }
428 catch (com.liferay.portal.kernel.exception.SystemException se) {
429 _log.error(se, se);
430
431 throw se;
432 }
433 }
434
435 public static com.liferay.portlet.asset.model.AssetCategory updateCategory(
436 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
437 java.util.Map<java.util.Locale, java.lang.String> titleMap,
438 long vocabularyId, java.lang.String[] categoryProperties,
439 com.liferay.portal.service.ServiceContext serviceContext)
440 throws com.liferay.portal.kernel.exception.PortalException,
441 com.liferay.portal.kernel.exception.SystemException {
442 try {
443 MethodKey methodKey = new MethodKey(AssetCategoryServiceUtil.class.getName(),
444 "updateCategory", _updateCategoryParameterTypes10);
445
446 MethodHandler methodHandler = new MethodHandler(methodKey,
447 categoryId, parentCategoryId, titleMap, vocabularyId,
448 categoryProperties, serviceContext);
449
450 Object returnObj = null;
451
452 try {
453 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
454 }
455 catch (Exception e) {
456 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
457 throw (com.liferay.portal.kernel.exception.PortalException)e;
458 }
459
460 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
461 throw (com.liferay.portal.kernel.exception.SystemException)e;
462 }
463
464 throw new com.liferay.portal.kernel.exception.SystemException(e);
465 }
466
467 return (com.liferay.portlet.asset.model.AssetCategory)returnObj;
468 }
469 catch (com.liferay.portal.kernel.exception.SystemException se) {
470 _log.error(se, se);
471
472 throw se;
473 }
474 }
475
476 private static Log _log = LogFactoryUtil.getLog(AssetCategoryServiceHttp.class);
477 private static final Class<?>[] _addCategoryParameterTypes0 = new Class[] {
478 long.class, java.util.Map.class, long.class,
479 java.lang.String[].class,
480 com.liferay.portal.service.ServiceContext.class
481 };
482 private static final Class<?>[] _deleteCategoryParameterTypes1 = new Class[] {
483 long.class
484 };
485 private static final Class<?>[] _getCategoriesParameterTypes2 = new Class[] {
486 java.lang.String.class, long.class
487 };
488 private static final Class<?>[] _getCategoryParameterTypes3 = new Class[] {
489 long.class
490 };
491 private static final Class<?>[] _getChildCategoriesParameterTypes4 = new Class[] {
492 long.class
493 };
494 private static final Class<?>[] _getChildCategoriesParameterTypes5 = new Class[] {
495 long.class, int.class, int.class,
496 com.liferay.portal.kernel.util.OrderByComparator.class
497 };
498 private static final Class<?>[] _getVocabularyCategoriesParameterTypes6 = new Class[] {
499 long.class, int.class, int.class,
500 com.liferay.portal.kernel.util.OrderByComparator.class
501 };
502 private static final Class<?>[] _getVocabularyCategoriesParameterTypes7 = new Class[] {
503 long.class, long.class, int.class, int.class,
504 com.liferay.portal.kernel.util.OrderByComparator.class
505 };
506 private static final Class<?>[] _getVocabularyRootCategoriesParameterTypes8 = new Class[] {
507 long.class, int.class, int.class,
508 com.liferay.portal.kernel.util.OrderByComparator.class
509 };
510 private static final Class<?>[] _searchParameterTypes9 = new Class[] {
511 long.class, java.lang.String.class, java.lang.String[].class,
512 int.class, int.class
513 };
514 private static final Class<?>[] _updateCategoryParameterTypes10 = new Class[] {
515 long.class, long.class, java.util.Map.class, long.class,
516 java.lang.String[].class,
517 com.liferay.portal.service.ServiceContext.class
518 };
519 }