Package org.ametys.odf.skill.imports.csv
Class ImportSkillsCSVFileHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.csv.ImportCSVFileHelper
org.ametys.odf.skill.imports.csv.ImportSkillsCSVFileHelper
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
Import skills from an uploaded CSV file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The micro skill catalog attribute pathstatic final String
The macro skill catalog attribute pathstatic final String
The skill parent program attribute pathFields inherited from class org.ametys.plugins.contentio.csv.ImportCSVFileHelper
_csvImporter, _resolver, CONFIG_PARENT_ID, MAPPING_COLUMN_ATTRIBUTE_PATH, MAPPING_COLUMN_HEADER, MAPPING_COLUMN_IS_ID, NESTED_MAPPING_ID, NESTED_MAPPING_VALUES, RESULT_ERROR, RESULT_FILENAME, RESULT_IMPORTED_COUNT, RESULT_NB_ERRORS, RESULT_NB_WARNINGS, ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.ametys.plugins.contentio.csv.ImportCSVFileHelper
deleteFile, detectCharset, extractHeaders, getImportCSVParametersValues, getMapping, importContents, initialize, validateConfiguration
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
SKILL_CATALOG_ATTRIBUTE_PATH
The macro skill catalog attribute path- See Also:
-
SKILL_PARENT_PROGRAM_ATTRIBUTE_PATH
The skill parent program attribute path- See Also:
-
MICROSKILL_CATALOG_ATTRIBUTE_PATH
The micro skill catalog attribute path- See Also:
-
-
Constructor Details
-
ImportSkillsCSVFileHelper
public ImportSkillsCSVFileHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classImportCSVFileHelper
- Throws:
ServiceException
-
importContents
public Map<String,Object> importContents(Map<String, Object> config, Map<String, throws IOExceptionObject> formValues, List<Map<String, Object>> mappingValues) Import contents from path, content type and language.- Overrides:
importContents
in classImportCSVFileHelper
- Parameters:
config
- get all CSV related parameters: path, separating/escaping char, charset and contentTypeformValues
- map of form valuesmappingValues
- list of header and content attribute mapping- Returns:
- A map containing information about what is needed to create/edit a collection of synchronizable contents
- Throws:
IOException
- IOException while reading CSV
-