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.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
35
36
73 public class MBCategoryServiceHttp {
74 public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
75 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
76 java.lang.String name, java.lang.String description,
77 boolean addCommunityPermissions, boolean addGuestPermissions)
78 throws com.liferay.portal.SystemException,
79 com.liferay.portal.PortalException {
80 try {
81 Object paramObj0 = new LongWrapper(plid);
82 Object paramObj1 = new LongWrapper(parentCategoryId);
83 Object paramObj2 = name;
84
85 if (name == null) {
86 paramObj2 = new NullWrapper("java.lang.String");
87 }
88
89 Object paramObj3 = description;
90
91 if (description == null) {
92 paramObj3 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj4 = new BooleanWrapper(addCommunityPermissions);
96 Object paramObj5 = new BooleanWrapper(addGuestPermissions);
97 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
98 "addCategory",
99 new Object[] {
100 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
101 paramObj5
102 });
103 Object returnObj = null;
104
105 try {
106 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.SystemException) {
110 throw (com.liferay.portal.SystemException)e;
111 }
112
113 if (e instanceof com.liferay.portal.PortalException) {
114 throw (com.liferay.portal.PortalException)e;
115 }
116
117 throw new com.liferay.portal.SystemException(e);
118 }
119
120 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
121 }
122 catch (com.liferay.portal.SystemException se) {
123 _log.error(se, se);
124 throw se;
125 }
126 }
127
128 public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
129 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
130 java.lang.String name, java.lang.String description,
131 java.lang.String[] communityPermissions,
132 java.lang.String[] guestPermissions)
133 throws com.liferay.portal.SystemException,
134 com.liferay.portal.PortalException {
135 try {
136 Object paramObj0 = new LongWrapper(plid);
137 Object paramObj1 = new LongWrapper(parentCategoryId);
138 Object paramObj2 = name;
139
140 if (name == null) {
141 paramObj2 = new NullWrapper("java.lang.String");
142 }
143
144 Object paramObj3 = description;
145
146 if (description == null) {
147 paramObj3 = new NullWrapper("java.lang.String");
148 }
149
150 Object paramObj4 = communityPermissions;
151
152 if (communityPermissions == null) {
153 paramObj4 = new NullWrapper("[Ljava.lang.String;");
154 }
155
156 Object paramObj5 = guestPermissions;
157
158 if (guestPermissions == null) {
159 paramObj5 = new NullWrapper("[Ljava.lang.String;");
160 }
161
162 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
163 "addCategory",
164 new Object[] {
165 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
166 paramObj5
167 });
168 Object returnObj = null;
169
170 try {
171 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
172 }
173 catch (Exception e) {
174 if (e instanceof com.liferay.portal.SystemException) {
175 throw (com.liferay.portal.SystemException)e;
176 }
177
178 if (e instanceof com.liferay.portal.PortalException) {
179 throw (com.liferay.portal.PortalException)e;
180 }
181
182 throw new com.liferay.portal.SystemException(e);
183 }
184
185 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
186 }
187 catch (com.liferay.portal.SystemException se) {
188 _log.error(se, se);
189 throw se;
190 }
191 }
192
193 public static void deleteCategory(HttpPrincipal httpPrincipal,
194 long categoryId)
195 throws com.liferay.portal.SystemException,
196 com.liferay.portal.PortalException {
197 try {
198 Object paramObj0 = new LongWrapper(categoryId);
199 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
200 "deleteCategory", new Object[] { paramObj0 });
201
202 try {
203 TunnelUtil.invoke(httpPrincipal, methodWrapper);
204 }
205 catch (Exception e) {
206 if (e instanceof com.liferay.portal.SystemException) {
207 throw (com.liferay.portal.SystemException)e;
208 }
209
210 if (e instanceof com.liferay.portal.PortalException) {
211 throw (com.liferay.portal.PortalException)e;
212 }
213
214 throw new com.liferay.portal.SystemException(e);
215 }
216 }
217 catch (com.liferay.portal.SystemException se) {
218 _log.error(se, se);
219 throw se;
220 }
221 }
222
223 public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
224 HttpPrincipal httpPrincipal, long categoryId)
225 throws com.liferay.portal.SystemException,
226 com.liferay.portal.PortalException {
227 try {
228 Object paramObj0 = new LongWrapper(categoryId);
229 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
230 "getCategory", new Object[] { paramObj0 });
231 Object returnObj = null;
232
233 try {
234 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
235 }
236 catch (Exception e) {
237 if (e instanceof com.liferay.portal.SystemException) {
238 throw (com.liferay.portal.SystemException)e;
239 }
240
241 if (e instanceof com.liferay.portal.PortalException) {
242 throw (com.liferay.portal.PortalException)e;
243 }
244
245 throw new com.liferay.portal.SystemException(e);
246 }
247
248 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
249 }
250 catch (com.liferay.portal.SystemException se) {
251 _log.error(se, se);
252 throw se;
253 }
254 }
255
256 public static void subscribeCategory(HttpPrincipal httpPrincipal,
257 long categoryId)
258 throws com.liferay.portal.SystemException,
259 com.liferay.portal.PortalException {
260 try {
261 Object paramObj0 = new LongWrapper(categoryId);
262 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
263 "subscribeCategory", new Object[] { paramObj0 });
264
265 try {
266 TunnelUtil.invoke(httpPrincipal, methodWrapper);
267 }
268 catch (Exception e) {
269 if (e instanceof com.liferay.portal.SystemException) {
270 throw (com.liferay.portal.SystemException)e;
271 }
272
273 if (e instanceof com.liferay.portal.PortalException) {
274 throw (com.liferay.portal.PortalException)e;
275 }
276
277 throw new com.liferay.portal.SystemException(e);
278 }
279 }
280 catch (com.liferay.portal.SystemException se) {
281 _log.error(se, se);
282 throw se;
283 }
284 }
285
286 public static void unsubscribeCategory(HttpPrincipal httpPrincipal,
287 long categoryId)
288 throws com.liferay.portal.SystemException,
289 com.liferay.portal.PortalException {
290 try {
291 Object paramObj0 = new LongWrapper(categoryId);
292 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
293 "unsubscribeCategory", new Object[] { paramObj0 });
294
295 try {
296 TunnelUtil.invoke(httpPrincipal, methodWrapper);
297 }
298 catch (Exception e) {
299 if (e instanceof com.liferay.portal.SystemException) {
300 throw (com.liferay.portal.SystemException)e;
301 }
302
303 if (e instanceof com.liferay.portal.PortalException) {
304 throw (com.liferay.portal.PortalException)e;
305 }
306
307 throw new com.liferay.portal.SystemException(e);
308 }
309 }
310 catch (com.liferay.portal.SystemException se) {
311 _log.error(se, se);
312 throw se;
313 }
314 }
315
316 public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
317 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
318 java.lang.String name, java.lang.String description,
319 boolean mergeWithParentCategory)
320 throws com.liferay.portal.SystemException,
321 com.liferay.portal.PortalException {
322 try {
323 Object paramObj0 = new LongWrapper(categoryId);
324 Object paramObj1 = new LongWrapper(parentCategoryId);
325 Object paramObj2 = name;
326
327 if (name == null) {
328 paramObj2 = new NullWrapper("java.lang.String");
329 }
330
331 Object paramObj3 = description;
332
333 if (description == null) {
334 paramObj3 = new NullWrapper("java.lang.String");
335 }
336
337 Object paramObj4 = new BooleanWrapper(mergeWithParentCategory);
338 MethodWrapper methodWrapper = new MethodWrapper(MBCategoryServiceUtil.class.getName(),
339 "updateCategory",
340 new Object[] {
341 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
342 });
343 Object returnObj = null;
344
345 try {
346 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
347 }
348 catch (Exception e) {
349 if (e instanceof com.liferay.portal.SystemException) {
350 throw (com.liferay.portal.SystemException)e;
351 }
352
353 if (e instanceof com.liferay.portal.PortalException) {
354 throw (com.liferay.portal.PortalException)e;
355 }
356
357 throw new com.liferay.portal.SystemException(e);
358 }
359
360 return (com.liferay.portlet.messageboards.model.MBCategory)returnObj;
361 }
362 catch (com.liferay.portal.SystemException se) {
363 _log.error(se, se);
364 throw se;
365 }
366 }
367
368 private static Log _log = LogFactoryUtil.getLog(MBCategoryServiceHttp.class);
369 }