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