1
22
23 package com.liferay.portlet.messageboards.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.http.TunnelUtil;
34
35 import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
36
37
76 public class MBCategoryServiceHttp {
77 public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
78 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
79 java.lang.String name, java.lang.String description,
80 boolean addCommunityPermissions, boolean addGuestPermissions)
81 throws com.liferay.portal.PortalException,
82 com.liferay.portal.SystemException {
83 try {
84 Object paramObj0 = new LongWrapper(plid);
85
86 Object paramObj1 = new LongWrapper(parentCategoryId);
87
88 Object paramObj2 = name;
89
90 if (name == null) {
91 paramObj2 = new NullWrapper("java.lang.String");
92 }
93
94 Object paramObj3 = description;
95
96 if (description == null) {
97 paramObj3 = new NullWrapper("java.lang.String");
98 }
99
100 Object paramObj4 = new BooleanWrapper(addCommunityPermissions);
101
102 Object paramObj5 = new BooleanWrapper(addGuestPermissions);
103
104 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
105 "addCategory",
106 new Object[] {
107 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
108 paramObj5
109 });
110
111 Object returnObj = null;
112
113 try {
114 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
115 }
116 catch (Exception e) {
117 if (e instanceof com.liferay.portal.PortalException) {
118 throw (com.liferay.portal.PortalException)e;
119 }
120
121 if (e instanceof com.liferay.portal.SystemException) {
122 throw (com.liferay.portal.SystemException)e;
123 }
124
125 throw new com.liferay.portal.SystemException(e);
126 }
127
128 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
129 }
130 catch (com.liferay.portal.SystemException se) {
131 _log.error(se, se);
132
133 throw se;
134 }
135 }
136
137 public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
138 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
139 java.lang.String name, java.lang.String description,
140 java.lang.String[] communityPermissions,
141 java.lang.String[] guestPermissions)
142 throws com.liferay.portal.PortalException,
143 com.liferay.portal.SystemException {
144 try {
145 Object paramObj0 = new LongWrapper(plid);
146
147 Object paramObj1 = new LongWrapper(parentCategoryId);
148
149 Object paramObj2 = name;
150
151 if (name == null) {
152 paramObj2 = new NullWrapper("java.lang.String");
153 }
154
155 Object paramObj3 = description;
156
157 if (description == null) {
158 paramObj3 = new NullWrapper("java.lang.String");
159 }
160
161 Object paramObj4 = communityPermissions;
162
163 if (communityPermissions == null) {
164 paramObj4 = new NullWrapper("[Ljava.lang.String;");
165 }
166
167 Object paramObj5 = guestPermissions;
168
169 if (guestPermissions == null) {
170 paramObj5 = new NullWrapper("[Ljava.lang.String;");
171 }
172
173 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
174 "addCategory",
175 new Object[] {
176 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
177 paramObj5
178 });
179
180 Object returnObj = null;
181
182 try {
183 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
184 }
185 catch (Exception e) {
186 if (e instanceof com.liferay.portal.PortalException) {
187 throw (com.liferay.portal.PortalException)e;
188 }
189
190 if (e instanceof com.liferay.portal.SystemException) {
191 throw (com.liferay.portal.SystemException)e;
192 }
193
194 throw new com.liferay.portal.SystemException(e);
195 }
196
197 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
198 }
199 catch (com.liferay.portal.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 public static void deleteCategory(HttpPrincipal httpPrincipal,
207 long categoryId)
208 throws com.liferay.portal.PortalException,
209 com.liferay.portal.SystemException {
210 try {
211 Object paramObj0 = new LongWrapper(categoryId);
212
213 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
214 "deleteCategory", new Object[] { paramObj0 });
215
216 try {
217 TunnelUtil.invoke(httpPrincipal, methodWrapper);
218 }
219 catch (Exception e) {
220 if (e instanceof com.liferay.portal.PortalException) {
221 throw (com.liferay.portal.PortalException)e;
222 }
223
224 if (e instanceof com.liferay.portal.SystemException) {
225 throw (com.liferay.portal.SystemException)e;
226 }
227
228 throw new com.liferay.portal.SystemException(e);
229 }
230 }
231 catch (com.liferay.portal.SystemException se) {
232 _log.error(se, se);
233
234 throw se;
235 }
236 }
237
238 public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
239 HttpPrincipal httpPrincipal, long categoryId)
240 throws com.liferay.portal.PortalException,
241 com.liferay.portal.SystemException {
242 try {
243 Object paramObj0 = new LongWrapper(categoryId);
244
245 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
246 "getCategory", new Object[] { paramObj0 });
247
248 Object returnObj = null;
249
250 try {
251 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
252 }
253 catch (Exception e) {
254 if (e instanceof com.liferay.portal.PortalException) {
255 throw (com.liferay.portal.PortalException)e;
256 }
257
258 if (e instanceof com.liferay.portal.SystemException) {
259 throw (com.liferay.portal.SystemException)e;
260 }
261
262 throw new com.liferay.portal.SystemException(e);
263 }
264
265 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
266 }
267 catch (com.liferay.portal.SystemException se) {
268 _log.error(se, se);
269
270 throw se;
271 }
272 }
273
274 public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
275 HttpPrincipal httpPrincipal, long groupId, long parentCategoryId,
276 int start, int end)
277 throws com.liferay.portal.PortalException,
278 com.liferay.portal.SystemException {
279 try {
280 Object paramObj0 = new LongWrapper(groupId);
281
282 Object paramObj1 = new LongWrapper(parentCategoryId);
283
284 Object paramObj2 = new IntegerWrapper(start);
285
286 Object paramObj3 = new IntegerWrapper(end);
287
288 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
289 "getCategories",
290 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
291
292 Object returnObj = null;
293
294 try {
295 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
296 }
297 catch (Exception e) {
298 if (e instanceof com.liferay.portal.PortalException) {
299 throw (com.liferay.portal.PortalException)e;
300 }
301
302 if (e instanceof com.liferay.portal.SystemException) {
303 throw (com.liferay.portal.SystemException)e;
304 }
305
306 throw new com.liferay.portal.SystemException(e);
307 }
308
309 return (java.util.List<com.liferay.portlet.messageboards.model.MBCategory>)returnObj;
310 }
311 catch (com.liferay.portal.SystemException se) {
312 _log.error(se, se);
313
314 throw se;
315 }
316 }
317
318 public static int getCategoriesCount(HttpPrincipal httpPrincipal,
319 long groupId, long parentCategoryId)
320 throws com.liferay.portal.SystemException {
321 try {
322 Object paramObj0 = new LongWrapper(groupId);
323
324 Object paramObj1 = new LongWrapper(parentCategoryId);
325
326 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
327 "getCategoriesCount", new Object[] { paramObj0, paramObj1 });
328
329 Object returnObj = null;
330
331 try {
332 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
333 }
334 catch (Exception e) {
335 if (e instanceof com.liferay.portal.SystemException) {
336 throw (com.liferay.portal.SystemException)e;
337 }
338
339 throw new com.liferay.portal.SystemException(e);
340 }
341
342 return ((Integer)returnObj).intValue();
343 }
344 catch (com.liferay.portal.SystemException se) {
345 _log.error(se, se);
346
347 throw se;
348 }
349 }
350
351 public static void subscribeCategory(HttpPrincipal httpPrincipal,
352 long categoryId)
353 throws com.liferay.portal.PortalException,
354 com.liferay.portal.SystemException {
355 try {
356 Object paramObj0 = new LongWrapper(categoryId);
357
358 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
359 "subscribeCategory", new Object[] { paramObj0 });
360
361 try {
362 TunnelUtil.invoke(httpPrincipal, methodWrapper);
363 }
364 catch (Exception e) {
365 if (e instanceof com.liferay.portal.PortalException) {
366 throw (com.liferay.portal.PortalException)e;
367 }
368
369 if (e instanceof com.liferay.portal.SystemException) {
370 throw (com.liferay.portal.SystemException)e;
371 }
372
373 throw new com.liferay.portal.SystemException(e);
374 }
375 }
376 catch (com.liferay.portal.SystemException se) {
377 _log.error(se, se);
378
379 throw se;
380 }
381 }
382
383 public static void unsubscribeCategory(HttpPrincipal httpPrincipal,
384 long categoryId)
385 throws com.liferay.portal.PortalException,
386 com.liferay.portal.SystemException {
387 try {
388 Object paramObj0 = new LongWrapper(categoryId);
389
390 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
391 "unsubscribeCategory", new Object[] { paramObj0 });
392
393 try {
394 TunnelUtil.invoke(httpPrincipal, methodWrapper);
395 }
396 catch (Exception e) {
397 if (e instanceof com.liferay.portal.PortalException) {
398 throw (com.liferay.portal.PortalException)e;
399 }
400
401 if (e instanceof com.liferay.portal.SystemException) {
402 throw (com.liferay.portal.SystemException)e;
403 }
404
405 throw new com.liferay.portal.SystemException(e);
406 }
407 }
408 catch (com.liferay.portal.SystemException se) {
409 _log.error(se, se);
410
411 throw se;
412 }
413 }
414
415 public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
416 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
417 java.lang.String name, java.lang.String description,
418 boolean mergeWithParentCategory)
419 throws com.liferay.portal.PortalException,
420 com.liferay.portal.SystemException {
421 try {
422 Object paramObj0 = new LongWrapper(categoryId);
423
424 Object paramObj1 = new LongWrapper(parentCategoryId);
425
426 Object paramObj2 = name;
427
428 if (name == null) {
429 paramObj2 = new NullWrapper("java.lang.String");
430 }
431
432 Object paramObj3 = description;
433
434 if (description == null) {
435 paramObj3 = new NullWrapper("java.lang.String");
436 }
437
438 Object paramObj4 = new BooleanWrapper(mergeWithParentCategory);
439
440 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
441 "updateCategory",
442 new Object[] {
443 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
444 });
445
446 Object returnObj = null;
447
448 try {
449 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
450 }
451 catch (Exception e) {
452 if (e instanceof com.liferay.portal.PortalException) {
453 throw (com.liferay.portal.PortalException)e;
454 }
455
456 if (e instanceof com.liferay.portal.SystemException) {
457 throw (com.liferay.portal.SystemException)e;
458 }
459
460 throw new com.liferay.portal.SystemException(e);
461 }
462
463 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
464 }
465 catch (com.liferay.portal.SystemException se) {
466 _log.error(se, se);
467
468 throw se;
469 }
470 }
471
472 private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceHttp.class);
473 }