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_contentTypeExtensionPointContent types extension pointprotected ContentTypesHelper_contentTypesHelperHelper for content typesprotected List<ExtractionComponent>_subComponentsThe list of sub componentsprotected String_tagNamethe tag nameprotected ThesaurusDAO_thesaurusDAOThesaurus DAOprotected static StringEXTRACTION_ITEM_PATH_SEPARATORMetadata path separator used in extraction definitionprotected static StringJOIN_HIERARCHY_ELEMENTHierarchy level element representation for join expressionprotected static StringJOIN_HIERARCHY_SEPARATORHierarchy 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 voidaddSubComponent(ExtractionComponent subComponent)Add sub componentvoidconfigure(Configuration configuration)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 componentsMap<String,Object>getComponentDetailsForTree()Retrieves the details of the component for treeprotected abstract StringgetDefaultTagName()Retrieves the default tag nameprotected abstract StringgetLogsPrefix()Retrieves the prefix to use in exceptions thrown by this componentList<ExtractionComponent>getSubComponents()Retrieves sub components of the componentStringgetTagName()Retrieves the component tag namevoidprepareComponentExecution(ExtractionExecutionContext context)Prepare the execution of the componentvoidservice(ServiceManager serviceManager)voidsetTagName(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:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein 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: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
public void addSubComponent(ExtractionComponent subComponent)
Description copied from interface:ExtractionComponentAdd sub component- Specified by:
addSubComponentin interfaceExtractionComponent- Parameters:
subComponent- the sub components to add
-
getSubComponents
public List<ExtractionComponent> getSubComponents()
Description copied from interface:ExtractionComponentRetrieves sub components of the component- Specified by:
getSubComponentsin interfaceExtractionComponent- Returns:
- a list of sub components
-
getComponentDetailsForTree
public Map<String,Object> getComponentDetailsForTree()
Description copied from interface:ExtractionComponentRetrieves the details of the component for tree- Specified by:
getComponentDetailsForTreein interfaceExtractionComponent- Returns:
- a
Mapcontaining 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
-
-