Class EventsGenerator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.generation.AbstractGenerator
org.apache.cocoon.generation.ServiceableGenerator
org.ametys.plugins.calendar.events.AbstractEventGenerator
org.ametys.plugins.calendar.events.EventsGenerator
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
Query and generate news according to many parameters.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolver.protected EventsFilterHelper
The events helperprotected IcsReader
The ICS Readerprotected TagProviderExtensionPoint
The tag provider extension point.Fields inherited from class org.ametys.plugins.calendar.events.AbstractEventGenerator
_filterHelper, _resolver
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_saxCategories
(Collection<Tag> categories, Collection<Tag> icsTags) Generate the list of selected tags that act as categories and their descendant tags.protected void
_saxDays
(ZonedDateTime date, String type) Generate days to build a "calendar" view.protected void
_saxDaysNew
(EventsFilterHelper.DateTimeRange dateRange, String rangeType) Generate days to build a "calendar" view.protected void
_saxMonths
(EventsFilterHelper.DateTimeRange dateRange) SAX information on the months spanning the date range.protected void
_saxTags
(Collection<String> tags) Generate the list of selected tags.protected void
Sax a list of tagsprotected void
addNavAttributes
(AttributesImpl attrs, ZonedDateTime current, ZonedDateTime previousDay, ZonedDateTime nextDay) Add nav attributes.void
generate()
void
saxIcsEvent
(ContentHandler handler, LocalVEvent icsEvent) Sax an event coming from a distant ICS filevoid
saxIcsEvents
(ContentHandler handler, List<LocalVEvent> icsEvents) Sax a list of events coming from a distant ICS filevoid
saxMatchingContents
(ContentHandler handler, WebContentFilter filter, AmetysObjectIterable<Content> contents, Page currentPage, boolean saxContentItSelf) SAX all contents matching the given filtervoid
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.plugins.calendar.events.AbstractEventGenerator
_getFormatedDateAttribute, saxContent, saxXMLContent
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
Field Details
-
_ametysResolver
The ametys object resolver. -
_eventsFilterHelper
The events helper -
_icsReader
The ICS Reader -
_tagProviderEP
The tag provider extension point.
-
-
Constructor Details
-
EventsGenerator
public EventsGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractEventGenerator
- Throws:
ServiceException
-
generate
-
saxMatchingContents
public void saxMatchingContents(ContentHandler handler, WebContentFilter filter, AmetysObjectIterable<Content> contents, Page currentPage, boolean saxContentItSelf) throws SAXException, IOException SAX all contents matching the given filter- Parameters:
handler
- The content handler to SAX intofilter
- The filtercontents
- iterator on the contents.currentPage
- The current page.saxContentItSelf
- true to sax the content, false will only sax some meta- Throws:
SAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.
-
saxIcsEvents
Sax a list of events coming from a distant ICS file- Parameters:
handler
- The content handler to SAX intoicsEvents
- the events to sax- Throws:
SAXException
- Something went wrong
-
saxIcsEvent
Sax an event coming from a distant ICS file- Parameters:
handler
- The content handler to SAX intoicsEvent
- an event to sax- Throws:
SAXException
- Something went wrong
-
_saxMonths
SAX information on the months spanning the date range.- Parameters:
dateRange
- the date range.- Throws:
SAXException
- if a error occurs while saxing
-
_saxDaysNew
protected void _saxDaysNew(EventsFilterHelper.DateTimeRange dateRange, String rangeType) throws SAXException Generate days to build a "calendar" view.- Parameters:
dateRange
- a date belonging to the time span to generate.rangeType
- the range type, "month" or "week".- Throws:
SAXException
- if an error occurs while saxing
-
_saxDays
Generate days to build a "calendar" view.- Parameters:
date
- a date belonging to the time span to generate.type
- the range type, "month" or "week".- Throws:
SAXException
- if an error occurs while saxing
-
_saxTags
Generate the list of selected tags.- Parameters:
tags
- the list of tags.- Throws:
SAXException
- if an error occurs while saxing
-
_saxCategories
protected void _saxCategories(Collection<Tag> categories, Collection<Tag> icsTags) throws SAXException Generate the list of selected tags that act as categories and their descendant tags.- Parameters:
categories
- the list of categories to generate.icsTags
- list of tags for the ICS feeds (tags, not parents)- Throws:
SAXException
- if an error occurs while saxing
-
_saxTags
Sax a list of tags- Parameters:
tags
- the list of tags to sax- Throws:
SAXException
- if an error occurs while saxing
-