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
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverThe ametys object resolver.protected EventsFilterHelperThe events helperprotected IcsReaderThe ICS Readerprotected TagProviderExtensionPointThe tag provider extension point.Fields inherited from class org.ametys.plugins.calendar.events.AbstractEventGenerator
_filterHelper, _resolverFields inherited from class org.apache.cocoon.generation.ServiceableGenerator
managerFields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, sourceFields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer -
Constructor Summary
Constructors -
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 voidSax a list of tagsprotected voidaddNavAttributes(AttributesImpl attrs, ZonedDateTime current, ZonedDateTime previousDay, ZonedDateTime nextDay) Add nav attributes.voidgenerate()voidsaxIcsEvent(ContentHandler handler, LocalVEvent icsEvent) Sax an event coming from a distant ICS filevoidsaxIcsEvents(ContentHandler handler, List<LocalVEvent> icsEvents) Sax a list of events coming from a distant ICS filevoidsaxMatchingContents(ContentHandler handler, WebContentFilter filter, AmetysObjectIterable<Content> contents, Page currentPage, boolean saxContentItSelf) SAX all contents matching the given filtervoidservice(ServiceManager serviceManager) Methods inherited from class org.ametys.plugins.calendar.events.AbstractEventGenerator
_getFormatedDateAttribute, saxContent, saxXMLContentMethods inherited from class org.apache.cocoon.generation.ServiceableGenerator
disposeMethods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setupMethods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandlerMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
servicein interfaceServiceable- Overrides:
servicein 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
-