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
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeExtensionPoint
Content types extension pointprotected ContentTypesHelper
_contentTypesHelper
Helper for content typesprotected List<ExtractionComponent>
_subComponents
The list of sub componentsprotected String
_tagName
the tag nameprotected ThesaurusDAO
_thesaurusDAO
Thesaurus DAOprotected static String
EXTRACTION_ITEM_PATH_SEPARATOR
Metadata path separator used in extraction definitionprotected static String
JOIN_HIERARCHY_ELEMENT
Hierarchy level element representation for join expressionprotected static String
JOIN_HIERARCHY_SEPARATOR
Hierarchy level separator for join expression
-
Constructor Summary
Constructors Constructor Description AbstractExtractionComponent()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addSubComponent(ExtractionComponent subComponent)
Add sub componentvoid
configure(Configuration configuration)
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 componentsMap<String,Object>
getComponentDetailsForTree()
Retrieves the details of the component for treeprotected abstract String
getDefaultTagName()
Retrieves the default tag nameprotected abstract String
getLogsPrefix()
Retrieves the prefix to use in exceptions thrown by this componentList<ExtractionComponent>
getSubComponents()
Retrieves sub components of the componentString
getTagName()
Retrieves the component tag namevoid
prepareComponentExecution(ExtractionExecutionContext context)
Prepare the execution of the componentvoid
service(ServiceManager serviceManager)
void
setTagName(String tagName)
Sets the component tag name-
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
-
-
-
-
Field Detail
-
JOIN_HIERARCHY_SEPARATOR
protected static final String JOIN_HIERARCHY_SEPARATOR
Hierarchy level separator for join expression- See Also:
- Constant Field Values
-
JOIN_HIERARCHY_ELEMENT
protected static final String JOIN_HIERARCHY_ELEMENT
Hierarchy level element representation for join expression- See Also:
- Constant Field Values
-
EXTRACTION_ITEM_PATH_SEPARATOR
protected static final String EXTRACTION_ITEM_PATH_SEPARATOR
Metadata path separator used in extraction definition- See Also:
- Constant Field Values
-
_subComponents
protected List<ExtractionComponent> _subComponents
The list of sub components
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
Helper for content types
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
Content types extension point
-
_thesaurusDAO
protected ThesaurusDAO _thesaurusDAO
Thesaurus DAO
-
-
Constructor Detail
-
AbstractExtractionComponent
public AbstractExtractionComponent()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getDefaultTagName
protected abstract String getDefaultTagName()
Retrieves the default tag name- Returns:
- the default tag name
-
prepareComponentExecution
public void prepareComponentExecution(ExtractionExecutionContext context) throws Exception
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
public void addSubComponent(ExtractionComponent subComponent)
Description copied from interface:ExtractionComponent
Add sub component- Specified by:
addSubComponent
in interfaceExtractionComponent
- Parameters:
subComponent
- the sub components to add
-
getSubComponents
public List<ExtractionComponent> getSubComponents()
Description copied from interface:ExtractionComponent
Retrieves sub components of the component- Specified by:
getSubComponents
in interfaceExtractionComponent
- Returns:
- a list of sub components
-
getComponentDetailsForTree
public Map<String,Object> 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
protected abstract String getLogsPrefix()
Retrieves the prefix to use in exceptions thrown by this component- Returns:
- the prefix for exceptions
-
getTagName
public String getTagName()
Retrieves the component tag name- Returns:
- the tag name
-
setTagName
public void setTagName(String tagName)
Sets the component tag name- Parameters:
tagName
- The tag name to set
-
-