public abstract class AbstractGroupExtractionComponent extends AbstractSolrExtractionComponent
Modifier and Type | Field and Description |
---|---|
protected List<String> |
_groupingFields
The list of grouping fields
|
private GroupSearchContentHelper |
_groupSearchContentHelper |
_clauses, _contentTypes, _getQueryFromJSONHelper, _jsonUtils, _queryReferenceId
_contentTypeExtensionPoint, _contentTypesHelper, _subComponents, _tagName, _thesaurusDAO, EXTRACTION_METADATA_PATH_SEPARATOR, JOIN_HIERARCHY_ELEMENT, JOIN_HIERARCHY_SEPARATOR
Constructor and Description |
---|
AbstractGroupExtractionComponent() |
Modifier and Type | Method and Description |
---|---|
void |
addGroupingFields(String... groupingFields)
Add grouping fields to the component
|
void |
configure(Configuration configuration) |
Map<String,Object> |
getComponentDetailsForTree()
Retrieves the details of the component for tree
|
List<String> |
getGroupingFields()
Retrieves the component grouping fields
|
protected GroupSearchContent |
organizeContentsInGroups(AmetysObjectIterable<Content> contents,
Locale defaultLocale)
Organizes contents in groups
|
void |
prepareComponentExecution(ExtractionExecutionContext context)
Prepare the execution of the component
|
protected abstract void |
saxContents(ContentHandler contentHandler,
ExtractionExecutionContext context,
Collection<? extends ResultField> resultFields,
List<Content> contents)
Sax a content
|
protected void |
saxGroup(ContentHandler contentHandler,
GroupSearchContent group,
int level,
ExtractionExecutionContext context,
Collection<? extends ResultField> resultFields)
Recursive method that saxes group of contents
First level (level=0) will not create a xml group (usually, 1st group is just here to handle a list)
|
void |
service(ServiceManager serviceManager) |
_extractGroupExpressionsFromClause, _extractVariableFromClauseExpression, _getClauseQueries, _getMetadataType, addClauses, addContentTypes, computeReferencedQueryInfos, executeComponent, getClauses, getContentSearcher, getContentTypes, getQueryReferenceId, processContents, setQueryReferenceId
addSubComponent, execute, executeSubComponents, getDefaultTagName, getLogsPrefix, getSubComponents, getTagName, setTagName
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected List<String> _groupingFields
private GroupSearchContentHelper _groupSearchContentHelper
public AbstractGroupExtractionComponent()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class AbstractSolrExtractionComponent
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractSolrExtractionComponent
ConfigurationException
public void prepareComponentExecution(ExtractionExecutionContext context) throws Exception
ExtractionComponent
prepareComponentExecution
in interface ExtractionComponent
prepareComponentExecution
in class AbstractSolrExtractionComponent
context
- context of the extraction componentException
- if an error occursprotected GroupSearchContent organizeContentsInGroups(AmetysObjectIterable<Content> contents, Locale defaultLocale)
contents
- The contents to organizedefaultLocale
- The default locale for localized values. Only useful if grouping by multilingual contents or multilingual stringprotected void saxGroup(ContentHandler contentHandler, GroupSearchContent group, int level, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields) throws Exception
contentHandler
- result documentgroup
- group to saxlevel
- current level (start with zero)context
- execution contextresultFields
- result fields to saxException
- if a error occurredprotected abstract void saxContents(ContentHandler contentHandler, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields, List<Content> contents) throws Exception
contentHandler
- result documentcontext
- execution contextresultFields
- result fields to saxcontents
- contents to saxException
- if an error occurspublic Map<String,Object> getComponentDetailsForTree()
ExtractionComponent
getComponentDetailsForTree
in interface ExtractionComponent
getComponentDetailsForTree
in class AbstractSolrExtractionComponent
Map
containing component detailspublic List<String> getGroupingFields()
public void addGroupingFields(String... groupingFields)
groupingFields
- Array of the grouping fields to add