Class AbstractExtractionComponent
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.extraction.component.AbstractExtractionComponent
- All Implemented Interfaces:
ExtractionComponent
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
AbstractSolrExtractionComponent
,ThesaurusExtractionComponent
public abstract class AbstractExtractionComponent
extends AbstractLogEnabled
implements ExtractionComponent, Serviceable, Configurable
This class represents an extraction component
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
Content types extension pointprotected ContentTypesHelper
Helper for content typesprotected List<ExtractionComponent>
The list of sub componentsprotected String
the tag nameprotected ThesaurusDAO
Thesaurus DAOprotected static final String
Metadata path separator used in extraction definitionprotected static final String
Hierarchy level element representation for join expressionprotected static final String
Hierarchy level separator for join expression -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubComponent
(ExtractionComponent subComponent) Add sub componentvoid
configure
(Configuration configuration) final void
execute
(ContentHandler contentHandler, ExtractionExecutionContext context) Execute the extraction of the componentprotected abstract void
executeComponent
(ContentHandler contentHandler, ExtractionExecutionContext context) Execute the extraction of the componentvoid
executeSubComponents
(ContentHandler contentHandler, ExtractionExecutionContext context, ExtractionExecutionContextHierarchyElement currentContextHierarchyElement) Execute the sub componentsRetrieves the details of the component for treeprotected abstract String
Retrieves the default tag nameprotected abstract String
Retrieves the prefix to use in exceptions thrown by this componentRetrieves sub components of the componentRetrieves the component tag namevoid
Prepare the execution of the componentvoid
service
(ServiceManager serviceManager) void
setTagName
(String tagName) Sets the component tag nameMethods 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
-
Field Details
-
JOIN_HIERARCHY_SEPARATOR
Hierarchy level separator for join expression- See Also:
-
JOIN_HIERARCHY_ELEMENT
Hierarchy level element representation for join expression- See Also:
-
EXTRACTION_ITEM_PATH_SEPARATOR
Metadata path separator used in extraction definition- See Also:
-
_subComponents
The list of sub components -
_tagName
the tag name -
_contentTypesHelper
Helper for content types -
_contentTypeExtensionPoint
Content types extension point -
_thesaurusDAO
Thesaurus DAO
-
-
Constructor Details
-
AbstractExtractionComponent
public AbstractExtractionComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getDefaultTagName
Retrieves the default tag name- Returns:
- the default tag name
-
prepareComponentExecution
Description copied from interface:ExtractionComponent
Prepare the execution of the component- Specified by:
prepareComponentExecution
in interfaceExtractionComponent
- Parameters:
context
- context of the extraction component- Throws:
Exception
- if an error occurs
-
execute
public final void execute(ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception Description copied from interface:ExtractionComponent
Execute the extraction of the component- Specified by:
execute
in interfaceExtractionComponent
- Parameters:
contentHandler
- result documentcontext
- context of the extraction component- Throws:
Exception
- if an error occurs
-
executeComponent
protected abstract void executeComponent(ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception Execute the extraction of the component- Parameters:
contentHandler
- result documentcontext
- context of the extraction component- Throws:
Exception
- if an error occurs
-
executeSubComponents
public void executeSubComponents(ContentHandler contentHandler, ExtractionExecutionContext context, ExtractionExecutionContextHierarchyElement currentContextHierarchyElement) throws Exception Execute the sub components- Parameters:
contentHandler
- result documentcontext
- context of the extraction componentcurrentContextHierarchyElement
- the current context- Throws:
Exception
- if an error occurs
-
addSubComponent
Description copied from interface:ExtractionComponent
Add sub component- Specified by:
addSubComponent
in interfaceExtractionComponent
- Parameters:
subComponent
- the sub components to add
-
getSubComponents
Description copied from interface:ExtractionComponent
Retrieves sub components of the component- Specified by:
getSubComponents
in interfaceExtractionComponent
- Returns:
- a list of sub components
-
getComponentDetailsForTree
Description copied from interface:ExtractionComponent
Retrieves the details of the component for tree- Specified by:
getComponentDetailsForTree
in interfaceExtractionComponent
- Returns:
- a
Map
containing component details
-
getLogsPrefix
Retrieves the prefix to use in exceptions thrown by this component- Returns:
- the prefix for exceptions
-
getTagName
Retrieves the component tag name- Returns:
- the tag name
-
setTagName
Sets the component tag name- Parameters:
tagName
- The tag name to set
-