Package org.ametys.plugins.contentio.csv
Class ImportCSVFileAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.contentio.csv.ImportCSVFileAction
-
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
public class ImportCSVFileAction extends ServiceableAction
Import contents from an uploaded CSV file.
-
-
Field Summary
Fields Modifier and Type Field Description private static String[]_ALLOWED_EXTENSIONSprivate ContentTypeExtensionPoint_contentTypeEPprivate WorkflowProvider_workflowProviderprivate static StringCONTENTIO_STORAGE_DIRECTORY-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description ImportCSVFileAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_copyFile(Path path)private String[]_extractHeaders(File uploadedFile, Request request, Charset charset)private CsvPreference_getCSVPreference(Request request)private List<Map<String,Object>>_getWorkflows()getWorkflowsMapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)voidservice(ServiceManager serviceManager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_ALLOWED_EXTENSIONS
private static final String[] _ALLOWED_EXTENSIONS
-
CONTENTIO_STORAGE_DIRECTORY
private static final String CONTENTIO_STORAGE_DIRECTORY
- See Also:
- Constant Field Values
-
_contentTypeEP
private ContentTypeExtensionPoint _contentTypeEP
-
_workflowProvider
private WorkflowProvider _workflowProvider
-
-
Constructor Detail
-
ImportCSVFileAction
public ImportCSVFileAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
_copyFile
private String _copyFile(Path path) throws IOException
- Throws:
IOException
-
_getCSVPreference
private CsvPreference _getCSVPreference(Request request)
-
_extractHeaders
private String[] _extractHeaders(File uploadedFile, Request request, Charset charset) throws IOException
- Throws:
IOException
-
_getWorkflows
private List<Map<String,Object>> _getWorkflows()
getWorkflows- Returns:
- map of workflows
-
-