Class CountExtractionComponent
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.extraction.component.AbstractExtractionComponent
-
- org.ametys.plugins.extraction.component.AbstractSolrExtractionComponent
-
- org.ametys.plugins.extraction.component.AbstractGroupExtractionComponent
-
- org.ametys.plugins.extraction.component.CountExtractionComponent
-
- All Implemented Interfaces:
ExtractionComponent
,TwoStepsExecutingExtractionComponent
,Configurable
,LogEnabled
,Serviceable
public class CountExtractionComponent extends AbstractGroupExtractionComponent implements TwoStepsExecutingExtractionComponent
This class represents a count component of the extraction module
-
-
Field Summary
-
Fields inherited from class org.ametys.plugins.extraction.component.AbstractGroupExtractionComponent
_groupingFields
-
Fields inherited from class org.ametys.plugins.extraction.component.AbstractSolrExtractionComponent
_clauses, _contentTypes, _getQueryFromJSONHelper, _jsonUtils, _queryReferenceId
-
Fields inherited from class org.ametys.plugins.extraction.component.AbstractExtractionComponent
_contentTypeExtensionPoint, _contentTypesHelper, _subComponents, _tagName, _thesaurusDAO, EXTRACTION_ITEM_PATH_SEPARATOR, JOIN_HIERARCHY_ELEMENT, JOIN_HIERARCHY_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description CountExtractionComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubComponent(ExtractionComponent subComponent)
Add sub componentIterable<Content>
computeFirstLevelResults(ExtractionExecutionContext context)
Computes first level results for preparing multiple extraction executionsvoid
executeFor(ContentHandler contentHandler, Iterable<Content> firstLevelResults, ExtractionExecutionContext context)
Execute the extraction of the component for the given first level resultsMap<String,Object>
getComponentDetailsForTree()
Retrieves the details of the component for treeprotected String
getDefaultTagName()
Retrieves the default tag nameprotected String
getLogsPrefix()
Retrieves the prefix to use in exceptions thrown by this componentprotected void
processContents(Iterable<Content> contents, ContentHandler contentHandler, ExtractionExecutionContext context)
Process result contents to format the result documentprotected void
saxContents(ContentHandler contentHandler, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields, List<Content> contents)
Sax a content-
Methods inherited from class org.ametys.plugins.extraction.component.AbstractGroupExtractionComponent
addGroupingFields, configure, getGroupingFields, organizeContentsInGroups, prepareComponentExecution, saxGroup, service
-
Methods inherited from class org.ametys.plugins.extraction.component.AbstractSolrExtractionComponent
_extractGroupExpressionsFromClause, _extractVariableFromClauseExpression, _getAttributeTypeId, _getClauseQueries, addClauses, addContentTypes, computeReferencedQueryInfos, executeComponent, getClauses, getContents, getContentSearcher, getContentTypes, getQueryReferenceId, setQueryReferenceId
-
Methods inherited from class org.ametys.plugins.extraction.component.AbstractExtractionComponent
execute, executeSubComponents, getSubComponents, getTagName, setTagName
-
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.ametys.plugins.extraction.component.ExtractionComponent
getContentTypes, getSubComponents, prepareComponentExecution
-
Methods inherited from interface org.ametys.plugins.extraction.component.TwoStepsExecutingExtractionComponent
execute
-
-
-
-
Constructor Detail
-
CountExtractionComponent
public CountExtractionComponent()
-
-
Method Detail
-
processContents
protected void processContents(Iterable<Content> contents, ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception
Description copied from class:AbstractSolrExtractionComponent
Process result contents to format the result document- Specified by:
processContents
in classAbstractSolrExtractionComponent
- Parameters:
contents
- search resultscontentHandler
- result documentcontext
- component execution context- Throws:
Exception
- if an error occurs
-
computeFirstLevelResults
public Iterable<Content> computeFirstLevelResults(ExtractionExecutionContext context) throws Exception
Description copied from interface:TwoStepsExecutingExtractionComponent
Computes first level results for preparing multiple extraction executions- Specified by:
computeFirstLevelResults
in interfaceTwoStepsExecutingExtractionComponent
- Parameters:
context
- context of the extraction component- Returns:
- The first level content results
- Throws:
Exception
- if an error occurs
-
executeFor
public void executeFor(ContentHandler contentHandler, Iterable<Content> firstLevelResults, ExtractionExecutionContext context) throws Exception
Description copied from interface:TwoStepsExecutingExtractionComponent
Execute the extraction of the component for the given first level results- Specified by:
executeFor
in interfaceTwoStepsExecutingExtractionComponent
- Parameters:
contentHandler
- result documentfirstLevelResults
- A subset of the first level content results previously returned byTwoStepsExecutingExtractionComponent.computeFirstLevelResults(ExtractionExecutionContext)
context
- context of the extraction component- Throws:
Exception
- if an error occurs
-
saxContents
protected void saxContents(ContentHandler contentHandler, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields, List<Content> contents) throws Exception
Description copied from class:AbstractGroupExtractionComponent
Sax a content- Specified by:
saxContents
in classAbstractGroupExtractionComponent
- Parameters:
contentHandler
- result documentcontext
- execution contextresultFields
- result fields to saxcontents
- contents to sax- Throws:
Exception
- if an error occurs
-
addSubComponent
public void addSubComponent(ExtractionComponent subComponent)
Description copied from interface:ExtractionComponent
Add sub component- Specified by:
addSubComponent
in interfaceExtractionComponent
- Overrides:
addSubComponent
in classAbstractExtractionComponent
- Parameters:
subComponent
- the sub components to add
-
getComponentDetailsForTree
public Map<String,Object> getComponentDetailsForTree()
Description copied from interface:ExtractionComponent
Retrieves the details of the component for tree- Specified by:
getComponentDetailsForTree
in interfaceExtractionComponent
- Overrides:
getComponentDetailsForTree
in classAbstractGroupExtractionComponent
- Returns:
- a
Map
containing component details
-
getDefaultTagName
protected String getDefaultTagName()
Description copied from class:AbstractExtractionComponent
Retrieves the default tag name- Specified by:
getDefaultTagName
in classAbstractExtractionComponent
- Returns:
- the default tag name
-
getLogsPrefix
protected String getLogsPrefix()
Description copied from class:AbstractExtractionComponent
Retrieves the prefix to use in exceptions thrown by this component- Specified by:
getLogsPrefix
in classAbstractExtractionComponent
- Returns:
- the prefix for exceptions
-
-