1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portlet.journal.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.BooleanWrapper;
20  import com.liferay.portal.kernel.util.DoubleWrapper;
21  import com.liferay.portal.kernel.util.IntegerWrapper;
22  import com.liferay.portal.kernel.util.LongWrapper;
23  import com.liferay.portal.kernel.util.MethodWrapper;
24  import com.liferay.portal.kernel.util.NullWrapper;
25  import com.liferay.portal.security.auth.HttpPrincipal;
26  import com.liferay.portal.service.http.TunnelUtil;
27  
28  import com.liferay.portlet.journal.service.JournalFeedServiceUtil;
29  
30  /**
31   * <a href="JournalFeedServiceHttp.java.html"><b><i>View Source</i></b></a>
32   *
33   * <p>
34   * ServiceBuilder generated this class. Modifications in this class will be
35   * overwritten the next time is generated.
36   * </p>
37   *
38   * <p>
39   * This class provides a HTTP utility for the
40   * {@link com.liferay.portlet.journal.service.JournalFeedServiceUtil} service utility. The
41   * static methods of this class calls the same methods of the service utility.
42   * However, the signatures are different because it requires an additional
43   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
44   * </p>
45   *
46   * <p>
47   * The benefits of using the HTTP utility is that it is fast and allows for
48   * tunneling without the cost of serializing to text. The drawback is that it
49   * only works with Java.
50   * </p>
51   *
52   * <p>
53   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
54   * configure security.
55   * </p>
56   *
57   * <p>
58   * The HTTP utility is only generated for remote services.
59   * </p>
60   *
61   * @author    Brian Wing Shun Chan
62   * @see       JournalFeedServiceSoap
63   * @see       com.liferay.portal.security.auth.HttpPrincipal
64   * @see       com.liferay.portlet.journal.service.JournalFeedServiceUtil
65   * @generated
66   */
67  public class JournalFeedServiceHttp {
68      public static com.liferay.portlet.journal.model.JournalFeed addFeed(
69          HttpPrincipal httpPrincipal, long plid, java.lang.String feedId,
70          boolean autoFeedId, java.lang.String name,
71          java.lang.String description, java.lang.String type,
72          java.lang.String structureId, java.lang.String templateId,
73          java.lang.String rendererTemplateId, int delta,
74          java.lang.String orderByCol, java.lang.String orderByType,
75          java.lang.String targetLayoutFriendlyUrl,
76          java.lang.String targetPortletId, java.lang.String contentField,
77          java.lang.String feedType, double feedVersion,
78          boolean addCommunityPermissions, boolean addGuestPermissions)
79          throws com.liferay.portal.PortalException,
80              com.liferay.portal.SystemException {
81          try {
82              Object paramObj0 = new LongWrapper(plid);
83  
84              Object paramObj1 = feedId;
85  
86              if (feedId == null) {
87                  paramObj1 = new NullWrapper("java.lang.String");
88              }
89  
90              Object paramObj2 = new BooleanWrapper(autoFeedId);
91  
92              Object paramObj3 = name;
93  
94              if (name == null) {
95                  paramObj3 = new NullWrapper("java.lang.String");
96              }
97  
98              Object paramObj4 = description;
99  
100             if (description == null) {
101                 paramObj4 = new NullWrapper("java.lang.String");
102             }
103 
104             Object paramObj5 = type;
105 
106             if (type == null) {
107                 paramObj5 = new NullWrapper("java.lang.String");
108             }
109 
110             Object paramObj6 = structureId;
111 
112             if (structureId == null) {
113                 paramObj6 = new NullWrapper("java.lang.String");
114             }
115 
116             Object paramObj7 = templateId;
117 
118             if (templateId == null) {
119                 paramObj7 = new NullWrapper("java.lang.String");
120             }
121 
122             Object paramObj8 = rendererTemplateId;
123 
124             if (rendererTemplateId == null) {
125                 paramObj8 = new NullWrapper("java.lang.String");
126             }
127 
128             Object paramObj9 = new IntegerWrapper(delta);
129 
130             Object paramObj10 = orderByCol;
131 
132             if (orderByCol == null) {
133                 paramObj10 = new NullWrapper("java.lang.String");
134             }
135 
136             Object paramObj11 = orderByType;
137 
138             if (orderByType == null) {
139                 paramObj11 = new NullWrapper("java.lang.String");
140             }
141 
142             Object paramObj12 = targetLayoutFriendlyUrl;
143 
144             if (targetLayoutFriendlyUrl == null) {
145                 paramObj12 = new NullWrapper("java.lang.String");
146             }
147 
148             Object paramObj13 = targetPortletId;
149 
150             if (targetPortletId == null) {
151                 paramObj13 = new NullWrapper("java.lang.String");
152             }
153 
154             Object paramObj14 = contentField;
155 
156             if (contentField == null) {
157                 paramObj14 = new NullWrapper("java.lang.String");
158             }
159 
160             Object paramObj15 = feedType;
161 
162             if (feedType == null) {
163                 paramObj15 = new NullWrapper("java.lang.String");
164             }
165 
166             Object paramObj16 = new DoubleWrapper(feedVersion);
167 
168             Object paramObj17 = new BooleanWrapper(addCommunityPermissions);
169 
170             Object paramObj18 = new BooleanWrapper(addGuestPermissions);
171 
172             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
173                     "addFeed",
174                     new Object[] {
175                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
176                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
177                         paramObj10, paramObj11, paramObj12, paramObj13,
178                         paramObj14, paramObj15, paramObj16, paramObj17,
179                         paramObj18
180                     });
181 
182             Object returnObj = null;
183 
184             try {
185                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
186             }
187             catch (Exception e) {
188                 if (e instanceof com.liferay.portal.PortalException) {
189                     throw (com.liferay.portal.PortalException)e;
190                 }
191 
192                 if (e instanceof com.liferay.portal.SystemException) {
193                     throw (com.liferay.portal.SystemException)e;
194                 }
195 
196                 throw new com.liferay.portal.SystemException(e);
197             }
198 
199             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
200         }
201         catch (com.liferay.portal.SystemException se) {
202             _log.error(se, se);
203 
204             throw se;
205         }
206     }
207 
208     public static com.liferay.portlet.journal.model.JournalFeed addFeed(
209         HttpPrincipal httpPrincipal, long plid, java.lang.String feedId,
210         boolean autoFeedId, java.lang.String name,
211         java.lang.String description, java.lang.String type,
212         java.lang.String structureId, java.lang.String templateId,
213         java.lang.String rendererTemplateId, int delta,
214         java.lang.String orderByCol, java.lang.String orderByType,
215         java.lang.String targetLayoutFriendlyUrl,
216         java.lang.String targetPortletId, java.lang.String contentField,
217         java.lang.String feedType, double feedVersion,
218         java.lang.String[] communityPermissions,
219         java.lang.String[] guestPermissions)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException {
222         try {
223             Object paramObj0 = new LongWrapper(plid);
224 
225             Object paramObj1 = feedId;
226 
227             if (feedId == null) {
228                 paramObj1 = new NullWrapper("java.lang.String");
229             }
230 
231             Object paramObj2 = new BooleanWrapper(autoFeedId);
232 
233             Object paramObj3 = name;
234 
235             if (name == null) {
236                 paramObj3 = new NullWrapper("java.lang.String");
237             }
238 
239             Object paramObj4 = description;
240 
241             if (description == null) {
242                 paramObj4 = new NullWrapper("java.lang.String");
243             }
244 
245             Object paramObj5 = type;
246 
247             if (type == null) {
248                 paramObj5 = new NullWrapper("java.lang.String");
249             }
250 
251             Object paramObj6 = structureId;
252 
253             if (structureId == null) {
254                 paramObj6 = new NullWrapper("java.lang.String");
255             }
256 
257             Object paramObj7 = templateId;
258 
259             if (templateId == null) {
260                 paramObj7 = new NullWrapper("java.lang.String");
261             }
262 
263             Object paramObj8 = rendererTemplateId;
264 
265             if (rendererTemplateId == null) {
266                 paramObj8 = new NullWrapper("java.lang.String");
267             }
268 
269             Object paramObj9 = new IntegerWrapper(delta);
270 
271             Object paramObj10 = orderByCol;
272 
273             if (orderByCol == null) {
274                 paramObj10 = new NullWrapper("java.lang.String");
275             }
276 
277             Object paramObj11 = orderByType;
278 
279             if (orderByType == null) {
280                 paramObj11 = new NullWrapper("java.lang.String");
281             }
282 
283             Object paramObj12 = targetLayoutFriendlyUrl;
284 
285             if (targetLayoutFriendlyUrl == null) {
286                 paramObj12 = new NullWrapper("java.lang.String");
287             }
288 
289             Object paramObj13 = targetPortletId;
290 
291             if (targetPortletId == null) {
292                 paramObj13 = new NullWrapper("java.lang.String");
293             }
294 
295             Object paramObj14 = contentField;
296 
297             if (contentField == null) {
298                 paramObj14 = new NullWrapper("java.lang.String");
299             }
300 
301             Object paramObj15 = feedType;
302 
303             if (feedType == null) {
304                 paramObj15 = new NullWrapper("java.lang.String");
305             }
306 
307             Object paramObj16 = new DoubleWrapper(feedVersion);
308 
309             Object paramObj17 = communityPermissions;
310 
311             if (communityPermissions == null) {
312                 paramObj17 = new NullWrapper("[Ljava.lang.String;");
313             }
314 
315             Object paramObj18 = guestPermissions;
316 
317             if (guestPermissions == null) {
318                 paramObj18 = new NullWrapper("[Ljava.lang.String;");
319             }
320 
321             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
322                     "addFeed",
323                     new Object[] {
324                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
325                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
326                         paramObj10, paramObj11, paramObj12, paramObj13,
327                         paramObj14, paramObj15, paramObj16, paramObj17,
328                         paramObj18
329                     });
330 
331             Object returnObj = null;
332 
333             try {
334                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
335             }
336             catch (Exception e) {
337                 if (e instanceof com.liferay.portal.PortalException) {
338                     throw (com.liferay.portal.PortalException)e;
339                 }
340 
341                 if (e instanceof com.liferay.portal.SystemException) {
342                     throw (com.liferay.portal.SystemException)e;
343                 }
344 
345                 throw new com.liferay.portal.SystemException(e);
346             }
347 
348             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
349         }
350         catch (com.liferay.portal.SystemException se) {
351             _log.error(se, se);
352 
353             throw se;
354         }
355     }
356 
357     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
358         long feedId)
359         throws com.liferay.portal.PortalException,
360             com.liferay.portal.SystemException {
361         try {
362             Object paramObj0 = new LongWrapper(groupId);
363 
364             Object paramObj1 = new LongWrapper(feedId);
365 
366             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
367                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
368 
369             try {
370                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
371             }
372             catch (Exception e) {
373                 if (e instanceof com.liferay.portal.PortalException) {
374                     throw (com.liferay.portal.PortalException)e;
375                 }
376 
377                 if (e instanceof com.liferay.portal.SystemException) {
378                     throw (com.liferay.portal.SystemException)e;
379                 }
380 
381                 throw new com.liferay.portal.SystemException(e);
382             }
383         }
384         catch (com.liferay.portal.SystemException se) {
385             _log.error(se, se);
386 
387             throw se;
388         }
389     }
390 
391     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
392         java.lang.String feedId)
393         throws com.liferay.portal.PortalException,
394             com.liferay.portal.SystemException {
395         try {
396             Object paramObj0 = new LongWrapper(groupId);
397 
398             Object paramObj1 = feedId;
399 
400             if (feedId == null) {
401                 paramObj1 = new NullWrapper("java.lang.String");
402             }
403 
404             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
405                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
406 
407             try {
408                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
409             }
410             catch (Exception e) {
411                 if (e instanceof com.liferay.portal.PortalException) {
412                     throw (com.liferay.portal.PortalException)e;
413                 }
414 
415                 if (e instanceof com.liferay.portal.SystemException) {
416                     throw (com.liferay.portal.SystemException)e;
417                 }
418 
419                 throw new com.liferay.portal.SystemException(e);
420             }
421         }
422         catch (com.liferay.portal.SystemException se) {
423             _log.error(se, se);
424 
425             throw se;
426         }
427     }
428 
429     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
430         HttpPrincipal httpPrincipal, long groupId, long feedId)
431         throws com.liferay.portal.PortalException,
432             com.liferay.portal.SystemException {
433         try {
434             Object paramObj0 = new LongWrapper(groupId);
435 
436             Object paramObj1 = new LongWrapper(feedId);
437 
438             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
439                     "getFeed", new Object[] { paramObj0, paramObj1 });
440 
441             Object returnObj = null;
442 
443             try {
444                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
445             }
446             catch (Exception e) {
447                 if (e instanceof com.liferay.portal.PortalException) {
448                     throw (com.liferay.portal.PortalException)e;
449                 }
450 
451                 if (e instanceof com.liferay.portal.SystemException) {
452                     throw (com.liferay.portal.SystemException)e;
453                 }
454 
455                 throw new com.liferay.portal.SystemException(e);
456             }
457 
458             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
459         }
460         catch (com.liferay.portal.SystemException se) {
461             _log.error(se, se);
462 
463             throw se;
464         }
465     }
466 
467     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
468         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
469         throws com.liferay.portal.PortalException,
470             com.liferay.portal.SystemException {
471         try {
472             Object paramObj0 = new LongWrapper(groupId);
473 
474             Object paramObj1 = feedId;
475 
476             if (feedId == null) {
477                 paramObj1 = new NullWrapper("java.lang.String");
478             }
479 
480             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
481                     "getFeed", new Object[] { paramObj0, paramObj1 });
482 
483             Object returnObj = null;
484 
485             try {
486                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
487             }
488             catch (Exception e) {
489                 if (e instanceof com.liferay.portal.PortalException) {
490                     throw (com.liferay.portal.PortalException)e;
491                 }
492 
493                 if (e instanceof com.liferay.portal.SystemException) {
494                     throw (com.liferay.portal.SystemException)e;
495                 }
496 
497                 throw new com.liferay.portal.SystemException(e);
498             }
499 
500             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
501         }
502         catch (com.liferay.portal.SystemException se) {
503             _log.error(se, se);
504 
505             throw se;
506         }
507     }
508 
509     public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
510         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
511         java.lang.String name, java.lang.String description,
512         java.lang.String type, java.lang.String structureId,
513         java.lang.String templateId, java.lang.String rendererTemplateId,
514         int delta, java.lang.String orderByCol, java.lang.String orderByType,
515         java.lang.String targetLayoutFriendlyUrl,
516         java.lang.String targetPortletId, java.lang.String contentField,
517         java.lang.String feedType, double feedVersion)
518         throws com.liferay.portal.PortalException,
519             com.liferay.portal.SystemException {
520         try {
521             Object paramObj0 = new LongWrapper(groupId);
522 
523             Object paramObj1 = feedId;
524 
525             if (feedId == null) {
526                 paramObj1 = new NullWrapper("java.lang.String");
527             }
528 
529             Object paramObj2 = name;
530 
531             if (name == null) {
532                 paramObj2 = new NullWrapper("java.lang.String");
533             }
534 
535             Object paramObj3 = description;
536 
537             if (description == null) {
538                 paramObj3 = new NullWrapper("java.lang.String");
539             }
540 
541             Object paramObj4 = type;
542 
543             if (type == null) {
544                 paramObj4 = new NullWrapper("java.lang.String");
545             }
546 
547             Object paramObj5 = structureId;
548 
549             if (structureId == null) {
550                 paramObj5 = new NullWrapper("java.lang.String");
551             }
552 
553             Object paramObj6 = templateId;
554 
555             if (templateId == null) {
556                 paramObj6 = new NullWrapper("java.lang.String");
557             }
558 
559             Object paramObj7 = rendererTemplateId;
560 
561             if (rendererTemplateId == null) {
562                 paramObj7 = new NullWrapper("java.lang.String");
563             }
564 
565             Object paramObj8 = new IntegerWrapper(delta);
566 
567             Object paramObj9 = orderByCol;
568 
569             if (orderByCol == null) {
570                 paramObj9 = new NullWrapper("java.lang.String");
571             }
572 
573             Object paramObj10 = orderByType;
574 
575             if (orderByType == null) {
576                 paramObj10 = new NullWrapper("java.lang.String");
577             }
578 
579             Object paramObj11 = targetLayoutFriendlyUrl;
580 
581             if (targetLayoutFriendlyUrl == null) {
582                 paramObj11 = new NullWrapper("java.lang.String");
583             }
584 
585             Object paramObj12 = targetPortletId;
586 
587             if (targetPortletId == null) {
588                 paramObj12 = new NullWrapper("java.lang.String");
589             }
590 
591             Object paramObj13 = contentField;
592 
593             if (contentField == null) {
594                 paramObj13 = new NullWrapper("java.lang.String");
595             }
596 
597             Object paramObj14 = feedType;
598 
599             if (feedType == null) {
600                 paramObj14 = new NullWrapper("java.lang.String");
601             }
602 
603             Object paramObj15 = new DoubleWrapper(feedVersion);
604 
605             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
606                     "updateFeed",
607                     new Object[] {
608                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
609                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
610                         paramObj10, paramObj11, paramObj12, paramObj13,
611                         paramObj14, paramObj15
612                     });
613 
614             Object returnObj = null;
615 
616             try {
617                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
618             }
619             catch (Exception e) {
620                 if (e instanceof com.liferay.portal.PortalException) {
621                     throw (com.liferay.portal.PortalException)e;
622                 }
623 
624                 if (e instanceof com.liferay.portal.SystemException) {
625                     throw (com.liferay.portal.SystemException)e;
626                 }
627 
628                 throw new com.liferay.portal.SystemException(e);
629             }
630 
631             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
632         }
633         catch (com.liferay.portal.SystemException se) {
634             _log.error(se, se);
635 
636             throw se;
637         }
638     }
639 
640     private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
641 }