Package org.ametys.plugins.contentio.csv
Class CSVImporter
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.csv.CSVImporter
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Import contents from an uploaded CSV file.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionimportContentsFromCSV
(Map<String, Object> mapping, View view, ContentType contentType, ICsvListReader listReader, int createAction, int editAction, String workflowName, String language) Extract contents from CSV filevoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
RESULT_CONTENT_IDS
Result key containing updated content's ids- See Also:
-
RESULT_NB_ERRORS
Result key containing number of errors- See Also:
-
RESULT_NB_WARNINGS
Result key containing number of warnings- See Also:
-
-
Constructor Details
-
CSVImporter
public CSVImporter()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
importContentsFromCSV
public Map<String,Object> importContentsFromCSV(Map<String, Object> mapping, View view, ContentType contentType, ICsvListReader listReader, int createAction, int editAction, String workflowName, String language) throws IOExceptionExtract contents from CSV file- Parameters:
mapping
- mapping of content attributes and CSV file headerview
- View of importing contentcontentType
- content type to importlistReader
- mapReader to parse CSV filecreateAction
- creation action ideditAction
- edition action idworkflowName
- workflow namelanguage
- language of created content.- Returns:
- list of created contents
- Throws:
IOException
- IOException while reading CSV
-