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