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
public class CSVImporter extends AbstractLogEnabled implements Component, Serviceable
Import contents from an uploaded CSV file.
-
-
Constructor Summary
Constructors Constructor Description CSVImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
importContentsFromCSV(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
-
-
-
-
Constructor Detail
-
CSVImporter
public CSVImporter()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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 IOException
Extract 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
-
-