Package org.ametys.cms.search.cocoon
Class DocSearchGenerator
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,Contextualizable,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
public class DocSearchGenerator extends SearchGenerator
Generate contents returned by theSearchAction, groups by selected fields.
-
-
Field Summary
Fields Modifier and Type Field Description private GroupSearchContentHelper_groupSearchContentHelper-
Fields inherited from class org.ametys.cms.search.cocoon.SearchGenerator
_columnHelper, _contentRSH, _contentTypeExtensionPoint, _context, _cTypeHelper, _searchModelManager, _serverCommHelper, _valuesExtractorFactory, CONTENT_VERSION_LABEL
-
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 DocSearchGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<? extends ResultField>_filterResultFields(List<String> groupingFields, List<String> columns, Collection<? extends ResultField> resultFields)private List<String>_getGroupingFields(Map<String,Object> jsParameters)private void_saxContentForDoc(Content content, Collection<? extends ResultField> resultFields, Map<String,SearchUIColumn> uiResultFields, Locale locale)SAX the result contentprivate void_saxGroup(GroupSearchContent group, int level, Collection<? extends ResultField> resultFields, Map<String,SearchUIColumn> uiResultFields, Locale locale)Sax a group of content recursively.protected voidsaxContents(SearchModel model, SearchResults<Content> results, Collection<? extends ResultField> resultFields, String versionLabel, Map<String,Object> jsParameters, Locale locale, Map<String,Object> contextualParameters)Sax a set of contentsvoidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.cms.search.cocoon.SearchGenerator
contextualize, generate, getColumnsFromParameters, getCommonContentTypeIds, saxContent, switchToLabel
-
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
-
_groupSearchContentHelper
private GroupSearchContentHelper _groupSearchContentHelper
-
-
Constructor Detail
-
DocSearchGenerator
public DocSearchGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classSearchGenerator- Throws:
ServiceException
-
saxContents
protected void saxContents(SearchModel model, SearchResults<Content> results, Collection<? extends ResultField> resultFields, String versionLabel, Map<String,Object> jsParameters, Locale locale, Map<String,Object> contextualParameters) throws SAXException, AmetysRepositoryException, IOException, ProcessingException
Description copied from class:SearchGeneratorSax a set of contents- Overrides:
saxContentsin classSearchGenerator- Parameters:
model- search modelresults- contentsresultFields- fields to retreiveversionLabel- version labeljsParameters- parameters of the searchlocale- The locale to use for localized values if content's language is null.contextualParameters- The contextual parameters- Throws:
SAXException- if a error occurred during saxAmetysRepositoryException- if a error occurredIOException- if a error occurredProcessingException- if a error occurred
-
_filterResultFields
private Collection<? extends ResultField> _filterResultFields(List<String> groupingFields, List<String> columns, Collection<? extends ResultField> resultFields)
-
_saxGroup
private void _saxGroup(GroupSearchContent group, int level, Collection<? extends ResultField> resultFields, Map<String,SearchUIColumn> uiResultFields, Locale locale) throws SAXException, AmetysRepositoryException, IOException, ProcessingException
Sax a group of content recursively. First level (level=0) will not create a xml group (usually, 1st group is just here to handle a list)- Parameters:
group- group to saxlevel- current level (start with zero)resultFields- result fields to saxuiResultFields- The columns to be exportedlocale- The locale for search. Can be null.- Throws:
SAXException- if a error occurred during saxAmetysRepositoryException- if a error occurredIOException- if a error occurredProcessingException- if a error occurred
-
_saxContentForDoc
private void _saxContentForDoc(Content content, Collection<? extends ResultField> resultFields, Map<String,SearchUIColumn> uiResultFields, Locale locale) throws SAXException, AmetysRepositoryException, IOException, ProcessingException
SAX the result content- Parameters:
content- the resultresultFields- the result fieldsuiResultFields- The columns to be exportedlocale- The locale for search. Can be null.- Throws:
SAXException- if a error occurred during saxAmetysRepositoryException- if a error occurredIOException- if a error occurredProcessingException- if a error occurred
-
-