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