Class IcsEventHelper
java.lang.Object
org.ametys.plugins.calendar.icsreader.IcsEventHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper from ICS events
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetICSEvents
(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.
-
-
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
-