Package org.ametys.plugins.blog.posts
Class PostsGenerator
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.blog.posts.PostsGenerator
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
Generates posts from the cache.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolver.protected BlogCacheManager
The blog cache manager.protected ContentHelper
The content helper.protected SiteManager
The site Manager.protected SourceResolver
The source 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
generate()
protected Collection<String>
Get all the posts for the given criteria.protected Collection<String>
getPosts
(String siteName, String language, String type, int year, int month, String tagName, int maxCount) Get a limited number of posts for the given criteria.void
saxContent
(Content content, String viewName) SAX a content in its specific viewvoid
service
(ServiceManager serviceManager) 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
-
_blogCache
The blog cache manager. -
_ametysResolver
The ametys object resolver. -
_siteManager
The site Manager. -
_sourceResolver
The source resolver. -
_contentHelper
The content helper.
-
-
Constructor Details
-
PostsGenerator
public PostsGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
-
saxContent
SAX a content in its specific view- Parameters:
content
- The content to SAXviewName
- The view to use- Throws:
SAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.
-
getPosts
protected Collection<String> getPosts(String siteName, String language, String type, int year, int month, String tagName) Get all the posts for the given criteria.- Parameters:
siteName
- the site name.language
- the language.type
- the search type ('all', 'year', 'month' or 'tag').year
- the year in case of a 'year' or 'month' search.month
- the month, in case of a 'month' search.tagName
- the tag name in case of a 'tag' search.- Returns:
- the post IDs.
-
getPosts
protected Collection<String> getPosts(String siteName, String language, String type, int year, int month, String tagName, int maxCount) Get a limited number of posts for the given criteria.- Parameters:
siteName
- the site name.language
- the language.type
- the search type ('all', 'year', 'month' or 'tag').year
- the year in case of a 'year' or 'month' search.month
- the month, in case of a 'month' search.tagName
- the tag name in case of a 'tag' search.maxCount
- the maximum count of posts to retrieve.- Returns:
- the post IDs.
-