Class IcsEventHelper
java.lang.Object
org.ametys.plugins.calendar.icsreader.IcsEventHelper
- All Implemented Interfaces:
 Component,Serviceable
Helper from ICS events
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IcsReaderThe ICS readerprotected TagProviderExtensionPointThe tag provider extention pointstatic final StringThe component role. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected void_saxAllDay(ContentHandler handler, LocalVEvent icsEvent) Sax all day propertyprotected void_saxDate(ContentHandler handler, String tagName, Date date) Sax ICS dategetICSEvents(ZoneItem zoneItem, String siteName, EventsFilterHelper.DateTimeRange dateRange) Read the configured distant ics sources into a list ofIcsReader.IcsEventsgetICSEvents(ZoneItem zoneItem, String siteName, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Read the configured distant ics sources into a list ofIcsReader.IcsEventsgetIcsTags(ZoneItem zoneItem, String siteName) Get the ICS tags from search servicevoidsaxICSErrors(List<IcsReader.IcsEvents> icsResults, ContentHandler handler) Sax ICS errorsvoidsaxIcsEvent(ContentHandler handler, LocalVEvent icsEvent) SAX a ics eventvoidsaxIcsEventHit(ContentHandler handler, LocalVEvent icsEvent, int number) SAX a ics events hitvoidsaxIcsEventHits(ContentHandler handler, List<LocalVEvent> icsEvents, int startNumber) SAX ics events hitsvoidservice(ServiceManager smanager) toLocalIcsEvent(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange) Get a list ofLocalVEventform the list ofIcsReader.IcsEventstoLocalIcsEvent(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange, List<String> filteredTags) Get a list ofLocalVEventform the list ofIcsReader.IcsEventstoVTimeZone(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange, List<String> filteredTags) Get a list ofLocalVEventform the list ofIcsReader.IcsEvents 
- 
Field Details
- 
ROLE
The component role. - 
_icsReader
The ICS reader - 
_tagProviderEP
The tag provider extention point 
 - 
 - 
Constructor Details
- 
IcsEventHelper
public IcsEventHelper() 
 - 
 - 
Method Details
- 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
getICSEvents
public List<IcsReader.IcsEvents> getICSEvents(ZoneItem zoneItem, String siteName, EventsFilterHelper.DateTimeRange dateRange) Read the configured distant ics sources into a list ofIcsReader.IcsEvents- Parameters:
 zoneItem- zoneItem where the configuration will be fetchedsiteName- name of the current sitedateRange- range of dates to limit- Returns:
 - a list of 
IcsReader.IcsEvents 
 - 
getICSEvents
public List<IcsReader.IcsEvents> getICSEvents(ZoneItem zoneItem, String siteName, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Read the configured distant ics sources into a list ofIcsReader.IcsEvents- Parameters:
 zoneItem- zoneItem where the configuration will be fetchedsiteName- name of the current sitedateRange- range of dates to limitnbEvents- number of events to readmaxFileSize- max ics file size (in bytes)- Returns:
 - a list of 
IcsReader.IcsEvents 
 - 
getIcsTags
Get the ICS tags from search service- Parameters:
 zoneItem- The zone item idsiteName- the site name- Returns:
 - the ICS tags
 
 - 
toLocalIcsEvent
public Pair<List<LocalVEvent>,String> toLocalIcsEvent(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange) Get a list ofLocalVEventform the list ofIcsReader.IcsEvents- Parameters:
 icsEventsList- the list ofIcsReader.IcsEventsdateRange- range of dates to limit- Returns:
 - a list of 
LocalVEvent 
 - 
toLocalIcsEvent
public Pair<List<LocalVEvent>,String> toLocalIcsEvent(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange, List<String> filteredTags) Get a list ofLocalVEventform the list ofIcsReader.IcsEvents- Parameters:
 icsEventsList- the list ofIcsReader.IcsEventsdateRange- range of dates to limitfilteredTags- A list of tag's name to filter ICS events. Can be empty to no filter on tags.- Returns:
 - a list of 
LocalVEvent 
 - 
toVTimeZone
public String toVTimeZone(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange, List<String> filteredTags) Get a list ofLocalVEventform the list ofIcsReader.IcsEvents- Parameters:
 icsEventsList- the list ofIcsReader.IcsEventsdateRange- range of dates to limitfilteredTags- A list of tag's name to filter ICS events. Can be empty to no filter on tags.- Returns:
 - a list of 
LocalVEvent 
 - 
saxIcsEventHits
public void saxIcsEventHits(ContentHandler handler, List<LocalVEvent> icsEvents, int startNumber) throws SAXException SAX ics events hits- Parameters:
 handler- the content handlericsEvents- The ics eventsstartNumber- the start index- Throws:
 SAXException- if an error occurred while saxing
 - 
saxIcsEventHit
public void saxIcsEventHit(ContentHandler handler, LocalVEvent icsEvent, int number) throws SAXException SAX a ics events hit- Parameters:
 handler- the content handlericsEvent- The ics eventnumber- the hit index- Throws:
 SAXException- if an error occurred while saxing
 - 
saxIcsEvent
SAX a ics event- Parameters:
 handler- the content handlericsEvent- The ics event- Throws:
 SAXException- if an error occurred while saxing
 - 
_saxAllDay
Sax all day property- Parameters:
 handler- the content handlericsEvent- the ICS event- Throws:
 SAXException- if an error occurred while saxing
 - 
_saxDate
Sax ICS date- Parameters:
 handler- the content handlertagName- the xml tag namedate- the date to sax- Throws:
 SAXException- if an error occurred while saxing
 - 
saxICSErrors
public void saxICSErrors(List<IcsReader.IcsEvents> icsResults, ContentHandler handler) throws SAXException Sax ICS errors- Parameters:
 icsResults- the ICS eventshandler- the content handler- Throws:
 SAXException- if an error occurred
 
 -