Class MediaManager

  • All Implemented Interfaces:
    IMediaManager

    public class MediaManager
    extends java.lang.Object
    implements IMediaManager
    Media manager implementation.
    Since:
    7.0.0
    Version:
    $Revision$ $Date$
    • Constructor Summary

      Constructors 
      Constructor Description
      MediaManager()  
    • Method Summary

      All Methods Instance Methods Concrete 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.Set<java.lang.String> getMediaPublishToPrincipals​(java.lang.String parentFolderId)
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaManager

        public MediaManager()
    • Method Detail

      • getFromFileId

        public Media getFromFileId​(java.lang.String fileId)
                            throws PortalException
        Description copied from interface: IMediaManager
        Returns the MediaConfig for given file identifier.
        Specified by:
        getFromFileId in interface IMediaManager
        Parameters:
        fileId - the file identifier.
        Returns:
        the MediaConfig for given file identifier.
        Throws:
        PortalException
      • getFolderIdsByParentAndName

        public java.util.Collection<java.lang.String> getFolderIdsByParentAndName​(java.lang.String serviceInstanceId,
                                                                                  java.lang.String parentFolderId,
                                                                                  java.lang.String folderName)
                                                                           throws PortalException
        Description copied from interface: IMediaManager
        Returns the ids of the folders child of the given parent and with the given name.
        Specified by:
        getFolderIdsByParentAndName in interface IMediaManager
        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
      • getFolderPath

        public java.lang.String getFolderPath​(java.lang.String folderId)
                                       throws PortalException
        Description copied from interface: IMediaManager
        Returns the virtual path to the folder.
        Specified by:
        getFolderPath in interface IMediaManager
        Parameters:
        folderId - the id of the folder.
        Returns:
        the virtual path to the folder.
        Throws:
        PortalException
      • moveMedia

        public void moveMedia​(java.lang.String mediaId,
                              java.lang.String destFolderId)
                       throws PortalException
        Description copied from interface: IMediaManager
        Moves a media (or a folder) to another folder.
        Specified by:
        moveMedia in interface IMediaManager
        Parameters:
        mediaId - the media's id.
        destFolderId - the id of the destination folder.
        Throws:
        PortalException
      • updateMediaHierarchyPublishTo

        public void updateMediaHierarchyPublishTo​(java.lang.String mediaId,
                                                  java.util.Collection<java.lang.String> heritagePrincipalsId)
                                           throws PortalException
        Description copied from interface: IMediaManager

        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.

        Specified by:
        updateMediaHierarchyPublishTo in interface IMediaManager
        Parameters:
        mediaId - The media identifier to update
        heritagePrincipalsId - The list of principals to set.
        Throws:
        PortalException