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, ...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]
getMimeTypes()
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 Detail
-
importContent
void importContent(File file, ModifiableWebContent content, Map<String,String> params) throws IOException
Extracts 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
void postTreatment(ModifiablePage page, Content content, File file) throws IOException
Post treatment after import process- Parameters:
page
- The created pagecontent
- The created contentfile
- The imported file- Throws:
IOException
- if an error occurred
-
-