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.DoubleWrapper;
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.wiki.service.WikiPageServiceUtil;
36
37
76 public class WikiPageServiceHttp {
77 public static com.liferay.portlet.wiki.model.WikiPage addPage(
78 HttpPrincipal httpPrincipal, long nodeId, java.lang.String title,
79 javax.portlet.PortletPreferences prefs,
80 com.liferay.portal.theme.ThemeDisplay themeDisplay)
81 throws com.liferay.portal.SystemException,
82 com.liferay.portal.PortalException {
83 try {
84 Object paramObj0 = new LongWrapper(nodeId);
85
86 Object paramObj1 = title;
87
88 if (title == null) {
89 paramObj1 = new NullWrapper("java.lang.String");
90 }
91
92 Object paramObj2 = prefs;
93
94 if (prefs == null) {
95 paramObj2 = new NullWrapper("javax.portlet.PortletPreferences");
96 }
97
98 Object paramObj3 = themeDisplay;
99
100 if (themeDisplay == null) {
101 paramObj3 = new NullWrapper(
102 "com.liferay.portal.theme.ThemeDisplay");
103 }
104
105 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
106 "addPage",
107 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
108
109 Object returnObj = null;
110
111 try {
112 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
113 }
114 catch (Exception e) {
115 if (e instanceof com.liferay.portal.SystemException) {
116 throw (com.liferay.portal.SystemException)e;
117 }
118
119 if (e instanceof com.liferay.portal.PortalException) {
120 throw (com.liferay.portal.PortalException)e;
121 }
122
123 throw new com.liferay.portal.SystemException(e);
124 }
125
126 return (com.liferay.portlet.wiki.model.WikiPage)returnObj;
127 }
128 catch (com.liferay.portal.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 public static void addPageAttachments(HttpPrincipal httpPrincipal,
136 long nodeId, java.lang.String title,
137 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files)
138 throws com.liferay.portal.SystemException,
139 com.liferay.portal.PortalException {
140 try {
141 Object paramObj0 = new LongWrapper(nodeId);
142
143 Object paramObj1 = title;
144
145 if (title == null) {
146 paramObj1 = new NullWrapper("java.lang.String");
147 }
148
149 Object paramObj2 = files;
150
151 if (files == null) {
152 paramObj2 = new NullWrapper("java.util.List");
153 }
154
155 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
156 "addPageAttachments",
157 new Object[] { paramObj0, paramObj1, paramObj2 });
158
159 try {
160 TunnelUtil.invoke(httpPrincipal, methodWrapper);
161 }
162 catch (Exception e) {
163 if (e instanceof com.liferay.portal.SystemException) {
164 throw (com.liferay.portal.SystemException)e;
165 }
166
167 if (e instanceof com.liferay.portal.PortalException) {
168 throw (com.liferay.portal.PortalException)e;
169 }
170
171 throw new com.liferay.portal.SystemException(e);
172 }
173 }
174 catch (com.liferay.portal.SystemException se) {
175 _log.error(se, se);
176
177 throw se;
178 }
179 }
180
181 public static void deletePage(HttpPrincipal httpPrincipal, long nodeId,
182 java.lang.String title)
183 throws com.liferay.portal.SystemException,
184 com.liferay.portal.PortalException {
185 try {
186 Object paramObj0 = new LongWrapper(nodeId);
187
188 Object paramObj1 = title;
189
190 if (title == null) {
191 paramObj1 = new NullWrapper("java.lang.String");
192 }
193
194 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
195 "deletePage", new Object[] { paramObj0, paramObj1 });
196
197 try {
198 TunnelUtil.invoke(httpPrincipal, methodWrapper);
199 }
200 catch (Exception e) {
201 if (e instanceof com.liferay.portal.SystemException) {
202 throw (com.liferay.portal.SystemException)e;
203 }
204
205 if (e instanceof com.liferay.portal.PortalException) {
206 throw (com.liferay.portal.PortalException)e;
207 }
208
209 throw new com.liferay.portal.SystemException(e);
210 }
211 }
212 catch (com.liferay.portal.SystemException se) {
213 _log.error(se, se);
214
215 throw se;
216 }
217 }
218
219 public static void deletePageAttachment(HttpPrincipal httpPrincipal,
220 long nodeId, java.lang.String title, java.lang.String fileName)
221 throws com.liferay.portal.SystemException,
222 com.liferay.portal.PortalException {
223 try {
224 Object paramObj0 = new LongWrapper(nodeId);
225
226 Object paramObj1 = title;
227
228 if (title == null) {
229 paramObj1 = new NullWrapper("java.lang.String");
230 }
231
232 Object paramObj2 = fileName;
233
234 if (fileName == null) {
235 paramObj2 = new NullWrapper("java.lang.String");
236 }
237
238 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
239 "deletePageAttachment",
240 new Object[] { paramObj0, paramObj1, paramObj2 });
241
242 try {
243 TunnelUtil.invoke(httpPrincipal, methodWrapper);
244 }
245 catch (Exception e) {
246 if (e instanceof com.liferay.portal.SystemException) {
247 throw (com.liferay.portal.SystemException)e;
248 }
249
250 if (e instanceof com.liferay.portal.PortalException) {
251 throw (com.liferay.portal.PortalException)e;
252 }
253
254 throw new com.liferay.portal.SystemException(e);
255 }
256 }
257 catch (com.liferay.portal.SystemException se) {
258 _log.error(se, se);
259
260 throw se;
261 }
262 }
263
264 public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getNodePages(
265 HttpPrincipal httpPrincipal, long nodeId, int max)
266 throws com.liferay.portal.SystemException,
267 com.liferay.portal.PortalException {
268 try {
269 Object paramObj0 = new LongWrapper(nodeId);
270
271 Object paramObj1 = new IntegerWrapper(max);
272
273 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
274 "getNodePages", new Object[] { paramObj0, paramObj1 });
275
276 Object returnObj = null;
277
278 try {
279 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
280 }
281 catch (Exception e) {
282 if (e instanceof com.liferay.portal.SystemException) {
283 throw (com.liferay.portal.SystemException)e;
284 }
285
286 if (e instanceof com.liferay.portal.PortalException) {
287 throw (com.liferay.portal.PortalException)e;
288 }
289
290 throw new com.liferay.portal.SystemException(e);
291 }
292
293 return (java.util.List<com.liferay.portlet.wiki.model.WikiPage>)returnObj;
294 }
295 catch (com.liferay.portal.SystemException se) {
296 _log.error(se, se);
297
298 throw se;
299 }
300 }
301
302 public static java.lang.String getNodePagesRSS(
303 HttpPrincipal httpPrincipal, long nodeId, int max,
304 java.lang.String type, double version, java.lang.String displayStyle,
305 java.lang.String feedURL, java.lang.String entryURL)
306 throws com.liferay.portal.SystemException,
307 com.liferay.portal.PortalException {
308 try {
309 Object paramObj0 = new LongWrapper(nodeId);
310
311 Object paramObj1 = new IntegerWrapper(max);
312
313 Object paramObj2 = type;
314
315 if (type == null) {
316 paramObj2 = new NullWrapper("java.lang.String");
317 }
318
319 Object paramObj3 = new DoubleWrapper(version);
320
321 Object paramObj4 = displayStyle;
322
323 if (displayStyle == null) {
324 paramObj4 = new NullWrapper("java.lang.String");
325 }
326
327 Object paramObj5 = feedURL;
328
329 if (feedURL == null) {
330 paramObj5 = new NullWrapper("java.lang.String");
331 }
332
333 Object paramObj6 = entryURL;
334
335 if (entryURL == null) {
336 paramObj6 = new NullWrapper("java.lang.String");
337 }
338
339 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
340 "getNodePagesRSS",
341 new Object[] {
342 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
343 paramObj5, paramObj6
344 });
345
346 Object returnObj = null;
347
348 try {
349 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
350 }
351 catch (Exception e) {
352 if (e instanceof com.liferay.portal.SystemException) {
353 throw (com.liferay.portal.SystemException)e;
354 }
355
356 if (e instanceof com.liferay.portal.PortalException) {
357 throw (com.liferay.portal.PortalException)e;
358 }
359
360 throw new com.liferay.portal.SystemException(e);
361 }
362
363 return (java.lang.String)returnObj;
364 }
365 catch (com.liferay.portal.SystemException se) {
366 _log.error(se, se);
367
368 throw se;
369 }
370 }
371
372 public static com.liferay.portlet.wiki.model.WikiPage getPage(
373 HttpPrincipal httpPrincipal, long nodeId, java.lang.String title)
374 throws com.liferay.portal.SystemException,
375 com.liferay.portal.PortalException {
376 try {
377 Object paramObj0 = new LongWrapper(nodeId);
378
379 Object paramObj1 = title;
380
381 if (title == null) {
382 paramObj1 = new NullWrapper("java.lang.String");
383 }
384
385 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
386 "getPage", new Object[] { paramObj0, paramObj1 });
387
388 Object returnObj = null;
389
390 try {
391 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
392 }
393 catch (Exception e) {
394 if (e instanceof com.liferay.portal.SystemException) {
395 throw (com.liferay.portal.SystemException)e;
396 }
397
398 if (e instanceof com.liferay.portal.PortalException) {
399 throw (com.liferay.portal.PortalException)e;
400 }
401
402 throw new com.liferay.portal.SystemException(e);
403 }
404
405 return (com.liferay.portlet.wiki.model.WikiPage)returnObj;
406 }
407 catch (com.liferay.portal.SystemException se) {
408 _log.error(se, se);
409
410 throw se;
411 }
412 }
413
414 public static com.liferay.portlet.wiki.model.WikiPage getPage(
415 HttpPrincipal httpPrincipal, long nodeId, java.lang.String title,
416 double version)
417 throws com.liferay.portal.SystemException,
418 com.liferay.portal.PortalException {
419 try {
420 Object paramObj0 = new LongWrapper(nodeId);
421
422 Object paramObj1 = title;
423
424 if (title == null) {
425 paramObj1 = new NullWrapper("java.lang.String");
426 }
427
428 Object paramObj2 = new DoubleWrapper(version);
429
430 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
431 "getPage", new Object[] { paramObj0, paramObj1, paramObj2 });
432
433 Object returnObj = null;
434
435 try {
436 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
437 }
438 catch (Exception e) {
439 if (e instanceof com.liferay.portal.SystemException) {
440 throw (com.liferay.portal.SystemException)e;
441 }
442
443 if (e instanceof com.liferay.portal.PortalException) {
444 throw (com.liferay.portal.PortalException)e;
445 }
446
447 throw new com.liferay.portal.SystemException(e);
448 }
449
450 return (com.liferay.portlet.wiki.model.WikiPage)returnObj;
451 }
452 catch (com.liferay.portal.SystemException se) {
453 _log.error(se, se);
454
455 throw se;
456 }
457 }
458
459 public static java.lang.String getPagesRSS(HttpPrincipal httpPrincipal,
460 long companyId, long nodeId, java.lang.String title, int max,
461 java.lang.String type, double version, java.lang.String displayStyle,
462 java.lang.String feedURL, java.lang.String entryURL,
463 java.util.Locale locale)
464 throws com.liferay.portal.SystemException,
465 com.liferay.portal.PortalException {
466 try {
467 Object paramObj0 = new LongWrapper(companyId);
468
469 Object paramObj1 = new LongWrapper(nodeId);
470
471 Object paramObj2 = title;
472
473 if (title == null) {
474 paramObj2 = new NullWrapper("java.lang.String");
475 }
476
477 Object paramObj3 = new IntegerWrapper(max);
478
479 Object paramObj4 = type;
480
481 if (type == null) {
482 paramObj4 = new NullWrapper("java.lang.String");
483 }
484
485 Object paramObj5 = new DoubleWrapper(version);
486
487 Object paramObj6 = displayStyle;
488
489 if (displayStyle == null) {
490 paramObj6 = new NullWrapper("java.lang.String");
491 }
492
493 Object paramObj7 = feedURL;
494
495 if (feedURL == null) {
496 paramObj7 = new NullWrapper("java.lang.String");
497 }
498
499 Object paramObj8 = entryURL;
500
501 if (entryURL == null) {
502 paramObj8 = new NullWrapper("java.lang.String");
503 }
504
505 Object paramObj9 = locale;
506
507 if (locale == null) {
508 paramObj9 = new NullWrapper("java.util.Locale");
509 }
510
511 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
512 "getPagesRSS",
513 new Object[] {
514 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
515 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
516 });
517
518 Object returnObj = null;
519
520 try {
521 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
522 }
523 catch (Exception e) {
524 if (e instanceof com.liferay.portal.SystemException) {
525 throw (com.liferay.portal.SystemException)e;
526 }
527
528 if (e instanceof com.liferay.portal.PortalException) {
529 throw (com.liferay.portal.PortalException)e;
530 }
531
532 throw new com.liferay.portal.SystemException(e);
533 }
534
535 return (java.lang.String)returnObj;
536 }
537 catch (com.liferay.portal.SystemException se) {
538 _log.error(se, se);
539
540 throw se;
541 }
542 }
543
544 public static void movePage(HttpPrincipal httpPrincipal, long nodeId,
545 java.lang.String title, java.lang.String newTitle,
546 javax.portlet.PortletPreferences prefs,
547 com.liferay.portal.theme.ThemeDisplay themeDisplay)
548 throws com.liferay.portal.SystemException,
549 com.liferay.portal.PortalException {
550 try {
551 Object paramObj0 = new LongWrapper(nodeId);
552
553 Object paramObj1 = title;
554
555 if (title == null) {
556 paramObj1 = new NullWrapper("java.lang.String");
557 }
558
559 Object paramObj2 = newTitle;
560
561 if (newTitle == null) {
562 paramObj2 = new NullWrapper("java.lang.String");
563 }
564
565 Object paramObj3 = prefs;
566
567 if (prefs == null) {
568 paramObj3 = new NullWrapper("javax.portlet.PortletPreferences");
569 }
570
571 Object paramObj4 = themeDisplay;
572
573 if (themeDisplay == null) {
574 paramObj4 = new NullWrapper(
575 "com.liferay.portal.theme.ThemeDisplay");
576 }
577
578 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
579 "movePage",
580 new Object[] {
581 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
582 });
583
584 try {
585 TunnelUtil.invoke(httpPrincipal, methodWrapper);
586 }
587 catch (Exception e) {
588 if (e instanceof com.liferay.portal.SystemException) {
589 throw (com.liferay.portal.SystemException)e;
590 }
591
592 if (e instanceof com.liferay.portal.PortalException) {
593 throw (com.liferay.portal.PortalException)e;
594 }
595
596 throw new com.liferay.portal.SystemException(e);
597 }
598 }
599 catch (com.liferay.portal.SystemException se) {
600 _log.error(se, se);
601
602 throw se;
603 }
604 }
605
606 public static com.liferay.portlet.wiki.model.WikiPage revertPage(
607 HttpPrincipal httpPrincipal, long nodeId, java.lang.String title,
608 double version, javax.portlet.PortletPreferences prefs,
609 com.liferay.portal.theme.ThemeDisplay themeDisplay)
610 throws com.liferay.portal.SystemException,
611 com.liferay.portal.PortalException {
612 try {
613 Object paramObj0 = new LongWrapper(nodeId);
614
615 Object paramObj1 = title;
616
617 if (title == null) {
618 paramObj1 = new NullWrapper("java.lang.String");
619 }
620
621 Object paramObj2 = new DoubleWrapper(version);
622
623 Object paramObj3 = prefs;
624
625 if (prefs == null) {
626 paramObj3 = new NullWrapper("javax.portlet.PortletPreferences");
627 }
628
629 Object paramObj4 = themeDisplay;
630
631 if (themeDisplay == null) {
632 paramObj4 = new NullWrapper(
633 "com.liferay.portal.theme.ThemeDisplay");
634 }
635
636 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
637 "revertPage",
638 new Object[] {
639 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
640 });
641
642 Object returnObj = null;
643
644 try {
645 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
646 }
647 catch (Exception e) {
648 if (e instanceof com.liferay.portal.SystemException) {
649 throw (com.liferay.portal.SystemException)e;
650 }
651
652 if (e instanceof com.liferay.portal.PortalException) {
653 throw (com.liferay.portal.PortalException)e;
654 }
655
656 throw new com.liferay.portal.SystemException(e);
657 }
658
659 return (com.liferay.portlet.wiki.model.WikiPage)returnObj;
660 }
661 catch (com.liferay.portal.SystemException se) {
662 _log.error(se, se);
663
664 throw se;
665 }
666 }
667
668 public static void subscribePage(HttpPrincipal httpPrincipal, long nodeId,
669 java.lang.String title)
670 throws com.liferay.portal.SystemException,
671 com.liferay.portal.PortalException {
672 try {
673 Object paramObj0 = new LongWrapper(nodeId);
674
675 Object paramObj1 = title;
676
677 if (title == null) {
678 paramObj1 = new NullWrapper("java.lang.String");
679 }
680
681 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
682 "subscribePage", new Object[] { paramObj0, paramObj1 });
683
684 try {
685 TunnelUtil.invoke(httpPrincipal, methodWrapper);
686 }
687 catch (Exception e) {
688 if (e instanceof com.liferay.portal.SystemException) {
689 throw (com.liferay.portal.SystemException)e;
690 }
691
692 if (e instanceof com.liferay.portal.PortalException) {
693 throw (com.liferay.portal.PortalException)e;
694 }
695
696 throw new com.liferay.portal.SystemException(e);
697 }
698 }
699 catch (com.liferay.portal.SystemException se) {
700 _log.error(se, se);
701
702 throw se;
703 }
704 }
705
706 public static void unsubscribePage(HttpPrincipal httpPrincipal,
707 long nodeId, java.lang.String title)
708 throws com.liferay.portal.SystemException,
709 com.liferay.portal.PortalException {
710 try {
711 Object paramObj0 = new LongWrapper(nodeId);
712
713 Object paramObj1 = title;
714
715 if (title == null) {
716 paramObj1 = new NullWrapper("java.lang.String");
717 }
718
719 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
720 "unsubscribePage", new Object[] { paramObj0, paramObj1 });
721
722 try {
723 TunnelUtil.invoke(httpPrincipal, methodWrapper);
724 }
725 catch (Exception e) {
726 if (e instanceof com.liferay.portal.SystemException) {
727 throw (com.liferay.portal.SystemException)e;
728 }
729
730 if (e instanceof com.liferay.portal.PortalException) {
731 throw (com.liferay.portal.PortalException)e;
732 }
733
734 throw new com.liferay.portal.SystemException(e);
735 }
736 }
737 catch (com.liferay.portal.SystemException se) {
738 _log.error(se, se);
739
740 throw se;
741 }
742 }
743
744 public static com.liferay.portlet.wiki.model.WikiPage updatePage(
745 HttpPrincipal httpPrincipal, long nodeId, java.lang.String title,
746 double version, java.lang.String content, java.lang.String format,
747 java.lang.String parentTitle, java.lang.String redirectTitle,
748 java.lang.String[] tagsEntries, javax.portlet.PortletPreferences prefs,
749 com.liferay.portal.theme.ThemeDisplay themeDisplay)
750 throws com.liferay.portal.SystemException,
751 com.liferay.portal.PortalException {
752 try {
753 Object paramObj0 = new LongWrapper(nodeId);
754
755 Object paramObj1 = title;
756
757 if (title == null) {
758 paramObj1 = new NullWrapper("java.lang.String");
759 }
760
761 Object paramObj2 = new DoubleWrapper(version);
762
763 Object paramObj3 = content;
764
765 if (content == null) {
766 paramObj3 = new NullWrapper("java.lang.String");
767 }
768
769 Object paramObj4 = format;
770
771 if (format == null) {
772 paramObj4 = new NullWrapper("java.lang.String");
773 }
774
775 Object paramObj5 = parentTitle;
776
777 if (parentTitle == null) {
778 paramObj5 = new NullWrapper("java.lang.String");
779 }
780
781 Object paramObj6 = redirectTitle;
782
783 if (redirectTitle == null) {
784 paramObj6 = new NullWrapper("java.lang.String");
785 }
786
787 Object paramObj7 = tagsEntries;
788
789 if (tagsEntries == null) {
790 paramObj7 = new NullWrapper("[Ljava.lang.String;");
791 }
792
793 Object paramObj8 = prefs;
794
795 if (prefs == null) {
796 paramObj8 = new NullWrapper("javax.portlet.PortletPreferences");
797 }
798
799 Object paramObj9 = themeDisplay;
800
801 if (themeDisplay == null) {
802 paramObj9 = new NullWrapper(
803 "com.liferay.portal.theme.ThemeDisplay");
804 }
805
806 MethodWrapper methodWrapper = new MethodWrapper(WikiPageServiceUtil.class.getName(),
807 "updatePage",
808 new Object[] {
809 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
810 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
811 });
812
813 Object returnObj = null;
814
815 try {
816 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
817 }
818 catch (Exception e) {
819 if (e instanceof com.liferay.portal.SystemException) {
820 throw (com.liferay.portal.SystemException)e;
821 }
822
823 if (e instanceof com.liferay.portal.PortalException) {
824 throw (com.liferay.portal.PortalException)e;
825 }
826
827 throw new com.liferay.portal.SystemException(e);
828 }
829
830 return (com.liferay.portlet.wiki.model.WikiPage)returnObj;
831 }
832 catch (com.liferay.portal.SystemException se) {
833 _log.error(se, se);
834
835 throw se;
836 }
837 }
838
839 private static Log _log = LogFactoryUtil.getLog(WikiPageServiceHttp.class);
840 }