Interface MediaFacade
- All Known Implementing Classes:
DefaultMediaFacade
public interface MediaFacade
Facade for managing Media.
-
Method Summary
Modifier and TypeMethodDescriptionaddMedia(MediaData media, MediaFileDto mediaFile) Create a media item from anInputStream.default MediaDataaddMediaToFolder(MediaData media, MediaFileDto mediaFile, String folder) Create a media item from anInputStream.default SearchResult<MediaData>findMedias(String mask, String mimeType, PageableData pageableData) Finds medias using a free-text form.getMediaByCode(String code) Deprecated, for removal: This API element is subject to removal in a future version.getMediaByNamedQuery(NamedQueryData namedQuery) Search for a single page of media using a named query.getMediaByUUID(String uuid) Get a media DTO by uuid.getMediaByUUIDs(List<String> uuids) Get a list of media DTO by their universally unique identifiers (uuids).
-
Method Details
-
getMediaByCode
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please usegetMediaByUUID(String)insteadGet a media DTO by code.- Parameters:
code- - the code to search for- Returns:
- the media
- Throws:
MediaNotFoundException- when the media cannot be found
-
getMediaByUUID
Get a media DTO by uuid.- Parameters:
uuid- - the uuid to search for- Returns:
- the media
- Throws:
MediaNotFoundException- when the media cannot be found
-
getMediaByUUIDs
Get a list of media DTO by their universally unique identifiers (uuids).- Parameters:
uuids- - the list of uuids of the media to search for- Returns:
- list of media
- Throws:
MediaNotFoundException- when one of the media cannot be found
-
getMediaByNamedQuery
Search for a single page of media using a named query.- Parameters:
namedQuery- - the named query- Returns:
- the list of search results or empty collection
- Throws:
ValidationException- when the input contains validation errors
-
addMedia
Create a media item from anInputStream.- Parameters:
media- - the attributes required to create a new media itemmediaFile- - the actual file and anInputStreamand its properties- Returns:
- the newly created media
- Throws:
ValidationException- when the input contains validation errorsConversionException- when unable to convert the DTOs to a hybris model
-
addMediaToFolder
Create a media item from anInputStream.- Parameters:
media- - the attributes required to create a new media itemmediaFile- - the actual file and anInputStreamand its propertiesfolder- - the folder that media will be upload to- Returns:
- the newly created media
- Throws:
ValidationException- when the input contains validation errorsConversionException- when unable to convert the DTOs to a hybris model
-
findMedias
Finds medias using a free-text form. It also supports pagination.- Parameters:
mask- The free-text string to be used on the media searchmimeType- The mime type to be used on the media searchpageableData- the pagination object- Returns:
- the search result object.
-
getMediaByUUID(String)instead