Interface MediaFacade

All Known Implementing Classes:
DefaultMediaFacade

public interface MediaFacade
Facade for managing Media.
  • Method Details

    • getMediaByCode

      @Deprecated(since="1905", forRemoval=true) MediaData getMediaByCode(String code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 1905, please use getMediaByUUID(String) instead
      Get a media DTO by code.
      Parameters:
      code - - the code to search for
      Returns:
      the media
      Throws:
      MediaNotFoundException - when the media cannot be found
    • getMediaByUUID

      MediaData getMediaByUUID(String uuid)
      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

      List<MediaData> getMediaByUUIDs(List<String> uuids)
      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

      List<MediaData> getMediaByNamedQuery(NamedQueryData namedQuery)
      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

      MediaData addMedia(MediaData media, MediaFileDto mediaFile)
      Create a media item from an InputStream.
      Parameters:
      media - - the attributes required to create a new media item
      mediaFile - - the actual file and an InputStream and its properties
      Returns:
      the newly created media
      Throws:
      ValidationException - when the input contains validation errors
      ConversionException - when unable to convert the DTOs to a hybris model
    • addMediaToFolder

      default MediaData addMediaToFolder(MediaData media, MediaFileDto mediaFile, String folder)
      Create a media item from an InputStream.
      Parameters:
      media - - the attributes required to create a new media item
      mediaFile - - the actual file and an InputStream and its properties
      folder - - the folder that media will be upload to
      Returns:
      the newly created media
      Throws:
      ValidationException - when the input contains validation errors
      ConversionException - when unable to convert the DTOs to a hybris model
    • findMedias

      default SearchResult<MediaData> findMedias(String mask, String mimeType, PageableData pageableData)
      Finds medias using a free-text form. It also supports pagination.
      Parameters:
      mask - The free-text string to be used on the media search
      mimeType - The mime type to be used on the media search
      pageableData - the pagination object
      Returns:
      the search result object.