Interface IMediaManager

  • All Known Implementing Classes:
    MediaManager

    public interface IMediaManager
    Provides media management operations.
    Since:
    7.0.0
    Version:
    $Revision: 24143 $ $Date: 2020-09-14 19:21:23 -0300 (Mon, 14 Sep 2020) $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE_ALL  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Media get​(java.lang.String mediaId)
      Returns the MediaConfig for a media with the given id.
      java.util.Collection<Media> getChildren​(java.lang.String serviceInstanceId, java.lang.String folderId, int type)
      Returns the entries in the specified folder.
      java.util.Collection<java.lang.String> getFolderIdsByParentAndName​(java.lang.String serviceInstanceId, java.lang.String parentFolderId, java.lang.String folderName)
      Returns the ids of the folders child of the given parent and with the given name.
      java.lang.String getFolderPath​(java.lang.String folderId)
      Returns the virtual path to the folder.
      Media getFromFileId​(java.lang.String fileId)
      Returns the MediaConfig for given file identifier.
      java.util.Collection<java.lang.String> getMediaPublishToPrincipals​(java.lang.String mediaId)
      Return a the list of principals for which the media is published to.
      void moveMedia​(java.lang.String mediaId, java.lang.String destFolderId)
      Moves a media (or a folder) to another folder.
      void updateMediaHierarchyPublishTo​(java.lang.String mediaId, java.util.Collection<java.lang.String> heritagePrincipalsId)
      Update the list of principals the media is published to
    • Method Detail

      • get

        Media get​(java.lang.String mediaId)
           throws PortalException
        Returns the MediaConfig for a media with the given id.
        Parameters:
        mediaId - the id of the media.
        Returns:
        the media.
        Throws:
        PortalException
      • getFolderIdsByParentAndName

        java.util.Collection<java.lang.String> getFolderIdsByParentAndName​(java.lang.String serviceInstanceId,
                                                                           java.lang.String parentFolderId,
                                                                           java.lang.String folderName)
                                                                    throws PortalException
        Returns the ids of the folders child of the given parent and with the given name.
        Parameters:
        serviceInstanceId - the media service instance id.
        parentFolderId - the parent folder's id. Null if the folder must not have parent.
        folderName - the folder name.
        Returns:
        Throws:
        PortalException
      • getChildren

        java.util.Collection<Media> getChildren​(java.lang.String serviceInstanceId,
                                                java.lang.String folderId,
                                                int type)
                                         throws PortalException
        Returns the entries in the specified folder.
        Parameters:
        serviceInstanceId - the media service instance id.
        folderId - the id of the folder.
        type - the entry types to be returned. Must be Media.TYPE_FOLDER, Media.TYPE_MEDIA or TYPE_ALL.
        Returns:
        the entries in the specified folder, or an empty collection if none is found.
        Throws:
        PortalException
      • getFolderPath

        java.lang.String getFolderPath​(java.lang.String folderId)
                                throws PortalException
        Returns the virtual path to the folder.
        Parameters:
        folderId - the id of the folder.
        Returns:
        the virtual path to the folder.
        Throws:
        PortalException
      • moveMedia

        void moveMedia​(java.lang.String mediaId,
                       java.lang.String destFolderId)
                throws PortalException
        Moves a media (or a folder) to another folder.
        Parameters:
        mediaId - the media's id.
        destFolderId - the id of the destination folder.
        Throws:
        PortalException
      • updateMediaHierarchyPublishTo

        void updateMediaHierarchyPublishTo​(java.lang.String mediaId,
                                           java.util.Collection<java.lang.String> heritagePrincipalsId)
                                    throws PortalException

        Update the list of principals the media is published to

        When the media type is a folder, the entire file tree inside it will also be updated taking into account their inheritance.

        Parameters:
        mediaId - The media identifier to update
        heritagePrincipalsId - The list of principals to set.
        Throws:
        PortalException
        Since:
        10.1.0
      • getMediaPublishToPrincipals

        java.util.Collection<java.lang.String> getMediaPublishToPrincipals​(java.lang.String mediaId)
                                                                    throws PortalException
        Return a the list of principals for which the media is published to.
        Parameters:
        mediaId - The media identifier
        Returns:
        A list containing the identifier of all principals.
        Throws:
        PortalException
        Since:
        10.1.0
      • getFromFileId

        Media getFromFileId​(java.lang.String fileId)
                     throws PortalException
        Returns the MediaConfig for given file identifier.
        Parameters:
        fileId - the file identifier.
        Returns:
        the MediaConfig for given file identifier.
        Throws:
        PortalException
        Since:
        12.5.0