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.calendar.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.IntegerWrapper;
027: import com.liferay.portal.kernel.util.LongWrapper;
028: import com.liferay.portal.kernel.util.MethodWrapper;
029: import com.liferay.portal.kernel.util.NullWrapper;
030: import com.liferay.portal.security.auth.HttpPrincipal;
031: import com.liferay.portal.service.http.TunnelUtil;
032:
033: import com.liferay.portlet.calendar.service.CalEventServiceUtil;
034:
035: /**
036: * <a href="CalEventServiceHttp.java.html"><b><i>View Source</i></b></a>
037: *
038: * <p>
039: * ServiceBuilder generated this class. Modifications in this class will be
040: * overwritten the next time is generated.
041: * </p>
042: *
043: * <p>
044: * This class provides a HTTP utility for the
045: * <code>com.liferay.portlet.calendar.service.CalEventServiceUtil</code> service
046: * utility. The static methods of this class calls the same methods of the
047: * service utility. However, the signatures are different because it requires an
048: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
049: * parameter.
050: * </p>
051: *
052: * <p>
053: * The benefits of using the HTTP utility is that it is fast and allows for
054: * tunneling without the cost of serializing to text. The drawback is that it
055: * only works with Java.
056: * </p>
057: *
058: * <p>
059: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
060: * portal.properties to configure security.
061: * </p>
062: *
063: * <p>
064: * The HTTP utility is only generated for remote services.
065: * </p>
066: *
067: * @author Brian Wing Shun Chan
068: *
069: * @see com.liferay.portal.security.auth.HttpPrincipal
070: * @see com.liferay.portlet.calendar.service.CalEventServiceUtil
071: * @see com.liferay.portlet.calendar.service.http.CalEventServiceSoap
072: *
073: */
074: public class CalEventServiceHttp {
075: public static com.liferay.portlet.calendar.model.CalEvent addEvent(
076: HttpPrincipal httpPrincipal, long plid,
077: java.lang.String title, java.lang.String description,
078: int startDateMonth, int startDateDay, int startDateYear,
079: int startDateHour, int startDateMinute, int endDateMonth,
080: int endDateDay, int endDateYear, int durationHour,
081: int durationMinute, boolean allDay,
082: boolean timeZoneSensitive, java.lang.String type,
083: boolean repeating,
084: com.liferay.portal.kernel.cal.Recurrence recurrence,
085: java.lang.String remindBy, int firstReminder,
086: int secondReminder, boolean addCommunityPermissions,
087: boolean addGuestPermissions)
088: throws com.liferay.portal.SystemException,
089: com.liferay.portal.PortalException {
090: try {
091: Object paramObj0 = new LongWrapper(plid);
092:
093: Object paramObj1 = title;
094:
095: if (title == null) {
096: paramObj1 = new NullWrapper("java.lang.String");
097: }
098:
099: Object paramObj2 = description;
100:
101: if (description == null) {
102: paramObj2 = new NullWrapper("java.lang.String");
103: }
104:
105: Object paramObj3 = new IntegerWrapper(startDateMonth);
106:
107: Object paramObj4 = new IntegerWrapper(startDateDay);
108:
109: Object paramObj5 = new IntegerWrapper(startDateYear);
110:
111: Object paramObj6 = new IntegerWrapper(startDateHour);
112:
113: Object paramObj7 = new IntegerWrapper(startDateMinute);
114:
115: Object paramObj8 = new IntegerWrapper(endDateMonth);
116:
117: Object paramObj9 = new IntegerWrapper(endDateDay);
118:
119: Object paramObj10 = new IntegerWrapper(endDateYear);
120:
121: Object paramObj11 = new IntegerWrapper(durationHour);
122:
123: Object paramObj12 = new IntegerWrapper(durationMinute);
124:
125: Object paramObj13 = new BooleanWrapper(allDay);
126:
127: Object paramObj14 = new BooleanWrapper(timeZoneSensitive);
128:
129: Object paramObj15 = type;
130:
131: if (type == null) {
132: paramObj15 = new NullWrapper("java.lang.String");
133: }
134:
135: Object paramObj16 = new BooleanWrapper(repeating);
136:
137: Object paramObj17 = recurrence;
138:
139: if (recurrence == null) {
140: paramObj17 = new NullWrapper(
141: "com.liferay.portal.kernel.cal.Recurrence");
142: }
143:
144: Object paramObj18 = remindBy;
145:
146: if (remindBy == null) {
147: paramObj18 = new NullWrapper("java.lang.String");
148: }
149:
150: Object paramObj19 = new IntegerWrapper(firstReminder);
151:
152: Object paramObj20 = new IntegerWrapper(secondReminder);
153:
154: Object paramObj21 = new BooleanWrapper(
155: addCommunityPermissions);
156:
157: Object paramObj22 = new BooleanWrapper(addGuestPermissions);
158:
159: MethodWrapper methodWrapper = new MethodWrapper(
160: CalEventServiceUtil.class.getName(), "addEvent",
161: new Object[] { paramObj0, paramObj1, paramObj2,
162: paramObj3, paramObj4, paramObj5, paramObj6,
163: paramObj7, paramObj8, paramObj9,
164: paramObj10, paramObj11, paramObj12,
165: paramObj13, paramObj14, paramObj15,
166: paramObj16, paramObj17, paramObj18,
167: paramObj19, paramObj20, paramObj21,
168: paramObj22 });
169:
170: Object returnObj = null;
171:
172: try {
173: returnObj = TunnelUtil.invoke(httpPrincipal,
174: methodWrapper);
175: } catch (Exception e) {
176: if (e instanceof com.liferay.portal.SystemException) {
177: throw (com.liferay.portal.SystemException) e;
178: }
179:
180: if (e instanceof com.liferay.portal.PortalException) {
181: throw (com.liferay.portal.PortalException) e;
182: }
183:
184: throw new com.liferay.portal.SystemException(e);
185: }
186:
187: return (com.liferay.portlet.calendar.model.CalEvent) returnObj;
188: } catch (com.liferay.portal.SystemException se) {
189: _log.error(se, se);
190:
191: throw se;
192: }
193: }
194:
195: public static com.liferay.portlet.calendar.model.CalEvent addEvent(
196: HttpPrincipal httpPrincipal, long plid,
197: java.lang.String title, java.lang.String description,
198: int startDateMonth, int startDateDay, int startDateYear,
199: int startDateHour, int startDateMinute, int endDateMonth,
200: int endDateDay, int endDateYear, int durationHour,
201: int durationMinute, boolean allDay,
202: boolean timeZoneSensitive, java.lang.String type,
203: boolean repeating,
204: com.liferay.portal.kernel.cal.Recurrence recurrence,
205: java.lang.String remindBy, int firstReminder,
206: int secondReminder,
207: java.lang.String[] communityPermissions,
208: java.lang.String[] guestPermissions)
209: throws com.liferay.portal.SystemException,
210: com.liferay.portal.PortalException {
211: try {
212: Object paramObj0 = new LongWrapper(plid);
213:
214: Object paramObj1 = title;
215:
216: if (title == null) {
217: paramObj1 = new NullWrapper("java.lang.String");
218: }
219:
220: Object paramObj2 = description;
221:
222: if (description == null) {
223: paramObj2 = new NullWrapper("java.lang.String");
224: }
225:
226: Object paramObj3 = new IntegerWrapper(startDateMonth);
227:
228: Object paramObj4 = new IntegerWrapper(startDateDay);
229:
230: Object paramObj5 = new IntegerWrapper(startDateYear);
231:
232: Object paramObj6 = new IntegerWrapper(startDateHour);
233:
234: Object paramObj7 = new IntegerWrapper(startDateMinute);
235:
236: Object paramObj8 = new IntegerWrapper(endDateMonth);
237:
238: Object paramObj9 = new IntegerWrapper(endDateDay);
239:
240: Object paramObj10 = new IntegerWrapper(endDateYear);
241:
242: Object paramObj11 = new IntegerWrapper(durationHour);
243:
244: Object paramObj12 = new IntegerWrapper(durationMinute);
245:
246: Object paramObj13 = new BooleanWrapper(allDay);
247:
248: Object paramObj14 = new BooleanWrapper(timeZoneSensitive);
249:
250: Object paramObj15 = type;
251:
252: if (type == null) {
253: paramObj15 = new NullWrapper("java.lang.String");
254: }
255:
256: Object paramObj16 = new BooleanWrapper(repeating);
257:
258: Object paramObj17 = recurrence;
259:
260: if (recurrence == null) {
261: paramObj17 = new NullWrapper(
262: "com.liferay.portal.kernel.cal.Recurrence");
263: }
264:
265: Object paramObj18 = remindBy;
266:
267: if (remindBy == null) {
268: paramObj18 = new NullWrapper("java.lang.String");
269: }
270:
271: Object paramObj19 = new IntegerWrapper(firstReminder);
272:
273: Object paramObj20 = new IntegerWrapper(secondReminder);
274:
275: Object paramObj21 = communityPermissions;
276:
277: if (communityPermissions == null) {
278: paramObj21 = new NullWrapper("[Ljava.lang.String;");
279: }
280:
281: Object paramObj22 = guestPermissions;
282:
283: if (guestPermissions == null) {
284: paramObj22 = new NullWrapper("[Ljava.lang.String;");
285: }
286:
287: MethodWrapper methodWrapper = new MethodWrapper(
288: CalEventServiceUtil.class.getName(), "addEvent",
289: new Object[] { paramObj0, paramObj1, paramObj2,
290: paramObj3, paramObj4, paramObj5, paramObj6,
291: paramObj7, paramObj8, paramObj9,
292: paramObj10, paramObj11, paramObj12,
293: paramObj13, paramObj14, paramObj15,
294: paramObj16, paramObj17, paramObj18,
295: paramObj19, paramObj20, paramObj21,
296: paramObj22 });
297:
298: Object returnObj = null;
299:
300: try {
301: returnObj = TunnelUtil.invoke(httpPrincipal,
302: methodWrapper);
303: } catch (Exception e) {
304: if (e instanceof com.liferay.portal.SystemException) {
305: throw (com.liferay.portal.SystemException) e;
306: }
307:
308: if (e instanceof com.liferay.portal.PortalException) {
309: throw (com.liferay.portal.PortalException) e;
310: }
311:
312: throw new com.liferay.portal.SystemException(e);
313: }
314:
315: return (com.liferay.portlet.calendar.model.CalEvent) returnObj;
316: } catch (com.liferay.portal.SystemException se) {
317: _log.error(se, se);
318:
319: throw se;
320: }
321: }
322:
323: public static void deleteEvent(HttpPrincipal httpPrincipal,
324: long eventId) throws com.liferay.portal.SystemException,
325: com.liferay.portal.PortalException {
326: try {
327: Object paramObj0 = new LongWrapper(eventId);
328:
329: MethodWrapper methodWrapper = new MethodWrapper(
330: CalEventServiceUtil.class.getName(), "deleteEvent",
331: new Object[] { paramObj0 });
332:
333: try {
334: TunnelUtil.invoke(httpPrincipal, methodWrapper);
335: } catch (Exception e) {
336: if (e instanceof com.liferay.portal.SystemException) {
337: throw (com.liferay.portal.SystemException) e;
338: }
339:
340: if (e instanceof com.liferay.portal.PortalException) {
341: throw (com.liferay.portal.PortalException) e;
342: }
343:
344: throw new com.liferay.portal.SystemException(e);
345: }
346: } catch (com.liferay.portal.SystemException se) {
347: _log.error(se, se);
348:
349: throw se;
350: }
351: }
352:
353: public static java.io.File exportEvent(HttpPrincipal httpPrincipal,
354: long eventId) throws com.liferay.portal.SystemException,
355: com.liferay.portal.PortalException {
356: try {
357: Object paramObj0 = new LongWrapper(eventId);
358:
359: MethodWrapper methodWrapper = new MethodWrapper(
360: CalEventServiceUtil.class.getName(), "exportEvent",
361: new Object[] { paramObj0 });
362:
363: Object returnObj = null;
364:
365: try {
366: returnObj = TunnelUtil.invoke(httpPrincipal,
367: methodWrapper);
368: } catch (Exception e) {
369: if (e instanceof com.liferay.portal.SystemException) {
370: throw (com.liferay.portal.SystemException) e;
371: }
372:
373: if (e instanceof com.liferay.portal.PortalException) {
374: throw (com.liferay.portal.PortalException) e;
375: }
376:
377: throw new com.liferay.portal.SystemException(e);
378: }
379:
380: return (java.io.File) returnObj;
381: } catch (com.liferay.portal.SystemException se) {
382: _log.error(se, se);
383:
384: throw se;
385: }
386: }
387:
388: public static java.io.File exportGroupEvents(
389: HttpPrincipal httpPrincipal, long plid,
390: java.lang.String fileName)
391: throws com.liferay.portal.SystemException,
392: com.liferay.portal.PortalException {
393: try {
394: Object paramObj0 = new LongWrapper(plid);
395:
396: Object paramObj1 = fileName;
397:
398: if (fileName == null) {
399: paramObj1 = new NullWrapper("java.lang.String");
400: }
401:
402: MethodWrapper methodWrapper = new MethodWrapper(
403: CalEventServiceUtil.class.getName(),
404: "exportGroupEvents", new Object[] { paramObj0,
405: paramObj1 });
406:
407: Object returnObj = null;
408:
409: try {
410: returnObj = TunnelUtil.invoke(httpPrincipal,
411: methodWrapper);
412: } catch (Exception e) {
413: if (e instanceof com.liferay.portal.SystemException) {
414: throw (com.liferay.portal.SystemException) e;
415: }
416:
417: if (e instanceof com.liferay.portal.PortalException) {
418: throw (com.liferay.portal.PortalException) e;
419: }
420:
421: throw new com.liferay.portal.SystemException(e);
422: }
423:
424: return (java.io.File) returnObj;
425: } catch (com.liferay.portal.SystemException se) {
426: _log.error(se, se);
427:
428: throw se;
429: }
430: }
431:
432: public static com.liferay.portlet.calendar.model.CalEvent getEvent(
433: HttpPrincipal httpPrincipal, long eventId)
434: throws com.liferay.portal.SystemException,
435: com.liferay.portal.PortalException {
436: try {
437: Object paramObj0 = new LongWrapper(eventId);
438:
439: MethodWrapper methodWrapper = new MethodWrapper(
440: CalEventServiceUtil.class.getName(), "getEvent",
441: new Object[] { paramObj0 });
442:
443: Object returnObj = null;
444:
445: try {
446: returnObj = TunnelUtil.invoke(httpPrincipal,
447: methodWrapper);
448: } catch (Exception e) {
449: if (e instanceof com.liferay.portal.SystemException) {
450: throw (com.liferay.portal.SystemException) e;
451: }
452:
453: if (e instanceof com.liferay.portal.PortalException) {
454: throw (com.liferay.portal.PortalException) e;
455: }
456:
457: throw new com.liferay.portal.SystemException(e);
458: }
459:
460: return (com.liferay.portlet.calendar.model.CalEvent) returnObj;
461: } catch (com.liferay.portal.SystemException se) {
462: _log.error(se, se);
463:
464: throw se;
465: }
466: }
467:
468: public static void importICal4j(HttpPrincipal httpPrincipal,
469: long plid, java.io.File file)
470: throws com.liferay.portal.SystemException,
471: com.liferay.portal.PortalException {
472: try {
473: Object paramObj0 = new LongWrapper(plid);
474:
475: Object paramObj1 = file;
476:
477: if (file == null) {
478: paramObj1 = new NullWrapper("java.io.File");
479: }
480:
481: MethodWrapper methodWrapper = new MethodWrapper(
482: CalEventServiceUtil.class.getName(),
483: "importICal4j",
484: new Object[] { paramObj0, paramObj1 });
485:
486: try {
487: TunnelUtil.invoke(httpPrincipal, methodWrapper);
488: } catch (Exception e) {
489: if (e instanceof com.liferay.portal.SystemException) {
490: throw (com.liferay.portal.SystemException) e;
491: }
492:
493: if (e instanceof com.liferay.portal.PortalException) {
494: throw (com.liferay.portal.PortalException) e;
495: }
496:
497: throw new com.liferay.portal.SystemException(e);
498: }
499: } catch (com.liferay.portal.SystemException se) {
500: _log.error(se, se);
501:
502: throw se;
503: }
504: }
505:
506: public static com.liferay.portlet.calendar.model.CalEvent updateEvent(
507: HttpPrincipal httpPrincipal, long eventId,
508: java.lang.String title, java.lang.String description,
509: int startDateMonth, int startDateDay, int startDateYear,
510: int startDateHour, int startDateMinute, int endDateMonth,
511: int endDateDay, int endDateYear, int durationHour,
512: int durationMinute, boolean allDay,
513: boolean timeZoneSensitive, java.lang.String type,
514: boolean repeating,
515: com.liferay.portal.kernel.cal.Recurrence recurrence,
516: java.lang.String remindBy, int firstReminder,
517: int secondReminder)
518: throws com.liferay.portal.SystemException,
519: com.liferay.portal.PortalException {
520: try {
521: Object paramObj0 = new LongWrapper(eventId);
522:
523: Object paramObj1 = title;
524:
525: if (title == null) {
526: paramObj1 = new NullWrapper("java.lang.String");
527: }
528:
529: Object paramObj2 = description;
530:
531: if (description == null) {
532: paramObj2 = new NullWrapper("java.lang.String");
533: }
534:
535: Object paramObj3 = new IntegerWrapper(startDateMonth);
536:
537: Object paramObj4 = new IntegerWrapper(startDateDay);
538:
539: Object paramObj5 = new IntegerWrapper(startDateYear);
540:
541: Object paramObj6 = new IntegerWrapper(startDateHour);
542:
543: Object paramObj7 = new IntegerWrapper(startDateMinute);
544:
545: Object paramObj8 = new IntegerWrapper(endDateMonth);
546:
547: Object paramObj9 = new IntegerWrapper(endDateDay);
548:
549: Object paramObj10 = new IntegerWrapper(endDateYear);
550:
551: Object paramObj11 = new IntegerWrapper(durationHour);
552:
553: Object paramObj12 = new IntegerWrapper(durationMinute);
554:
555: Object paramObj13 = new BooleanWrapper(allDay);
556:
557: Object paramObj14 = new BooleanWrapper(timeZoneSensitive);
558:
559: Object paramObj15 = type;
560:
561: if (type == null) {
562: paramObj15 = new NullWrapper("java.lang.String");
563: }
564:
565: Object paramObj16 = new BooleanWrapper(repeating);
566:
567: Object paramObj17 = recurrence;
568:
569: if (recurrence == null) {
570: paramObj17 = new NullWrapper(
571: "com.liferay.portal.kernel.cal.Recurrence");
572: }
573:
574: Object paramObj18 = remindBy;
575:
576: if (remindBy == null) {
577: paramObj18 = new NullWrapper("java.lang.String");
578: }
579:
580: Object paramObj19 = new IntegerWrapper(firstReminder);
581:
582: Object paramObj20 = new IntegerWrapper(secondReminder);
583:
584: MethodWrapper methodWrapper = new MethodWrapper(
585: CalEventServiceUtil.class.getName(), "updateEvent",
586: new Object[] { paramObj0, paramObj1, paramObj2,
587: paramObj3, paramObj4, paramObj5, paramObj6,
588: paramObj7, paramObj8, paramObj9,
589: paramObj10, paramObj11, paramObj12,
590: paramObj13, paramObj14, paramObj15,
591: paramObj16, paramObj17, paramObj18,
592: paramObj19, paramObj20 });
593:
594: Object returnObj = null;
595:
596: try {
597: returnObj = TunnelUtil.invoke(httpPrincipal,
598: methodWrapper);
599: } catch (Exception e) {
600: if (e instanceof com.liferay.portal.SystemException) {
601: throw (com.liferay.portal.SystemException) e;
602: }
603:
604: if (e instanceof com.liferay.portal.PortalException) {
605: throw (com.liferay.portal.PortalException) e;
606: }
607:
608: throw new com.liferay.portal.SystemException(e);
609: }
610:
611: return (com.liferay.portlet.calendar.model.CalEvent) returnObj;
612: } catch (com.liferay.portal.SystemException se) {
613: _log.error(se, se);
614:
615: throw se;
616: }
617: }
618:
619: private static Log _log = LogFactoryUtil
620: .getLog(CalEventServiceHttp.class);
621: }
|