001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.BooleanWrapper;
020    import com.liferay.portal.kernel.util.DoubleWrapper;
021    import com.liferay.portal.kernel.util.IntegerWrapper;
022    import com.liferay.portal.kernel.util.LongWrapper;
023    import com.liferay.portal.kernel.util.MethodWrapper;
024    import com.liferay.portal.kernel.util.NullWrapper;
025    import com.liferay.portal.security.auth.HttpPrincipal;
026    import com.liferay.portal.service.http.TunnelUtil;
027    
028    import com.liferay.portlet.journal.service.JournalFeedServiceUtil;
029    
030    /**
031     * <p>
032     * This class provides a HTTP utility for the
033     * {@link com.liferay.portlet.journal.service.JournalFeedServiceUtil} service utility. The
034     * static methods of this class calls the same methods of the service utility.
035     * However, the signatures are different because it requires an additional
036     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
037     * </p>
038     *
039     * <p>
040     * The benefits of using the HTTP utility is that it is fast and allows for
041     * tunneling without the cost of serializing to text. The drawback is that it
042     * only works with Java.
043     * </p>
044     *
045     * <p>
046     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
047     * configure security.
048     * </p>
049     *
050     * <p>
051     * The HTTP utility is only generated for remote services.
052     * </p>
053     *
054     * @author    Brian Wing Shun Chan
055     * @see       JournalFeedServiceSoap
056     * @see       com.liferay.portal.security.auth.HttpPrincipal
057     * @see       com.liferay.portlet.journal.service.JournalFeedServiceUtil
058     * @generated
059     */
060    public class JournalFeedServiceHttp {
061            public static com.liferay.portlet.journal.model.JournalFeed addFeed(
062                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
063                    boolean autoFeedId, java.lang.String name,
064                    java.lang.String description, java.lang.String type,
065                    java.lang.String structureId, java.lang.String templateId,
066                    java.lang.String rendererTemplateId, int delta,
067                    java.lang.String orderByCol, java.lang.String orderByType,
068                    java.lang.String targetLayoutFriendlyUrl,
069                    java.lang.String targetPortletId, java.lang.String contentField,
070                    java.lang.String feedType, double feedVersion,
071                    com.liferay.portal.service.ServiceContext serviceContext)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    try {
075                            Object paramObj0 = new LongWrapper(groupId);
076    
077                            Object paramObj1 = feedId;
078    
079                            if (feedId == null) {
080                                    paramObj1 = new NullWrapper("java.lang.String");
081                            }
082    
083                            Object paramObj2 = new BooleanWrapper(autoFeedId);
084    
085                            Object paramObj3 = name;
086    
087                            if (name == null) {
088                                    paramObj3 = new NullWrapper("java.lang.String");
089                            }
090    
091                            Object paramObj4 = description;
092    
093                            if (description == null) {
094                                    paramObj4 = new NullWrapper("java.lang.String");
095                            }
096    
097                            Object paramObj5 = type;
098    
099                            if (type == null) {
100                                    paramObj5 = new NullWrapper("java.lang.String");
101                            }
102    
103                            Object paramObj6 = structureId;
104    
105                            if (structureId == null) {
106                                    paramObj6 = new NullWrapper("java.lang.String");
107                            }
108    
109                            Object paramObj7 = templateId;
110    
111                            if (templateId == null) {
112                                    paramObj7 = new NullWrapper("java.lang.String");
113                            }
114    
115                            Object paramObj8 = rendererTemplateId;
116    
117                            if (rendererTemplateId == null) {
118                                    paramObj8 = new NullWrapper("java.lang.String");
119                            }
120    
121                            Object paramObj9 = new IntegerWrapper(delta);
122    
123                            Object paramObj10 = orderByCol;
124    
125                            if (orderByCol == null) {
126                                    paramObj10 = new NullWrapper("java.lang.String");
127                            }
128    
129                            Object paramObj11 = orderByType;
130    
131                            if (orderByType == null) {
132                                    paramObj11 = new NullWrapper("java.lang.String");
133                            }
134    
135                            Object paramObj12 = targetLayoutFriendlyUrl;
136    
137                            if (targetLayoutFriendlyUrl == null) {
138                                    paramObj12 = new NullWrapper("java.lang.String");
139                            }
140    
141                            Object paramObj13 = targetPortletId;
142    
143                            if (targetPortletId == null) {
144                                    paramObj13 = new NullWrapper("java.lang.String");
145                            }
146    
147                            Object paramObj14 = contentField;
148    
149                            if (contentField == null) {
150                                    paramObj14 = new NullWrapper("java.lang.String");
151                            }
152    
153                            Object paramObj15 = feedType;
154    
155                            if (feedType == null) {
156                                    paramObj15 = new NullWrapper("java.lang.String");
157                            }
158    
159                            Object paramObj16 = new DoubleWrapper(feedVersion);
160    
161                            Object paramObj17 = serviceContext;
162    
163                            if (serviceContext == null) {
164                                    paramObj17 = new NullWrapper(
165                                                    "com.liferay.portal.service.ServiceContext");
166                            }
167    
168                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
169                                            "addFeed",
170                                            new Object[] {
171                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
172                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
173                                                    paramObj10, paramObj11, paramObj12, paramObj13,
174                                                    paramObj14, paramObj15, paramObj16, paramObj17
175                                            });
176    
177                            Object returnObj = null;
178    
179                            try {
180                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
181                            }
182                            catch (Exception e) {
183                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
184                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
185                                    }
186    
187                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
188                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
189                                    }
190    
191                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
192                            }
193    
194                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
195                    }
196                    catch (com.liferay.portal.kernel.exception.SystemException se) {
197                            _log.error(se, se);
198    
199                            throw se;
200                    }
201            }
202    
203            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
204                    long feedId)
205                    throws com.liferay.portal.kernel.exception.PortalException,
206                            com.liferay.portal.kernel.exception.SystemException {
207                    try {
208                            Object paramObj0 = new LongWrapper(groupId);
209    
210                            Object paramObj1 = new LongWrapper(feedId);
211    
212                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
213                                            "deleteFeed", new Object[] { paramObj0, paramObj1 });
214    
215                            try {
216                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
217                            }
218                            catch (Exception e) {
219                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
220                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
221                                    }
222    
223                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
224                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
225                                    }
226    
227                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
228                            }
229                    }
230                    catch (com.liferay.portal.kernel.exception.SystemException se) {
231                            _log.error(se, se);
232    
233                            throw se;
234                    }
235            }
236    
237            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
238                    java.lang.String feedId)
239                    throws com.liferay.portal.kernel.exception.PortalException,
240                            com.liferay.portal.kernel.exception.SystemException {
241                    try {
242                            Object paramObj0 = new LongWrapper(groupId);
243    
244                            Object paramObj1 = feedId;
245    
246                            if (feedId == null) {
247                                    paramObj1 = new NullWrapper("java.lang.String");
248                            }
249    
250                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
251                                            "deleteFeed", new Object[] { paramObj0, paramObj1 });
252    
253                            try {
254                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
255                            }
256                            catch (Exception e) {
257                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
258                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
259                                    }
260    
261                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
262                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
263                                    }
264    
265                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
266                            }
267                    }
268                    catch (com.liferay.portal.kernel.exception.SystemException se) {
269                            _log.error(se, se);
270    
271                            throw se;
272                    }
273            }
274    
275            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
276                    HttpPrincipal httpPrincipal, long groupId, long feedId)
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException {
279                    try {
280                            Object paramObj0 = new LongWrapper(groupId);
281    
282                            Object paramObj1 = new LongWrapper(feedId);
283    
284                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
285                                            "getFeed", new Object[] { paramObj0, paramObj1 });
286    
287                            Object returnObj = null;
288    
289                            try {
290                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
291                            }
292                            catch (Exception e) {
293                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
294                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
295                                    }
296    
297                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
298                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
299                                    }
300    
301                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
302                            }
303    
304                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
305                    }
306                    catch (com.liferay.portal.kernel.exception.SystemException se) {
307                            _log.error(se, se);
308    
309                            throw se;
310                    }
311            }
312    
313            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
314                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    try {
318                            Object paramObj0 = new LongWrapper(groupId);
319    
320                            Object paramObj1 = feedId;
321    
322                            if (feedId == null) {
323                                    paramObj1 = new NullWrapper("java.lang.String");
324                            }
325    
326                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
327                                            "getFeed", new Object[] { paramObj0, paramObj1 });
328    
329                            Object returnObj = null;
330    
331                            try {
332                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
333                            }
334                            catch (Exception e) {
335                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
336                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
337                                    }
338    
339                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
340                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
341                                    }
342    
343                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
344                            }
345    
346                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
347                    }
348                    catch (com.liferay.portal.kernel.exception.SystemException se) {
349                            _log.error(se, se);
350    
351                            throw se;
352                    }
353            }
354    
355            public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
356                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
357                    java.lang.String name, java.lang.String description,
358                    java.lang.String type, java.lang.String structureId,
359                    java.lang.String templateId, java.lang.String rendererTemplateId,
360                    int delta, java.lang.String orderByCol, java.lang.String orderByType,
361                    java.lang.String targetLayoutFriendlyUrl,
362                    java.lang.String targetPortletId, java.lang.String contentField,
363                    java.lang.String feedType, double feedVersion,
364                    com.liferay.portal.service.ServiceContext serviceContext)
365                    throws com.liferay.portal.kernel.exception.PortalException,
366                            com.liferay.portal.kernel.exception.SystemException {
367                    try {
368                            Object paramObj0 = new LongWrapper(groupId);
369    
370                            Object paramObj1 = feedId;
371    
372                            if (feedId == null) {
373                                    paramObj1 = new NullWrapper("java.lang.String");
374                            }
375    
376                            Object paramObj2 = name;
377    
378                            if (name == null) {
379                                    paramObj2 = new NullWrapper("java.lang.String");
380                            }
381    
382                            Object paramObj3 = description;
383    
384                            if (description == null) {
385                                    paramObj3 = new NullWrapper("java.lang.String");
386                            }
387    
388                            Object paramObj4 = type;
389    
390                            if (type == null) {
391                                    paramObj4 = new NullWrapper("java.lang.String");
392                            }
393    
394                            Object paramObj5 = structureId;
395    
396                            if (structureId == null) {
397                                    paramObj5 = new NullWrapper("java.lang.String");
398                            }
399    
400                            Object paramObj6 = templateId;
401    
402                            if (templateId == null) {
403                                    paramObj6 = new NullWrapper("java.lang.String");
404                            }
405    
406                            Object paramObj7 = rendererTemplateId;
407    
408                            if (rendererTemplateId == null) {
409                                    paramObj7 = new NullWrapper("java.lang.String");
410                            }
411    
412                            Object paramObj8 = new IntegerWrapper(delta);
413    
414                            Object paramObj9 = orderByCol;
415    
416                            if (orderByCol == null) {
417                                    paramObj9 = new NullWrapper("java.lang.String");
418                            }
419    
420                            Object paramObj10 = orderByType;
421    
422                            if (orderByType == null) {
423                                    paramObj10 = new NullWrapper("java.lang.String");
424                            }
425    
426                            Object paramObj11 = targetLayoutFriendlyUrl;
427    
428                            if (targetLayoutFriendlyUrl == null) {
429                                    paramObj11 = new NullWrapper("java.lang.String");
430                            }
431    
432                            Object paramObj12 = targetPortletId;
433    
434                            if (targetPortletId == null) {
435                                    paramObj12 = new NullWrapper("java.lang.String");
436                            }
437    
438                            Object paramObj13 = contentField;
439    
440                            if (contentField == null) {
441                                    paramObj13 = new NullWrapper("java.lang.String");
442                            }
443    
444                            Object paramObj14 = feedType;
445    
446                            if (feedType == null) {
447                                    paramObj14 = new NullWrapper("java.lang.String");
448                            }
449    
450                            Object paramObj15 = new DoubleWrapper(feedVersion);
451    
452                            Object paramObj16 = serviceContext;
453    
454                            if (serviceContext == null) {
455                                    paramObj16 = new NullWrapper(
456                                                    "com.liferay.portal.service.ServiceContext");
457                            }
458    
459                            MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
460                                            "updateFeed",
461                                            new Object[] {
462                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
463                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
464                                                    paramObj10, paramObj11, paramObj12, paramObj13,
465                                                    paramObj14, paramObj15, paramObj16
466                                            });
467    
468                            Object returnObj = null;
469    
470                            try {
471                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
472                            }
473                            catch (Exception e) {
474                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
475                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
476                                    }
477    
478                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
479                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
480                                    }
481    
482                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
483                            }
484    
485                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
486                    }
487                    catch (com.liferay.portal.kernel.exception.SystemException se) {
488                            _log.error(se, se);
489    
490                            throw se;
491                    }
492            }
493    
494            private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
495    }