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