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
FieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPointContent types extension pointprotected ContentTypesHelperHelper for content typesprotected List<ExtractionComponent> The list of sub componentsprotected Stringthe tag nameprotected ThesaurusDAOThesaurus DAOprotected static final StringMetadata path separator used in extraction definitionprotected static final StringHierarchy level element representation for join expressionprotected static final StringHierarchy level separator for join expression -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubComponent(ExtractionComponent subComponent) Add sub componentvoidconfigure(Configuration configuration) final voidexecute(ContentHandler contentHandler, ExtractionExecutionContext context) Execute the extraction of the componentprotected abstract voidexecuteComponent(ContentHandler contentHandler, ExtractionExecutionContext context) Execute the extraction of the componentvoidexecuteSubComponents(ContentHandler contentHandler, ExtractionExecutionContext context, ExtractionExecutionContextHierarchyElement currentContextHierarchyElement) Execute the sub componentsRetrieves the details of the component for treeprotected abstract StringRetrieves the default tag nameprotected abstract StringRetrieves the prefix to use in exceptions thrown by this componentRetrieves sub components of the componentRetrieves the component tag namevoidPrepare the execution of the componentvoidservice(ServiceManager serviceManager) voidsetTagName(String tagName) Sets the component tag nameMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getDefaultTagName
Retrieves the default tag name- Returns:
- the default tag name
-
prepareComponentExecution
Description copied from interface:ExtractionComponentPrepare the execution of the component- Specified by:
prepareComponentExecutionin 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:ExtractionComponentExecute the extraction of the component- Specified by:
executein 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:ExtractionComponentAdd sub component- Specified by:
addSubComponentin interfaceExtractionComponent- Parameters:
subComponent- the sub components to add
-
getSubComponents
Description copied from interface:ExtractionComponentRetrieves sub components of the component- Specified by:
getSubComponentsin interfaceExtractionComponent- Returns:
- a list of sub components
-
getComponentDetailsForTree
Description copied from interface:ExtractionComponentRetrieves the details of the component for tree- Specified by:
getComponentDetailsForTreein interfaceExtractionComponent- Returns:
- a
Mapcontaining 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
-