Class IcsEventHelper
java.lang.Object
org.ametys.plugins.calendar.icsreader.IcsEventHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper from ICS events
-
Field Summary
Modifier and TypeFieldDescriptionprotected IcsReader
The ICS readerprotected TagProviderExtensionPoint
The tag provider extention pointstatic final String
The component role. -
Constructor Summary
-
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.IcsEvents
getIcsTags
(ZoneItem zoneItem, String siteName) Get the ICS tags from search servicevoid
saxIcsEvent
(ContentHandler handler, LocalVEvent icsEvent) SAX a ics eventvoid
saxIcsEventHit
(ContentHandler handler, LocalVEvent icsEvent, int number) SAX a ics events hitvoid
saxIcsEventHits
(ContentHandler handler, List<LocalVEvent> icsEvents, int startNumber) SAX ics events hitsvoid
service
(ServiceManager smanager) toLocalIcsEvent
(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange) Get a list ofLocalVEvent
form the list ofIcsReader.IcsEvents
toLocalIcsEvent
(List<IcsReader.IcsEvents> icsEventsList, EventsFilterHelper.DateTimeRange dateRange, List<String> filteredTags) Get a list ofLocalVEvent
form 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:
service
in 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
-
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 ofLocalVEvent
form the list ofIcsReader.IcsEvents
- Parameters:
icsEventsList
- the list ofIcsReader.IcsEvents
dateRange
- 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 ofLocalVEvent
form the list ofIcsReader.IcsEvents
- Parameters:
icsEventsList
- the list ofIcsReader.IcsEvents
dateRange
- 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
-