Class ThesaurusExtractionComponent
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.extraction.component.AbstractExtractionComponent
-
- org.ametys.plugins.extraction.component.ThesaurusExtractionComponent
-
- All Implemented Interfaces:
ExtractionComponent
,Configurable
,LogEnabled
,Serviceable
public class ThesaurusExtractionComponent extends AbstractExtractionComponent
This class represents a thesaurus component of the extraction module
-
-
Field Summary
Fields Modifier and Type Field Description private I18nUtils
_i18nUtils
private int
_maxLevel
private ContentType
_microThesaurus
private String
_microThesaurusId
private Thesaurus
_thesaurus
-
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 ThesaurusExtractionComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
_initializeThesaurus()
private void
_processChildren(ContentHandler contentHandler, AmetysObjectIterable<Content> children, int currentLevel, ExtractionExecutionContext context)
void
configure(Configuration thesaurus)
void
executeComponent(ContentHandler contentHandler, ExtractionExecutionContext context)
Execute the extraction of the componentMap<String,Object>
getComponentDetailsForTree()
Retrieves the details of the component for treeSet<String>
getContentTypes()
Retrieves the list of content types defined for this componentprotected String
getDefaultTagName()
Retrieves the default tag nameprotected String
getLogsPrefix()
Retrieves the prefix to use in exceptions thrown by this componentint
getMaxLevel()
Retrieves the maximum level of specific terms to look atString
getMicroThesaurusId()
Retrieves the component microthesaurus idvoid
service(ServiceManager serviceManager)
void
setMaxLevel(int maxLevel)
Set the maximum level of specific terms to look atvoid
setMicroThesaurusId(String microThesaurusId)
Set the microthesaurus id-
Methods inherited from class org.ametys.plugins.extraction.component.AbstractExtractionComponent
addSubComponent, execute, executeSubComponents, getSubComponents, getTagName, prepareComponentExecution, setTagName
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_microThesaurusId
private String _microThesaurusId
-
_thesaurus
private Thesaurus _thesaurus
-
_microThesaurus
private ContentType _microThesaurus
-
_maxLevel
private int _maxLevel
-
_i18nUtils
private I18nUtils _i18nUtils
-
-
Constructor Detail
-
ThesaurusExtractionComponent
public ThesaurusExtractionComponent()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractExtractionComponent
- Throws:
ServiceException
-
configure
public void configure(Configuration thesaurus) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractExtractionComponent
- Throws:
ConfigurationException
-
_initializeThesaurus
void _initializeThesaurus()
-
executeComponent
public void executeComponent(ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception
Description copied from class:AbstractExtractionComponent
Execute the extraction of the component- Specified by:
executeComponent
in classAbstractExtractionComponent
- Parameters:
contentHandler
- result documentcontext
- context of the extraction component- Throws:
Exception
- if an error occurs
-
getContentTypes
public Set<String> getContentTypes()
Description copied from interface:ExtractionComponent
Retrieves the list of content types defined for this component- Returns:
- a list of content types id
-
_processChildren
private void _processChildren(ContentHandler contentHandler, AmetysObjectIterable<Content> children, int currentLevel, ExtractionExecutionContext context) throws Exception
- Throws:
Exception
-
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 classAbstractExtractionComponent
- 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
-
getMicroThesaurusId
public String getMicroThesaurusId()
Retrieves the component microthesaurus id- Returns:
- The microthesaurus id
-
setMicroThesaurusId
public void setMicroThesaurusId(String microThesaurusId)
Set the microthesaurus id- Parameters:
microThesaurusId
- The microthesaurus id to set
-
getMaxLevel
public int getMaxLevel()
Retrieves the maximum level of specific terms to look at- Returns:
- The maximum level
-
setMaxLevel
public void setMaxLevel(int maxLevel)
Set the maximum level of specific terms to look at- Parameters:
maxLevel
- The maximum level to set
-
-