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 Object
implements CalendarImportExport

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


Field Summary
 
Fields inherited from interface org.exoplatform.calendar.service.CalendarImportExport
PRIVATE_TYPE, PUBLIC_TYPE, SHARED_TYPE
 
Constructor Summary
ICalendarImportExport(JCRDataStorage storage)
           
 
Method Summary
 OutputStream exportCalendar(String username, List<String> calendarIds, String type, int limited)
          The method exports events from eXo Calendar to icalendar file (.ics) or .csv file
 ByteArrayOutputStream exportEventCalendar(CalendarEvent exoEvent)
          The method export binary from event object
 OutputStream exportEventCalendar(String username, String calendarId, String type, String eventId)
          The method export calendar event to output stream by given event id
 net.fortuna.ical4j.model.Calendar getCalendarComponent(net.fortuna.ical4j.model.Calendar calendar, CalendarEvent exoEvent, String componentType)
           
 List<CalendarEvent> getEventObjects(InputStream icalInputStream)
          The method maps the input stream to event object
 void importCalendar(String username, InputStream icalInputStream, String calendarId, String calendarName, Calendar from, Calendar to, boolean isNew)
          The method imports events form icalendar(.ics) or outlook calendar exported .csv file to the system
 boolean isValidate(InputStream icalInputStream)
          The method return true if the input stream is correct format
static void setPriorityCalEvent(net.fortuna.ical4j.model.PropertyList propertyList, CalendarEvent exoEvent)
           
static void setPriorityExoEvent(net.fortuna.ical4j.model.property.Priority priority, CalendarEvent exoEvent)
           
 
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 Exception
Throws:
Exception
Method Detail

getCalendarComponent

public net.fortuna.ical4j.model.Calendar getCalendarComponent(net.fortuna.ical4j.model.Calendar calendar,
                                                              CalendarEvent exoEvent,
                                                              String componentType)
                                                       throws Exception
Throws:
Exception

exportCalendar

public OutputStream exportCalendar(String username,
                                   List<String> calendarIds,
                                   String type,
                                   int limited)
                            throws Exception
Description copied from interface: CalendarImportExport
The method exports events from eXo 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
limited - the limitation number of event
Returns:
data output stream
Throws:
Exception

exportEventCalendar

public OutputStream exportEventCalendar(String username,
                                        String calendarId,
                                        String type,
                                        String eventId)
                                 throws 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:
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:
Exception

getEventObjects

public List<CalendarEvent> getEventObjects(InputStream icalInputStream)
                                    throws 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:
Exception

isValidate

public boolean isValidate(InputStream icalInputStream)
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

importCalendar

public void importCalendar(String username,
                           InputStream icalInputStream,
                           String calendarId,
                           String calendarName,
                           Calendar from,
                           Calendar to,
                           boolean isNew)
                    throws 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:
username - current user name or id
icalInputStream - data input stream
calendarId - given existed calendar id
calendarName - name of the new calendar, if create new
from - the first date of current time-range to import event
to - to the last date of current time-range to import event
isNew - import to new calendar or existed calendar
Throws:
Exception

exportEventCalendar

public ByteArrayOutputStream exportEventCalendar(CalendarEvent exoEvent)
                                          throws Exception
Description copied from interface: CalendarImportExport
The method export binary from event object

Specified by:
exportEventCalendar in interface CalendarImportExport
Parameters:
exoEvent - : event object
Returns:
binary ics file
Throws:
Exception

setPriorityCalEvent

public static void setPriorityCalEvent(net.fortuna.ical4j.model.PropertyList propertyList,
                                       CalendarEvent exoEvent)

setPriorityExoEvent

public static void setPriorityExoEvent(net.fortuna.ical4j.model.property.Priority priority,
                                       CalendarEvent exoEvent)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.