Class NewsSearchModuleGenerator
- 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.workspaces.search.module.AbstractSearchModuleGenerator
-
- org.ametys.plugins.workspaces.search.module.AbstractSolrSearchModuleGenerator
-
- org.ametys.plugins.workspaces.search.module.AbstractContentSolrSearchModuleGenerator
-
- org.ametys.plugins.workspaces.search.module.NewsSearchModuleGenerator
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
public class NewsSearchModuleGenerator extends AbstractContentSolrSearchModuleGenerator
Generator for posts search module
-
-
Field Summary
-
Fields inherited from class org.ametys.plugins.workspaces.search.module.AbstractContentSolrSearchModuleGenerator
_contentSearcherFactory, _cTypesHelper, _tagProviderEP
-
Fields inherited from class org.ametys.plugins.workspaces.search.module.AbstractSearchModuleGenerator
_categoryHelper, _categoryProviderEP, _currentUserProvider, _projectManager, _projectMembers, _resolver, _rightManager, _siteManager, _userHelper, _workspaceModuleEP
-
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 Constructor Description NewsSearchModuleGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QuerygetCatalogNewsQuery(Request request, String siteName)Get the query for catalog's newsprotected QuerygetProjectNewsQuery(Request request, List<Project> projects)Get the query for projects' newsprotected QuerygetQuery(String siteName, String lang, String textfield, Request request)Get the search queryprotected ContentSearcherFactory.SimpleContentSearchergetSearcher()Get the searcherprotected List<String>getSiteNames(List<Project> projects)Get the list of sites linked to the list of projectsprotected QuerygetSiteQuery(List<Project> projects)Create a query to match the sites corresponding to the projects If projects is empty or null, then it will match nothing Else it will match the sites linked to the projectsprotected StringgetSortFieldName()The sort field nameprotected Sort.OrdergetSortOrder()The sort orderprotected voidsaxAdditionalInformation(Content content)SAX additional information on contentprotected voidsaxCategory(Content content)SAX categoryvoidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.plugins.workspaces.search.module.AbstractContentSolrSearchModuleGenerator
getSearchResults, saxHit, saxPage, saxTags
-
Methods inherited from class org.ametys.plugins.workspaces.search.module.AbstractSolrSearchModuleGenerator
saxHits
-
Methods inherited from class org.ametys.plugins.workspaces.search.module.AbstractSearchModuleGenerator
filterProjectsForModule, generate, getCategories, getProject, getProjects, saxCategory, saxCategoryColor, saxHits, saxProject, saxUser
-
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
-
-
-
-
Constructor Detail
-
NewsSearchModuleGenerator
public NewsSearchModuleGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractContentSolrSearchModuleGenerator- Throws:
ServiceException
-
getSearcher
protected ContentSearcherFactory.SimpleContentSearcher getSearcher()
Description copied from class:AbstractContentSolrSearchModuleGeneratorGet the searcher- Specified by:
getSearcherin classAbstractContentSolrSearchModuleGenerator- Returns:
- the searcher
-
getSortFieldName
protected String getSortFieldName()
Description copied from class:AbstractContentSolrSearchModuleGeneratorThe sort field name- Specified by:
getSortFieldNamein classAbstractContentSolrSearchModuleGenerator- Returns:
- the sort field name
-
getSortOrder
protected Sort.Order getSortOrder()
Description copied from class:AbstractContentSolrSearchModuleGeneratorThe sort order- Specified by:
getSortOrderin classAbstractContentSolrSearchModuleGenerator- Returns:
- the sort order
-
getQuery
protected Query getQuery(String siteName, String lang, String textfield, Request request)
Description copied from class:AbstractContentSolrSearchModuleGeneratorGet the search query- Specified by:
getQueryin classAbstractContentSolrSearchModuleGenerator- Parameters:
siteName- the current site namelang- the current languagetextfield- the search inputrequest- the request- Returns:
- the search query
-
getProjectNewsQuery
protected Query getProjectNewsQuery(Request request, List<Project> projects)
Get the query for projects' news- Parameters:
request- the requestprojects- the targeted projects- Returns:
- the query
-
getCatalogNewsQuery
protected Query getCatalogNewsQuery(Request request, String siteName)
Get the query for catalog's news- Parameters:
request- the requestsiteName- the current site name- Returns:
- the query
-
getSiteQuery
protected Query getSiteQuery(List<Project> projects)
Create a query to match the sites corresponding to the projects If projects is empty or null, then it will match nothing Else it will match the sites linked to the projects- Parameters:
projects- projects to filter- Returns:
- a Query to match the sites linked to the projects
-
getSiteNames
protected List<String> getSiteNames(List<Project> projects)
Get the list of sites linked to the list of projects- Parameters:
projects- a list of projects where we want to get the list of sites- Returns:
- a list of site names, or null if the projects were null;
-
saxAdditionalInformation
protected void saxAdditionalInformation(Content content) throws SAXException
Description copied from class:AbstractContentSolrSearchModuleGeneratorSAX additional information on content- Overrides:
saxAdditionalInformationin classAbstractContentSolrSearchModuleGenerator- Parameters:
content- the content- Throws:
SAXException- if an error occurs while saxing
-
saxCategory
protected void saxCategory(Content content) throws SAXException
SAX category- Parameters:
content- the news content- Throws:
SAXException- if an error occured while saxing
-
-