org.exoplatform.calendar.service.impl
Class ICalendarImportExport

java.lang.Object
  extended by org.exoplatform.calendar.service.impl.ICalendarImportExport
All Implemented Interfaces:
CalendarImportExport

public class ICalendarImportExport
extends java.lang.Object
implements CalendarImportExport

Created by The eXo Platform SARL Author : Hung Nguyen hung.nguyen@exoplatform.com Jul 2, 2007


Constructor Summary
ICalendarImportExport(JCRDataStorage storage)
           
 
Method Summary
 java.io.OutputStream exportCalendar(java.lang.String username, java.util.List<java.lang.String> calendarIds, java.lang.String type)
          The method exports events form calendar to icalendar file (.ics) or .csv file
 java.io.OutputStream exportCalendar(java.lang.String username, java.util.List<java.lang.String> calendarIds, java.lang.String type, int limited)
           
 java.io.OutputStream exportEventCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String username, java.lang.String calendarId, java.lang.String type, java.lang.String eventId)
          The method export calendar event to output stream by given event id
 java.util.List<CalendarEvent> getEventObjects(java.io.InputStream icalInputStream)
          The method maps the input stream to event object
 void importCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String username, java.io.InputStream icalInputStream, java.lang.String calendarName)
          The method imports events form icalendar(.ics) or outlook calendar exported .csv file to the system
 void importToCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String username, java.io.InputStream icalInputStream, java.lang.String calendarId)
          The method imports events form icalendar(.ics) or outlook calendar exported .csv file to the system
 boolean isValidate(java.io.InputStream icalInputStream)
          The method return true if the input stream is correct format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICalendarImportExport

public ICalendarImportExport(JCRDataStorage storage)
                      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

exportCalendar

public java.io.OutputStream exportCalendar(java.lang.String username,
                                           java.util.List<java.lang.String> calendarIds,
                                           java.lang.String type)
                                    throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method exports events form calendar to icalendar file (.ics) or .csv file

Specified by:
exportCalendar in interface CalendarImportExport
Parameters:
username - current user name or id
calendarIds - the group calendar ids, if you want to export events from public calendars
type - The type of calendar will be exported
Returns:
data output stream
Throws:
java.lang.Exception

exportCalendar

public java.io.OutputStream exportCalendar(java.lang.String username,
                                           java.util.List<java.lang.String> calendarIds,
                                           java.lang.String type,
                                           int limited)
                                    throws java.lang.Exception
Specified by:
exportCalendar in interface CalendarImportExport
Throws:
java.lang.Exception

exportEventCalendar

public java.io.OutputStream exportEventCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                java.lang.String username,
                                                java.lang.String calendarId,
                                                java.lang.String type,
                                                java.lang.String eventId)
                                         throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method export calendar event to output stream by given event id

Specified by:
exportEventCalendar in interface CalendarImportExport
Parameters:
sProvider - session of current user
username - current user name or id
calendarId - given calendar id, the calendar event belong to
type - The type of calendar will be exported
eventId - given event id
Returns:
data output stream
Throws:
java.lang.Exception

importCalendar

public void importCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                           java.lang.String username,
                           java.io.InputStream icalInputStream,
                           java.lang.String calendarName)
                    throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method imports events form icalendar(.ics) or outlook calendar exported .csv file to the system

Specified by:
importCalendar in interface CalendarImportExport
Parameters:
sProvider - session of current user
username - current user name or id
icalInputStream - data input stream
calendarName - given calendar name, if the name is null, default calendar name is file name
Throws:
java.lang.Exception

getEventObjects

public java.util.List<CalendarEvent> getEventObjects(java.io.InputStream icalInputStream)
                                              throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method maps the input stream to event object

Specified by:
getEventObjects in interface CalendarImportExport
Parameters:
icalInputStream - the input stream
Returns:
List of calendar event objects contant infomations
Throws:
java.lang.Exception

importToCalendar

public void importToCalendar(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                             java.lang.String username,
                             java.io.InputStream icalInputStream,
                             java.lang.String calendarId)
                      throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method imports events form icalendar(.ics) or outlook calendar exported .csv file to the system

Specified by:
importToCalendar in interface CalendarImportExport
Parameters:
sProvider - session of current user
username - current user name or id
icalInputStream - data input stream
calendarId - given existed calendar id
Throws:
java.lang.Exception

isValidate

public boolean isValidate(java.io.InputStream icalInputStream)
                   throws java.lang.Exception
Description copied from interface: CalendarImportExport
The method return true if the input stream is correct format

Specified by:
isValidate in interface CalendarImportExport
Parameters:
icalInputStream - the input stream
Throws:
java.lang.Exception


Copyright © 2011 eXo Platform SAS. All Rights Reserved.