Class ImportCourseListValuesExtractor
java.lang.Object
org.ametys.plugins.repository.data.extractor.xml.ModelAwareXMLValuesExtractor
org.ametys.plugins.odfsync.cdmfr.extractor.ImportCDMFrValuesExtractor
org.ametys.plugins.odfsync.cdmfr.extractor.ImportCourseListValuesExtractor
- All Implemented Interfaces:
ModelAwareValuesExtractor
,ValuesExtractor
This class provides methods to extract course list's values from a CMD-fr import document
-
Field Summary
Fields inherited from class org.ametys.plugins.odfsync.cdmfr.extractor.ImportCDMFrValuesExtractor
_component, _context, _factory, _MULTIPLE_DATA_ITEM_TAG, _TAG_COURSELIST
Fields inherited from class org.ametys.plugins.repository.data.extractor.xml.ModelAwareXMLValuesExtractor
_additionalDataGetter, _element, _modelItemContainers
-
Constructor Summary
ConstructorDescriptionImportCourseListValuesExtractor
(Element element, ImportCDMFrValuesExtractorFactory factory, ImportCDMFrComponent component, ImportCDMFrContext context, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, Collection<? extends ModelItemContainer> modelItemContainers) Creates an import course list values extractorImportCourseListValuesExtractor
(Element element, ImportCDMFrValuesExtractorFactory factory, ImportCDMFrComponent component, ImportCDMFrContext context, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, Model... models) Creates an import course list values extractor -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Object
_extractElementValue
(Element parent, ElementDefinition<T> definition, Optional<Object> additionalData) Extracts the value of the given elementprotected void
_fillViewItemContainerFromXML
(Element element, ViewItemContainer viewItemContainer, Collection<? extends ModelItemContainer> modelItemContainers) Fill the given view item container with the data found in the given element.protected boolean
_hasChildForAttribute
(Element element, String attributeName) Checks if the given element contains a child for the given attribute nameMethods inherited from class org.ametys.plugins.odfsync.cdmfr.extractor.ImportCDMFrValuesExtractor
_extractContentValue, _extractContentValues, _extractTableRefValue, _extractTableRefValues, _getAttributeOrDefault
Methods inherited from class org.ametys.plugins.repository.data.extractor.xml.ModelAwareXMLValuesExtractor
_extractElementValue, _extractGroupValues, _extractValue, _extractValue, _extractValues, _fillViewItemContainerFromXML, _getModelItemFromNodeName, extractValue, extractValues, extractValues
-
Constructor Details
-
ImportCourseListValuesExtractor
public ImportCourseListValuesExtractor(Element element, ImportCDMFrValuesExtractorFactory factory, ImportCDMFrComponent component, ImportCDMFrContext context, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, Model... models) Creates an import course list values extractor- Parameters:
element
- the DOM element containing the XML valuesfactory
- the values extractor factorycomponent
- the import CDM-fr componentcontext
- the import contextadditionalDataGetter
- the getter that retrieves needed additional data by typesmodels
- the model of the extracted values
-
ImportCourseListValuesExtractor
public ImportCourseListValuesExtractor(Element element, ImportCDMFrValuesExtractorFactory factory, ImportCDMFrComponent component, ImportCDMFrContext context, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, Collection<? extends ModelItemContainer> modelItemContainers) Creates an import course list values extractor- Parameters:
element
- the DOM element containing the XML valuesfactory
- the values extractor factorycomponent
- the import CDM-fr componentcontext
- the imported content's contextadditionalDataGetter
- the getter that retrieves needed additional data by typesmodelItemContainers
- the model of the extracted values
-
-
Method Details
-
_fillViewItemContainerFromXML
protected void _fillViewItemContainerFromXML(Element element, ViewItemContainer viewItemContainer, Collection<? extends ModelItemContainer> modelItemContainers) throws Exception Description copied from class:ModelAwareXMLValuesExtractor
Fill the given view item container with the data found in the given element.- Overrides:
_fillViewItemContainerFromXML
in classModelAwareXMLValuesExtractor
- Parameters:
element
- The DOM element containing the valuesviewItemContainer
- The view item container to fillmodelItemContainers
- The model items containing the items that could be in the element- Throws:
Exception
- if an error occurs
-
_hasChildForAttribute
Description copied from class:ModelAwareXMLValuesExtractor
Checks if the given element contains a child for the given attribute name- Overrides:
_hasChildForAttribute
in classModelAwareXMLValuesExtractor
- Parameters:
element
- the element to checkattributeName
- the name of the attribute to search- Returns:
true
if the element contains a child corresponding to the given attribute name,false
otherwise
-
_extractElementValue
protected <T> Object _extractElementValue(Element parent, ElementDefinition<T> definition, Optional<Object> additionalData) throws Exception Description copied from class:ModelAwareXMLValuesExtractor
Extracts the value of the given element- Overrides:
_extractElementValue
in classImportCDMFrValuesExtractor
- Type Parameters:
T
- type of the element definition- Parameters:
parent
- the DOM element of the element definition's parentdefinition
- the element's definitionadditionalData
- the additional data needed to extract the value- Returns:
- the value
- Throws:
Exception
- if an error occurs
-