Package org.ametys.plugins.webcontentio
Interface ContentImporter
- All Known Implementing Classes:
DocxContentImporter
,XmlContentImporter
public interface ContentImporter
Component responsible for populating a Content from an existing file.
Contents are meant to be provided totally empty, so that it is up to the implementation to set every metadata on the Content, even the content type, the workflow id, ...
Contents are meant to be provided totally empty, so that it is up to the implementation to set every metadata on the Content, even the content type, the workflow id, ...
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns all mime types handled by this importer.void
importContent
(File file, ModifiableWebContent content, Map<String, String> params) Extracts file content and populates the givenContent
.void
postTreatment
(ModifiablePage page, Content content, File file) Post treatment after import process
-
Method Details
-
importContent
void importContent(File file, ModifiableWebContent content, Map<String, String> params) throws IOExceptionExtracts file content and populates the givenContent
. Typical usage is to provide a newly created empty Content.- Parameters:
file
- the source.content
- theContent
to be populated.params
- in/out params to set and get additional data to and from the importer.- Throws:
IOException
- if an error occurs processing the stream.
-
getMimeTypes
String[] getMimeTypes()Returns all mime types handled by this importer.- Returns:
- all mime types handled by this importer.
-
postTreatment
Post treatment after import process- Parameters:
page
- The created pagecontent
- The created contentfile
- The imported file- Throws:
IOException
- if an error occurred
-