001
014
015 package com.liferay.portlet.messageboards.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.messageboards.service.MBCategoryServiceUtil;
025
026
056 public class MBCategoryServiceHttp {
057 public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
058 HttpPrincipal httpPrincipal, long parentCategoryId,
059 java.lang.String name, java.lang.String description,
060 java.lang.String emailAddress, java.lang.String inProtocol,
061 java.lang.String inServerName, int inServerPort, boolean inUseSSL,
062 java.lang.String inUserName, java.lang.String inPassword,
063 int inReadInterval, java.lang.String outEmailAddress,
064 boolean outCustom, java.lang.String outServerName, int outServerPort,
065 boolean outUseSSL, java.lang.String outUserName,
066 java.lang.String outPassword, boolean mailingListActive,
067 com.liferay.portal.service.ServiceContext serviceContext)
068 throws com.liferay.portal.kernel.exception.PortalException,
069 com.liferay.portal.kernel.exception.SystemException {
070 try {
071 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
072 "addCategory", _addCategoryParameterTypes0);
073
074 MethodHandler methodHandler = new MethodHandler(methodKey,
075 parentCategoryId, name, description, emailAddress,
076 inProtocol, inServerName, inServerPort, inUseSSL,
077 inUserName, inPassword, inReadInterval, outEmailAddress,
078 outCustom, outServerName, outServerPort, outUseSSL,
079 outUserName, outPassword, mailingListActive, serviceContext);
080
081 Object returnObj = null;
082
083 try {
084 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
085 }
086 catch (Exception e) {
087 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
088 throw (com.liferay.portal.kernel.exception.PortalException)e;
089 }
090
091 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
092 throw (com.liferay.portal.kernel.exception.SystemException)e;
093 }
094
095 throw new com.liferay.portal.kernel.exception.SystemException(e);
096 }
097
098 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
099 }
100 catch (com.liferay.portal.kernel.exception.SystemException se) {
101 _log.error(se, se);
102
103 throw se;
104 }
105 }
106
107 public static void deleteCategory(HttpPrincipal httpPrincipal,
108 long groupId, long categoryId)
109 throws com.liferay.portal.kernel.exception.PortalException,
110 com.liferay.portal.kernel.exception.SystemException {
111 try {
112 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
113 "deleteCategory", _deleteCategoryParameterTypes1);
114
115 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
116 categoryId);
117
118 try {
119 TunnelUtil.invoke(httpPrincipal, methodHandler);
120 }
121 catch (Exception e) {
122 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
123 throw (com.liferay.portal.kernel.exception.PortalException)e;
124 }
125
126 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
127 throw (com.liferay.portal.kernel.exception.SystemException)e;
128 }
129
130 throw new com.liferay.portal.kernel.exception.SystemException(e);
131 }
132 }
133 catch (com.liferay.portal.kernel.exception.SystemException se) {
134 _log.error(se, se);
135
136 throw se;
137 }
138 }
139
140 public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
141 HttpPrincipal httpPrincipal, long groupId, long parentCategoryId,
142 int start, int end)
143 throws com.liferay.portal.kernel.exception.SystemException {
144 try {
145 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
146 "getCategories", _getCategoriesParameterTypes2);
147
148 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
149 parentCategoryId, start, end);
150
151 Object returnObj = null;
152
153 try {
154 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
155 }
156 catch (Exception e) {
157 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158 throw (com.liferay.portal.kernel.exception.SystemException)e;
159 }
160
161 throw new com.liferay.portal.kernel.exception.SystemException(e);
162 }
163
164 return (java.util.List<com.liferay.portlet.messageboards.model.MBCategory>)returnObj;
165 }
166 catch (com.liferay.portal.kernel.exception.SystemException se) {
167 _log.error(se, se);
168
169 throw se;
170 }
171 }
172
173 public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
174 HttpPrincipal httpPrincipal, long groupId, long[] parentCategoryIds,
175 int start, int end)
176 throws com.liferay.portal.kernel.exception.SystemException {
177 try {
178 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
179 "getCategories", _getCategoriesParameterTypes3);
180
181 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
182 parentCategoryIds, start, end);
183
184 Object returnObj = null;
185
186 try {
187 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
188 }
189 catch (Exception e) {
190 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
191 throw (com.liferay.portal.kernel.exception.SystemException)e;
192 }
193
194 throw new com.liferay.portal.kernel.exception.SystemException(e);
195 }
196
197 return (java.util.List<com.liferay.portlet.messageboards.model.MBCategory>)returnObj;
198 }
199 catch (com.liferay.portal.kernel.exception.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 public static int getCategoriesCount(HttpPrincipal httpPrincipal,
207 long groupId, long parentCategoryId)
208 throws com.liferay.portal.kernel.exception.SystemException {
209 try {
210 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
211 "getCategoriesCount", _getCategoriesCountParameterTypes4);
212
213 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
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.SystemException) {
223 throw (com.liferay.portal.kernel.exception.SystemException)e;
224 }
225
226 throw new com.liferay.portal.kernel.exception.SystemException(e);
227 }
228
229 return ((Integer)returnObj).intValue();
230 }
231 catch (com.liferay.portal.kernel.exception.SystemException se) {
232 _log.error(se, se);
233
234 throw se;
235 }
236 }
237
238 public static int getCategoriesCount(HttpPrincipal httpPrincipal,
239 long groupId, long[] parentCategoryIds)
240 throws com.liferay.portal.kernel.exception.SystemException {
241 try {
242 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
243 "getCategoriesCount", _getCategoriesCountParameterTypes5);
244
245 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
246 parentCategoryIds);
247
248 Object returnObj = null;
249
250 try {
251 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
252 }
253 catch (Exception e) {
254 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
255 throw (com.liferay.portal.kernel.exception.SystemException)e;
256 }
257
258 throw new com.liferay.portal.kernel.exception.SystemException(e);
259 }
260
261 return ((Integer)returnObj).intValue();
262 }
263 catch (com.liferay.portal.kernel.exception.SystemException se) {
264 _log.error(se, se);
265
266 throw se;
267 }
268 }
269
270 public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
271 HttpPrincipal httpPrincipal, long categoryId)
272 throws com.liferay.portal.kernel.exception.PortalException,
273 com.liferay.portal.kernel.exception.SystemException {
274 try {
275 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
276 "getCategory", _getCategoryParameterTypes6);
277
278 MethodHandler methodHandler = new MethodHandler(methodKey,
279 categoryId);
280
281 Object returnObj = null;
282
283 try {
284 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
285 }
286 catch (Exception e) {
287 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
288 throw (com.liferay.portal.kernel.exception.PortalException)e;
289 }
290
291 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
292 throw (com.liferay.portal.kernel.exception.SystemException)e;
293 }
294
295 throw new com.liferay.portal.kernel.exception.SystemException(e);
296 }
297
298 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
299 }
300 catch (com.liferay.portal.kernel.exception.SystemException se) {
301 _log.error(se, se);
302
303 throw se;
304 }
305 }
306
307 public static long[] getCategoryIds(HttpPrincipal httpPrincipal,
308 long groupId, long categoryId)
309 throws com.liferay.portal.kernel.exception.SystemException {
310 try {
311 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
312 "getCategoryIds", _getCategoryIdsParameterTypes7);
313
314 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
315 categoryId);
316
317 Object returnObj = null;
318
319 try {
320 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
321 }
322 catch (Exception e) {
323 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
324 throw (com.liferay.portal.kernel.exception.SystemException)e;
325 }
326
327 throw new com.liferay.portal.kernel.exception.SystemException(e);
328 }
329
330 return (long[])returnObj;
331 }
332 catch (com.liferay.portal.kernel.exception.SystemException se) {
333 _log.error(se, se);
334
335 throw se;
336 }
337 }
338
339 public static java.util.List<java.lang.Long> getSubcategoryIds(
340 HttpPrincipal httpPrincipal,
341 java.util.List<java.lang.Long> categoryIds, long groupId,
342 long categoryId)
343 throws com.liferay.portal.kernel.exception.SystemException {
344 try {
345 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
346 "getSubcategoryIds", _getSubcategoryIdsParameterTypes8);
347
348 MethodHandler methodHandler = new MethodHandler(methodKey,
349 categoryIds, groupId, categoryId);
350
351 Object returnObj = null;
352
353 try {
354 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
355 }
356 catch (Exception e) {
357 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
358 throw (com.liferay.portal.kernel.exception.SystemException)e;
359 }
360
361 throw new com.liferay.portal.kernel.exception.SystemException(e);
362 }
363
364 return (java.util.List<java.lang.Long>)returnObj;
365 }
366 catch (com.liferay.portal.kernel.exception.SystemException se) {
367 _log.error(se, se);
368
369 throw se;
370 }
371 }
372
373 public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
374 HttpPrincipal httpPrincipal, long groupId, long userId, int start,
375 int end) throws com.liferay.portal.kernel.exception.SystemException {
376 try {
377 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
378 "getSubscribedCategories",
379 _getSubscribedCategoriesParameterTypes9);
380
381 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
382 userId, start, end);
383
384 Object returnObj = null;
385
386 try {
387 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
388 }
389 catch (Exception e) {
390 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
391 throw (com.liferay.portal.kernel.exception.SystemException)e;
392 }
393
394 throw new com.liferay.portal.kernel.exception.SystemException(e);
395 }
396
397 return (java.util.List<com.liferay.portlet.messageboards.model.MBCategory>)returnObj;
398 }
399 catch (com.liferay.portal.kernel.exception.SystemException se) {
400 _log.error(se, se);
401
402 throw se;
403 }
404 }
405
406 public static int getSubscribedCategoriesCount(
407 HttpPrincipal httpPrincipal, long groupId, long userId)
408 throws com.liferay.portal.kernel.exception.SystemException {
409 try {
410 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
411 "getSubscribedCategoriesCount",
412 _getSubscribedCategoriesCountParameterTypes10);
413
414 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
415 userId);
416
417 Object returnObj = null;
418
419 try {
420 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
421 }
422 catch (Exception e) {
423 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
424 throw (com.liferay.portal.kernel.exception.SystemException)e;
425 }
426
427 throw new com.liferay.portal.kernel.exception.SystemException(e);
428 }
429
430 return ((Integer)returnObj).intValue();
431 }
432 catch (com.liferay.portal.kernel.exception.SystemException se) {
433 _log.error(se, se);
434
435 throw se;
436 }
437 }
438
439 public static void subscribeCategory(HttpPrincipal httpPrincipal,
440 long groupId, long categoryId)
441 throws com.liferay.portal.kernel.exception.PortalException,
442 com.liferay.portal.kernel.exception.SystemException {
443 try {
444 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
445 "subscribeCategory", _subscribeCategoryParameterTypes11);
446
447 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
448 categoryId);
449
450 try {
451 TunnelUtil.invoke(httpPrincipal, methodHandler);
452 }
453 catch (Exception e) {
454 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
455 throw (com.liferay.portal.kernel.exception.PortalException)e;
456 }
457
458 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
459 throw (com.liferay.portal.kernel.exception.SystemException)e;
460 }
461
462 throw new com.liferay.portal.kernel.exception.SystemException(e);
463 }
464 }
465 catch (com.liferay.portal.kernel.exception.SystemException se) {
466 _log.error(se, se);
467
468 throw se;
469 }
470 }
471
472 public static void unsubscribeCategory(HttpPrincipal httpPrincipal,
473 long groupId, long categoryId)
474 throws com.liferay.portal.kernel.exception.PortalException,
475 com.liferay.portal.kernel.exception.SystemException {
476 try {
477 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
478 "unsubscribeCategory", _unsubscribeCategoryParameterTypes12);
479
480 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
481 categoryId);
482
483 try {
484 TunnelUtil.invoke(httpPrincipal, methodHandler);
485 }
486 catch (Exception e) {
487 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
488 throw (com.liferay.portal.kernel.exception.PortalException)e;
489 }
490
491 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
492 throw (com.liferay.portal.kernel.exception.SystemException)e;
493 }
494
495 throw new com.liferay.portal.kernel.exception.SystemException(e);
496 }
497 }
498 catch (com.liferay.portal.kernel.exception.SystemException se) {
499 _log.error(se, se);
500
501 throw se;
502 }
503 }
504
505 public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
506 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
507 java.lang.String name, java.lang.String description,
508 java.lang.String emailAddress, java.lang.String inProtocol,
509 java.lang.String inServerName, int inServerPort, boolean inUseSSL,
510 java.lang.String inUserName, java.lang.String inPassword,
511 int inReadInterval, java.lang.String outEmailAddress,
512 boolean outCustom, java.lang.String outServerName, int outServerPort,
513 boolean outUseSSL, java.lang.String outUserName,
514 java.lang.String outPassword, boolean mailingListActive,
515 boolean mergeWithParentCategory,
516 com.liferay.portal.service.ServiceContext serviceContext)
517 throws com.liferay.portal.kernel.exception.PortalException,
518 com.liferay.portal.kernel.exception.SystemException {
519 try {
520 MethodKey methodKey = new MethodKey(MBCategoryServiceUtil.class.getName(),
521 "updateCategory", _updateCategoryParameterTypes13);
522
523 MethodHandler methodHandler = new MethodHandler(methodKey,
524 categoryId, parentCategoryId, name, description,
525 emailAddress, inProtocol, inServerName, inServerPort,
526 inUseSSL, inUserName, inPassword, inReadInterval,
527 outEmailAddress, outCustom, outServerName, outServerPort,
528 outUseSSL, outUserName, outPassword, mailingListActive,
529 mergeWithParentCategory, serviceContext);
530
531 Object returnObj = null;
532
533 try {
534 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
535 }
536 catch (Exception e) {
537 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
538 throw (com.liferay.portal.kernel.exception.PortalException)e;
539 }
540
541 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
542 throw (com.liferay.portal.kernel.exception.SystemException)e;
543 }
544
545 throw new com.liferay.portal.kernel.exception.SystemException(e);
546 }
547
548 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
549 }
550 catch (com.liferay.portal.kernel.exception.SystemException se) {
551 _log.error(se, se);
552
553 throw se;
554 }
555 }
556
557 private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceHttp.class);
558 private static final Class<?>[] _addCategoryParameterTypes0 = new Class[] {
559 long.class, java.lang.String.class, java.lang.String.class,
560 java.lang.String.class, java.lang.String.class,
561 java.lang.String.class, int.class, boolean.class,
562 java.lang.String.class, java.lang.String.class, int.class,
563 java.lang.String.class, boolean.class, java.lang.String.class,
564 int.class, boolean.class, java.lang.String.class,
565 java.lang.String.class, boolean.class,
566 com.liferay.portal.service.ServiceContext.class
567 };
568 private static final Class<?>[] _deleteCategoryParameterTypes1 = new Class[] {
569 long.class, long.class
570 };
571 private static final Class<?>[] _getCategoriesParameterTypes2 = new Class[] {
572 long.class, long.class, int.class, int.class
573 };
574 private static final Class<?>[] _getCategoriesParameterTypes3 = new Class[] {
575 long.class, long[].class, int.class, int.class
576 };
577 private static final Class<?>[] _getCategoriesCountParameterTypes4 = new Class[] {
578 long.class, long.class
579 };
580 private static final Class<?>[] _getCategoriesCountParameterTypes5 = new Class[] {
581 long.class, long[].class
582 };
583 private static final Class<?>[] _getCategoryParameterTypes6 = new Class[] {
584 long.class
585 };
586 private static final Class<?>[] _getCategoryIdsParameterTypes7 = new Class[] {
587 long.class, long.class
588 };
589 private static final Class<?>[] _getSubcategoryIdsParameterTypes8 = new Class[] {
590 java.util.List.class, long.class, long.class
591 };
592 private static final Class<?>[] _getSubscribedCategoriesParameterTypes9 = new Class[] {
593 long.class, long.class, int.class, int.class
594 };
595 private static final Class<?>[] _getSubscribedCategoriesCountParameterTypes10 =
596 new Class[] { long.class, long.class };
597 private static final Class<?>[] _subscribeCategoryParameterTypes11 = new Class[] {
598 long.class, long.class
599 };
600 private static final Class<?>[] _unsubscribeCategoryParameterTypes12 = new Class[] {
601 long.class, long.class
602 };
603 private static final Class<?>[] _updateCategoryParameterTypes13 = new Class[] {
604 long.class, long.class, java.lang.String.class,
605 java.lang.String.class, java.lang.String.class,
606 java.lang.String.class, java.lang.String.class, int.class,
607 boolean.class, java.lang.String.class, java.lang.String.class,
608 int.class, java.lang.String.class, boolean.class,
609 java.lang.String.class, int.class, boolean.class,
610 java.lang.String.class, java.lang.String.class, boolean.class,
611 boolean.class, com.liferay.portal.service.ServiceContext.class
612 };
613 }