Interface ConvertedMediaCreationStrategy
-
- All Known Implementing Classes:
DefaultConvertedMediaCreationStrategy
public interface ConvertedMediaCreationStrategyStrategy to create a media model, (optionally) used by aMediaConversionStrategyto make the media creation configurable.The complete context is passed after successful conversion and must be set accordingly on the newly created media.
It is also the responsibility of this strategy to actually save the new model (
ModelService.save(Object)) and to store the media's data (MediaService.setStreamForMedia(MediaModel, InputStream)).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MediaModelcreateOrUpdate(MediaModel parent, ConversionMediaFormatModel format, java.io.InputStream content)Creates a new media which was converted from the givenparentby successful conversion to the givenformator updates the corresponding media if it already exists.
-
-
-
Method Detail
-
createOrUpdate
MediaModel createOrUpdate(MediaModel parent, ConversionMediaFormatModel format, java.io.InputStream content) throws MediaIOException
Creates a new media which was converted from the givenparentby successful conversion to the givenformator updates the corresponding media if it already exists. The passedInputStreamcontentmust be used to load the media's data.The
MediaServiceis passed to avoid circular dependencies.- Parameters:
parent- the media the to-be-created media was converted from. This model should be set as the newly created media's parent.format- the format of the to-be-created media. This object should be set as the newly created media's format.content-InputStreamholding the converted content.- Returns:
- a new
MediaModel - Throws:
MediaIOException- on any technical error when loading the contents
-
-