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