001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.kernel.util.BooleanWrapper;
026: import com.liferay.portal.kernel.util.DoubleWrapper;
027: import com.liferay.portal.kernel.util.IntegerWrapper;
028: import com.liferay.portal.kernel.util.LongWrapper;
029: import com.liferay.portal.kernel.util.MethodWrapper;
030: import com.liferay.portal.kernel.util.NullWrapper;
031: import com.liferay.portal.security.auth.HttpPrincipal;
032: import com.liferay.portal.service.http.TunnelUtil;
033:
034: import com.liferay.portlet.journal.service.JournalFeedServiceUtil;
035:
036: /**
037: * <a href="JournalFeedServiceHttp.java.html"><b><i>View Source</i></b></a>
038: *
039: * <p>
040: * ServiceBuilder generated this class. Modifications in this class will be
041: * overwritten the next time is generated.
042: * </p>
043: *
044: * <p>
045: * This class provides a HTTP utility for the
046: * <code>com.liferay.portlet.journal.service.JournalFeedServiceUtil</code> service
047: * utility. The static methods of this class calls the same methods of the
048: * service utility. However, the signatures are different because it requires an
049: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
050: * parameter.
051: * </p>
052: *
053: * <p>
054: * The benefits of using the HTTP utility is that it is fast and allows for
055: * tunneling without the cost of serializing to text. The drawback is that it
056: * only works with Java.
057: * </p>
058: *
059: * <p>
060: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
061: * portal.properties to configure security.
062: * </p>
063: *
064: * <p>
065: * The HTTP utility is only generated for remote services.
066: * </p>
067: *
068: * @author Brian Wing Shun Chan
069: *
070: * @see com.liferay.portal.security.auth.HttpPrincipal
071: * @see com.liferay.portlet.journal.service.JournalFeedServiceUtil
072: * @see com.liferay.portlet.journal.service.http.JournalFeedServiceSoap
073: *
074: */
075: public class JournalFeedServiceHttp {
076: public static com.liferay.portlet.journal.model.JournalFeed addFeed(
077: HttpPrincipal httpPrincipal, long plid,
078: java.lang.String feedId, boolean autoFeedId,
079: java.lang.String name, java.lang.String description,
080: java.lang.String type, java.lang.String structureId,
081: java.lang.String templateId,
082: java.lang.String rendererTemplateId, int delta,
083: java.lang.String orderByCol, java.lang.String orderByType,
084: java.lang.String targetLayoutFriendlyUrl,
085: java.lang.String targetPortletId,
086: java.lang.String contentField, java.lang.String feedType,
087: double feedVersion, boolean addCommunityPermissions,
088: boolean addGuestPermissions)
089: throws com.liferay.portal.SystemException,
090: com.liferay.portal.PortalException {
091: try {
092: Object paramObj0 = new LongWrapper(plid);
093:
094: Object paramObj1 = feedId;
095:
096: if (feedId == null) {
097: paramObj1 = new NullWrapper("java.lang.String");
098: }
099:
100: Object paramObj2 = new BooleanWrapper(autoFeedId);
101:
102: Object paramObj3 = name;
103:
104: if (name == null) {
105: paramObj3 = new NullWrapper("java.lang.String");
106: }
107:
108: Object paramObj4 = description;
109:
110: if (description == null) {
111: paramObj4 = new NullWrapper("java.lang.String");
112: }
113:
114: Object paramObj5 = type;
115:
116: if (type == null) {
117: paramObj5 = new NullWrapper("java.lang.String");
118: }
119:
120: Object paramObj6 = structureId;
121:
122: if (structureId == null) {
123: paramObj6 = new NullWrapper("java.lang.String");
124: }
125:
126: Object paramObj7 = templateId;
127:
128: if (templateId == null) {
129: paramObj7 = new NullWrapper("java.lang.String");
130: }
131:
132: Object paramObj8 = rendererTemplateId;
133:
134: if (rendererTemplateId == null) {
135: paramObj8 = new NullWrapper("java.lang.String");
136: }
137:
138: Object paramObj9 = new IntegerWrapper(delta);
139:
140: Object paramObj10 = orderByCol;
141:
142: if (orderByCol == null) {
143: paramObj10 = new NullWrapper("java.lang.String");
144: }
145:
146: Object paramObj11 = orderByType;
147:
148: if (orderByType == null) {
149: paramObj11 = new NullWrapper("java.lang.String");
150: }
151:
152: Object paramObj12 = targetLayoutFriendlyUrl;
153:
154: if (targetLayoutFriendlyUrl == null) {
155: paramObj12 = new NullWrapper("java.lang.String");
156: }
157:
158: Object paramObj13 = targetPortletId;
159:
160: if (targetPortletId == null) {
161: paramObj13 = new NullWrapper("java.lang.String");
162: }
163:
164: Object paramObj14 = contentField;
165:
166: if (contentField == null) {
167: paramObj14 = new NullWrapper("java.lang.String");
168: }
169:
170: Object paramObj15 = feedType;
171:
172: if (feedType == null) {
173: paramObj15 = new NullWrapper("java.lang.String");
174: }
175:
176: Object paramObj16 = new DoubleWrapper(feedVersion);
177:
178: Object paramObj17 = new BooleanWrapper(
179: addCommunityPermissions);
180:
181: Object paramObj18 = new BooleanWrapper(addGuestPermissions);
182:
183: MethodWrapper methodWrapper = new MethodWrapper(
184: JournalFeedServiceUtil.class.getName(), "addFeed",
185: new Object[] { paramObj0, paramObj1, paramObj2,
186: paramObj3, paramObj4, paramObj5, paramObj6,
187: paramObj7, paramObj8, paramObj9,
188: paramObj10, paramObj11, paramObj12,
189: paramObj13, paramObj14, paramObj15,
190: paramObj16, paramObj17, paramObj18 });
191:
192: Object returnObj = null;
193:
194: try {
195: returnObj = TunnelUtil.invoke(httpPrincipal,
196: methodWrapper);
197: } catch (Exception e) {
198: if (e instanceof com.liferay.portal.SystemException) {
199: throw (com.liferay.portal.SystemException) e;
200: }
201:
202: if (e instanceof com.liferay.portal.PortalException) {
203: throw (com.liferay.portal.PortalException) e;
204: }
205:
206: throw new com.liferay.portal.SystemException(e);
207: }
208:
209: return (com.liferay.portlet.journal.model.JournalFeed) returnObj;
210: } catch (com.liferay.portal.SystemException se) {
211: _log.error(se, se);
212:
213: throw se;
214: }
215: }
216:
217: public static com.liferay.portlet.journal.model.JournalFeed addFeed(
218: HttpPrincipal httpPrincipal, long plid,
219: java.lang.String feedId, boolean autoFeedId,
220: java.lang.String name, java.lang.String description,
221: java.lang.String type, java.lang.String structureId,
222: java.lang.String templateId,
223: java.lang.String rendererTemplateId, int delta,
224: java.lang.String orderByCol, java.lang.String orderByType,
225: java.lang.String targetLayoutFriendlyUrl,
226: java.lang.String targetPortletId,
227: java.lang.String contentField, java.lang.String feedType,
228: double feedVersion,
229: java.lang.String[] communityPermissions,
230: java.lang.String[] guestPermissions)
231: throws com.liferay.portal.SystemException,
232: com.liferay.portal.PortalException {
233: try {
234: Object paramObj0 = new LongWrapper(plid);
235:
236: Object paramObj1 = feedId;
237:
238: if (feedId == null) {
239: paramObj1 = new NullWrapper("java.lang.String");
240: }
241:
242: Object paramObj2 = new BooleanWrapper(autoFeedId);
243:
244: Object paramObj3 = name;
245:
246: if (name == null) {
247: paramObj3 = new NullWrapper("java.lang.String");
248: }
249:
250: Object paramObj4 = description;
251:
252: if (description == null) {
253: paramObj4 = new NullWrapper("java.lang.String");
254: }
255:
256: Object paramObj5 = type;
257:
258: if (type == null) {
259: paramObj5 = new NullWrapper("java.lang.String");
260: }
261:
262: Object paramObj6 = structureId;
263:
264: if (structureId == null) {
265: paramObj6 = new NullWrapper("java.lang.String");
266: }
267:
268: Object paramObj7 = templateId;
269:
270: if (templateId == null) {
271: paramObj7 = new NullWrapper("java.lang.String");
272: }
273:
274: Object paramObj8 = rendererTemplateId;
275:
276: if (rendererTemplateId == null) {
277: paramObj8 = new NullWrapper("java.lang.String");
278: }
279:
280: Object paramObj9 = new IntegerWrapper(delta);
281:
282: Object paramObj10 = orderByCol;
283:
284: if (orderByCol == null) {
285: paramObj10 = new NullWrapper("java.lang.String");
286: }
287:
288: Object paramObj11 = orderByType;
289:
290: if (orderByType == null) {
291: paramObj11 = new NullWrapper("java.lang.String");
292: }
293:
294: Object paramObj12 = targetLayoutFriendlyUrl;
295:
296: if (targetLayoutFriendlyUrl == null) {
297: paramObj12 = new NullWrapper("java.lang.String");
298: }
299:
300: Object paramObj13 = targetPortletId;
301:
302: if (targetPortletId == null) {
303: paramObj13 = new NullWrapper("java.lang.String");
304: }
305:
306: Object paramObj14 = contentField;
307:
308: if (contentField == null) {
309: paramObj14 = new NullWrapper("java.lang.String");
310: }
311:
312: Object paramObj15 = feedType;
313:
314: if (feedType == null) {
315: paramObj15 = new NullWrapper("java.lang.String");
316: }
317:
318: Object paramObj16 = new DoubleWrapper(feedVersion);
319:
320: Object paramObj17 = communityPermissions;
321:
322: if (communityPermissions == null) {
323: paramObj17 = new NullWrapper("[Ljava.lang.String;");
324: }
325:
326: Object paramObj18 = guestPermissions;
327:
328: if (guestPermissions == null) {
329: paramObj18 = new NullWrapper("[Ljava.lang.String;");
330: }
331:
332: MethodWrapper methodWrapper = new MethodWrapper(
333: JournalFeedServiceUtil.class.getName(), "addFeed",
334: new Object[] { paramObj0, paramObj1, paramObj2,
335: paramObj3, paramObj4, paramObj5, paramObj6,
336: paramObj7, paramObj8, paramObj9,
337: paramObj10, paramObj11, paramObj12,
338: paramObj13, paramObj14, paramObj15,
339: paramObj16, paramObj17, paramObj18 });
340:
341: Object returnObj = null;
342:
343: try {
344: returnObj = TunnelUtil.invoke(httpPrincipal,
345: methodWrapper);
346: } catch (Exception e) {
347: if (e instanceof com.liferay.portal.SystemException) {
348: throw (com.liferay.portal.SystemException) e;
349: }
350:
351: if (e instanceof com.liferay.portal.PortalException) {
352: throw (com.liferay.portal.PortalException) e;
353: }
354:
355: throw new com.liferay.portal.SystemException(e);
356: }
357:
358: return (com.liferay.portlet.journal.model.JournalFeed) returnObj;
359: } catch (com.liferay.portal.SystemException se) {
360: _log.error(se, se);
361:
362: throw se;
363: }
364: }
365:
366: public static void deleteFeed(HttpPrincipal httpPrincipal,
367: long groupId, long feedId)
368: throws com.liferay.portal.SystemException,
369: com.liferay.portal.PortalException {
370: try {
371: Object paramObj0 = new LongWrapper(groupId);
372:
373: Object paramObj1 = new LongWrapper(feedId);
374:
375: MethodWrapper methodWrapper = new MethodWrapper(
376: JournalFeedServiceUtil.class.getName(),
377: "deleteFeed", new Object[] { paramObj0, paramObj1 });
378:
379: try {
380: TunnelUtil.invoke(httpPrincipal, methodWrapper);
381: } catch (Exception e) {
382: if (e instanceof com.liferay.portal.SystemException) {
383: throw (com.liferay.portal.SystemException) e;
384: }
385:
386: if (e instanceof com.liferay.portal.PortalException) {
387: throw (com.liferay.portal.PortalException) e;
388: }
389:
390: throw new com.liferay.portal.SystemException(e);
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,
400: long groupId, java.lang.String feedId)
401: throws com.liferay.portal.SystemException,
402: com.liferay.portal.PortalException {
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(
413: JournalFeedServiceUtil.class.getName(),
414: "deleteFeed", new Object[] { paramObj0, paramObj1 });
415:
416: try {
417: TunnelUtil.invoke(httpPrincipal, methodWrapper);
418: } catch (Exception e) {
419: if (e instanceof com.liferay.portal.SystemException) {
420: throw (com.liferay.portal.SystemException) e;
421: }
422:
423: if (e instanceof com.liferay.portal.PortalException) {
424: throw (com.liferay.portal.PortalException) e;
425: }
426:
427: throw new com.liferay.portal.SystemException(e);
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.SystemException,
439: com.liferay.portal.PortalException {
440: try {
441: Object paramObj0 = new LongWrapper(groupId);
442:
443: Object paramObj1 = new LongWrapper(feedId);
444:
445: MethodWrapper methodWrapper = new MethodWrapper(
446: JournalFeedServiceUtil.class.getName(), "getFeed",
447: new Object[] { paramObj0, paramObj1 });
448:
449: Object returnObj = null;
450:
451: try {
452: returnObj = TunnelUtil.invoke(httpPrincipal,
453: methodWrapper);
454: } catch (Exception e) {
455: if (e instanceof com.liferay.portal.SystemException) {
456: throw (com.liferay.portal.SystemException) e;
457: }
458:
459: if (e instanceof com.liferay.portal.PortalException) {
460: throw (com.liferay.portal.PortalException) e;
461: }
462:
463: throw new com.liferay.portal.SystemException(e);
464: }
465:
466: return (com.liferay.portlet.journal.model.JournalFeed) returnObj;
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,
476: java.lang.String feedId)
477: throws com.liferay.portal.SystemException,
478: com.liferay.portal.PortalException {
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(
489: JournalFeedServiceUtil.class.getName(), "getFeed",
490: new Object[] { paramObj0, paramObj1 });
491:
492: Object returnObj = null;
493:
494: try {
495: returnObj = TunnelUtil.invoke(httpPrincipal,
496: methodWrapper);
497: } catch (Exception e) {
498: if (e instanceof com.liferay.portal.SystemException) {
499: throw (com.liferay.portal.SystemException) e;
500: }
501:
502: if (e instanceof com.liferay.portal.PortalException) {
503: throw (com.liferay.portal.PortalException) e;
504: }
505:
506: throw new com.liferay.portal.SystemException(e);
507: }
508:
509: return (com.liferay.portlet.journal.model.JournalFeed) returnObj;
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,
519: java.lang.String feedId, java.lang.String name,
520: java.lang.String description, java.lang.String type,
521: java.lang.String structureId, java.lang.String templateId,
522: java.lang.String rendererTemplateId, int delta,
523: java.lang.String orderByCol, java.lang.String orderByType,
524: java.lang.String targetLayoutFriendlyUrl,
525: java.lang.String targetPortletId,
526: java.lang.String contentField, java.lang.String feedType,
527: double feedVersion)
528: throws com.liferay.portal.SystemException,
529: com.liferay.portal.PortalException {
530: try {
531: Object paramObj0 = new LongWrapper(groupId);
532:
533: Object paramObj1 = feedId;
534:
535: if (feedId == null) {
536: paramObj1 = new NullWrapper("java.lang.String");
537: }
538:
539: Object paramObj2 = name;
540:
541: if (name == null) {
542: paramObj2 = new NullWrapper("java.lang.String");
543: }
544:
545: Object paramObj3 = description;
546:
547: if (description == null) {
548: paramObj3 = new NullWrapper("java.lang.String");
549: }
550:
551: Object paramObj4 = type;
552:
553: if (type == null) {
554: paramObj4 = new NullWrapper("java.lang.String");
555: }
556:
557: Object paramObj5 = structureId;
558:
559: if (structureId == null) {
560: paramObj5 = new NullWrapper("java.lang.String");
561: }
562:
563: Object paramObj6 = templateId;
564:
565: if (templateId == null) {
566: paramObj6 = new NullWrapper("java.lang.String");
567: }
568:
569: Object paramObj7 = rendererTemplateId;
570:
571: if (rendererTemplateId == null) {
572: paramObj7 = new NullWrapper("java.lang.String");
573: }
574:
575: Object paramObj8 = new IntegerWrapper(delta);
576:
577: Object paramObj9 = orderByCol;
578:
579: if (orderByCol == null) {
580: paramObj9 = new NullWrapper("java.lang.String");
581: }
582:
583: Object paramObj10 = orderByType;
584:
585: if (orderByType == null) {
586: paramObj10 = new NullWrapper("java.lang.String");
587: }
588:
589: Object paramObj11 = targetLayoutFriendlyUrl;
590:
591: if (targetLayoutFriendlyUrl == null) {
592: paramObj11 = new NullWrapper("java.lang.String");
593: }
594:
595: Object paramObj12 = targetPortletId;
596:
597: if (targetPortletId == null) {
598: paramObj12 = new NullWrapper("java.lang.String");
599: }
600:
601: Object paramObj13 = contentField;
602:
603: if (contentField == null) {
604: paramObj13 = new NullWrapper("java.lang.String");
605: }
606:
607: Object paramObj14 = feedType;
608:
609: if (feedType == null) {
610: paramObj14 = new NullWrapper("java.lang.String");
611: }
612:
613: Object paramObj15 = new DoubleWrapper(feedVersion);
614:
615: MethodWrapper methodWrapper = new MethodWrapper(
616: JournalFeedServiceUtil.class.getName(),
617: "updateFeed", new Object[] { paramObj0, paramObj1,
618: paramObj2, paramObj3, paramObj4, paramObj5,
619: paramObj6, paramObj7, paramObj8, paramObj9,
620: paramObj10, paramObj11, paramObj12,
621: paramObj13, paramObj14, paramObj15 });
622:
623: Object returnObj = null;
624:
625: try {
626: returnObj = TunnelUtil.invoke(httpPrincipal,
627: methodWrapper);
628: } catch (Exception e) {
629: if (e instanceof com.liferay.portal.SystemException) {
630: throw (com.liferay.portal.SystemException) e;
631: }
632:
633: if (e instanceof com.liferay.portal.PortalException) {
634: throw (com.liferay.portal.PortalException) e;
635: }
636:
637: throw new com.liferay.portal.SystemException(e);
638: }
639:
640: return (com.liferay.portlet.journal.model.JournalFeed) returnObj;
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
649: .getLog(JournalFeedServiceHttp.class);
650: }
|