public class PostsGenerator extends ServiceableGenerator
Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_ametysResolver
The ametys object resolver.
|
protected BlogCacheManager |
_blogCache
The blog cache manager.
|
protected SiteManager |
_siteManager
The site Manager.
|
protected SourceResolver |
_sourceResolver
The source resolver.
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
PostsGenerator() |
Modifier and Type | Method and Description |
---|---|
private boolean |
_isFuturePost(BlogCacheManager.Post post) |
void |
generate() |
protected Collection<String> |
getPosts(String siteName,
String language,
String type,
int year,
int month,
String tagName)
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 metadataSetName)
SAX a content in its specific view
|
void |
service(ServiceManager serviceManager) |
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
protected BlogCacheManager _blogCache
protected AmetysObjectResolver _ametysResolver
protected SiteManager _siteManager
protected SourceResolver _sourceResolver
public PostsGenerator()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
public void saxContent(Content content, String metadataSetName) throws SAXException, IOException
content
- The content to SAXmetadataSetName
- The metadata set to useSAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.protected Collection<String> getPosts(String siteName, String language, String type, int year, int month, String tagName)
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.protected Collection<String> getPosts(String siteName, String language, String type, int year, int month, String tagName, int maxCount)
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.private boolean _isFuturePost(BlogCacheManager.Post post)