1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 groupId, 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          com.liferay.portal.service.ServiceContext serviceContext)
79          throws com.liferay.portal.kernel.exception.PortalException,
80              com.liferay.portal.kernel.exception.SystemException {
81          try {
82              Object paramObj0 = new LongWrapper(groupId);
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 = serviceContext;
169 
170             if (serviceContext == null) {
171                 paramObj17 = new NullWrapper(
172                         "com.liferay.portal.service.ServiceContext");
173             }
174 
175             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
176                     "addFeed",
177                     new Object[] {
178                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
179                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
180                         paramObj10, paramObj11, paramObj12, paramObj13,
181                         paramObj14, paramObj15, paramObj16, paramObj17
182                     });
183 
184             Object returnObj = null;
185 
186             try {
187                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
188             }
189             catch (Exception e) {
190                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
191                     throw (com.liferay.portal.kernel.exception.PortalException)e;
192                 }
193 
194                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
195                     throw (com.liferay.portal.kernel.exception.SystemException)e;
196                 }
197 
198                 throw new com.liferay.portal.kernel.exception.SystemException(e);
199             }
200 
201             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
202         }
203         catch (com.liferay.portal.kernel.exception.SystemException se) {
204             _log.error(se, se);
205 
206             throw se;
207         }
208     }
209 
210     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
211         long feedId)
212         throws com.liferay.portal.kernel.exception.PortalException,
213             com.liferay.portal.kernel.exception.SystemException {
214         try {
215             Object paramObj0 = new LongWrapper(groupId);
216 
217             Object paramObj1 = new LongWrapper(feedId);
218 
219             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
220                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
221 
222             try {
223                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
224             }
225             catch (Exception e) {
226                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                     throw (com.liferay.portal.kernel.exception.PortalException)e;
228                 }
229 
230                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                     throw (com.liferay.portal.kernel.exception.SystemException)e;
232                 }
233 
234                 throw new com.liferay.portal.kernel.exception.SystemException(e);
235             }
236         }
237         catch (com.liferay.portal.kernel.exception.SystemException se) {
238             _log.error(se, se);
239 
240             throw se;
241         }
242     }
243 
244     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
245         java.lang.String feedId)
246         throws com.liferay.portal.kernel.exception.PortalException,
247             com.liferay.portal.kernel.exception.SystemException {
248         try {
249             Object paramObj0 = new LongWrapper(groupId);
250 
251             Object paramObj1 = feedId;
252 
253             if (feedId == null) {
254                 paramObj1 = new NullWrapper("java.lang.String");
255             }
256 
257             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
258                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
259 
260             try {
261                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
262             }
263             catch (Exception e) {
264                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
265                     throw (com.liferay.portal.kernel.exception.PortalException)e;
266                 }
267 
268                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
269                     throw (com.liferay.portal.kernel.exception.SystemException)e;
270                 }
271 
272                 throw new com.liferay.portal.kernel.exception.SystemException(e);
273             }
274         }
275         catch (com.liferay.portal.kernel.exception.SystemException se) {
276             _log.error(se, se);
277 
278             throw se;
279         }
280     }
281 
282     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
283         HttpPrincipal httpPrincipal, long groupId, long feedId)
284         throws com.liferay.portal.kernel.exception.PortalException,
285             com.liferay.portal.kernel.exception.SystemException {
286         try {
287             Object paramObj0 = new LongWrapper(groupId);
288 
289             Object paramObj1 = new LongWrapper(feedId);
290 
291             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
292                     "getFeed", new Object[] { paramObj0, paramObj1 });
293 
294             Object returnObj = null;
295 
296             try {
297                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
298             }
299             catch (Exception e) {
300                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
301                     throw (com.liferay.portal.kernel.exception.PortalException)e;
302                 }
303 
304                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
305                     throw (com.liferay.portal.kernel.exception.SystemException)e;
306                 }
307 
308                 throw new com.liferay.portal.kernel.exception.SystemException(e);
309             }
310 
311             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
312         }
313         catch (com.liferay.portal.kernel.exception.SystemException se) {
314             _log.error(se, se);
315 
316             throw se;
317         }
318     }
319 
320     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
321         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
322         throws com.liferay.portal.kernel.exception.PortalException,
323             com.liferay.portal.kernel.exception.SystemException {
324         try {
325             Object paramObj0 = new LongWrapper(groupId);
326 
327             Object paramObj1 = feedId;
328 
329             if (feedId == null) {
330                 paramObj1 = new NullWrapper("java.lang.String");
331             }
332 
333             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
334                     "getFeed", new Object[] { paramObj0, paramObj1 });
335 
336             Object returnObj = null;
337 
338             try {
339                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
340             }
341             catch (Exception e) {
342                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
343                     throw (com.liferay.portal.kernel.exception.PortalException)e;
344                 }
345 
346                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
347                     throw (com.liferay.portal.kernel.exception.SystemException)e;
348                 }
349 
350                 throw new com.liferay.portal.kernel.exception.SystemException(e);
351             }
352 
353             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
354         }
355         catch (com.liferay.portal.kernel.exception.SystemException se) {
356             _log.error(se, se);
357 
358             throw se;
359         }
360     }
361 
362     public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
363         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
364         java.lang.String name, java.lang.String description,
365         java.lang.String type, java.lang.String structureId,
366         java.lang.String templateId, java.lang.String rendererTemplateId,
367         int delta, java.lang.String orderByCol, java.lang.String orderByType,
368         java.lang.String targetLayoutFriendlyUrl,
369         java.lang.String targetPortletId, java.lang.String contentField,
370         java.lang.String feedType, double feedVersion,
371         com.liferay.portal.service.ServiceContext serviceContext)
372         throws com.liferay.portal.kernel.exception.PortalException,
373             com.liferay.portal.kernel.exception.SystemException {
374         try {
375             Object paramObj0 = new LongWrapper(groupId);
376 
377             Object paramObj1 = feedId;
378 
379             if (feedId == null) {
380                 paramObj1 = new NullWrapper("java.lang.String");
381             }
382 
383             Object paramObj2 = name;
384 
385             if (name == null) {
386                 paramObj2 = new NullWrapper("java.lang.String");
387             }
388 
389             Object paramObj3 = description;
390 
391             if (description == null) {
392                 paramObj3 = new NullWrapper("java.lang.String");
393             }
394 
395             Object paramObj4 = type;
396 
397             if (type == null) {
398                 paramObj4 = new NullWrapper("java.lang.String");
399             }
400 
401             Object paramObj5 = structureId;
402 
403             if (structureId == null) {
404                 paramObj5 = new NullWrapper("java.lang.String");
405             }
406 
407             Object paramObj6 = templateId;
408 
409             if (templateId == null) {
410                 paramObj6 = new NullWrapper("java.lang.String");
411             }
412 
413             Object paramObj7 = rendererTemplateId;
414 
415             if (rendererTemplateId == null) {
416                 paramObj7 = new NullWrapper("java.lang.String");
417             }
418 
419             Object paramObj8 = new IntegerWrapper(delta);
420 
421             Object paramObj9 = orderByCol;
422 
423             if (orderByCol == null) {
424                 paramObj9 = new NullWrapper("java.lang.String");
425             }
426 
427             Object paramObj10 = orderByType;
428 
429             if (orderByType == null) {
430                 paramObj10 = new NullWrapper("java.lang.String");
431             }
432 
433             Object paramObj11 = targetLayoutFriendlyUrl;
434 
435             if (targetLayoutFriendlyUrl == null) {
436                 paramObj11 = new NullWrapper("java.lang.String");
437             }
438 
439             Object paramObj12 = targetPortletId;
440 
441             if (targetPortletId == null) {
442                 paramObj12 = new NullWrapper("java.lang.String");
443             }
444 
445             Object paramObj13 = contentField;
446 
447             if (contentField == null) {
448                 paramObj13 = new NullWrapper("java.lang.String");
449             }
450 
451             Object paramObj14 = feedType;
452 
453             if (feedType == null) {
454                 paramObj14 = new NullWrapper("java.lang.String");
455             }
456 
457             Object paramObj15 = new DoubleWrapper(feedVersion);
458 
459             Object paramObj16 = serviceContext;
460 
461             if (serviceContext == null) {
462                 paramObj16 = new NullWrapper(
463                         "com.liferay.portal.service.ServiceContext");
464             }
465 
466             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
467                     "updateFeed",
468                     new Object[] {
469                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
470                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
471                         paramObj10, paramObj11, paramObj12, paramObj13,
472                         paramObj14, paramObj15, paramObj16
473                     });
474 
475             Object returnObj = null;
476 
477             try {
478                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
479             }
480             catch (Exception e) {
481                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
482                     throw (com.liferay.portal.kernel.exception.PortalException)e;
483                 }
484 
485                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
486                     throw (com.liferay.portal.kernel.exception.SystemException)e;
487                 }
488 
489                 throw new com.liferay.portal.kernel.exception.SystemException(e);
490             }
491 
492             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
493         }
494         catch (com.liferay.portal.kernel.exception.SystemException se) {
495             _log.error(se, se);
496 
497             throw se;
498         }
499     }
500 
501     private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
502 }