Class AbstractContentSolrSearchModuleGenerator
- 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
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
MemberSearchModuleGenerator,NewsSearchModuleGenerator
public abstract class AbstractContentSolrSearchModuleGenerator extends AbstractSolrSearchModuleGenerator
Abstract generator for search module of type content
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentSearcherFactory_contentSearcherFactoryThe content searcher factoryprotected ContentTypesHelper_cTypesHelperThe content types helperprotected TagProviderExtensionPoint_tagProviderEPThe tag provider-
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 AbstractContentSolrSearchModuleGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract QuerygetQuery(String siteName, String lang, String textfield, Request request)Get the search queryprotected abstract ContentSearcherFactory.SimpleContentSearchergetSearcher()Get the searcherprotected SearchResults<Content>getSearchResults(String siteName, String lang, String textfield, Request request, int offset, int limit)Get the search resultsprotected abstract StringgetSortFieldName()The sort field nameprotected abstract Sort.OrdergetSortOrder()The sort orderprotected voidsaxAdditionalInformation(Content content)SAX additional information on contentprotected voidsaxHit(AmetysObject object, String lang)Sax the content hitprotected voidsaxPage(Content content)SAX page contentprotected voidsaxTags(Content content)SAX content's tagsvoidservice(ServiceManager smanager)-
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
-
-
-
-
Field Detail
-
_contentSearcherFactory
protected ContentSearcherFactory _contentSearcherFactory
The content searcher factory
-
_cTypesHelper
protected ContentTypesHelper _cTypesHelper
The content types helper
-
_tagProviderEP
protected TagProviderExtensionPoint _tagProviderEP
The tag provider
-
-
Constructor Detail
-
AbstractContentSolrSearchModuleGenerator
public AbstractContentSolrSearchModuleGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSolrSearchModuleGenerator- Throws:
ServiceException
-
saxHit
protected void saxHit(AmetysObject object, String lang) throws Exception
Description copied from class:AbstractSearchModuleGeneratorSax the content hit- Specified by:
saxHitin classAbstractSearchModuleGenerator- Parameters:
object- the AmetysObjectlang- the language- Throws:
Exception- if an error occurred while saxing result
-
saxAdditionalInformation
protected void saxAdditionalInformation(Content content) throws SAXException
SAX additional information on content- Parameters:
content- the content- Throws:
SAXException- if an error occurs while saxing
-
saxPage
protected void saxPage(Content content) throws SAXException
SAX page content- Parameters:
content- the content- Throws:
SAXException- if an error occured while saxing
-
saxTags
protected void saxTags(Content content) throws SAXException
SAX content's tags- Parameters:
content- the content- Throws:
SAXException- if an error occured while saxing
-
getSearchResults
protected SearchResults<Content> getSearchResults(String siteName, String lang, String textfield, Request request, int offset, int limit) throws Exception
Description copied from class:AbstractSolrSearchModuleGeneratorGet the search results- Specified by:
getSearchResultsin classAbstractSolrSearchModuleGenerator- Parameters:
siteName- the current site namelang- the current languagetextfield- the search inputrequest- the requestoffset- the search offsetlimit- the max number of results- Returns:
- the search results
- Throws:
Exception- if the search failed
-
getSearcher
protected abstract ContentSearcherFactory.SimpleContentSearcher getSearcher()
Get the searcher- Returns:
- the searcher
-
getSortFieldName
protected abstract String getSortFieldName()
The sort field name- Returns:
- the sort field name
-
getSortOrder
protected abstract Sort.Order getSortOrder()
The sort order- Returns:
- the sort order
-
-