Package lumis.service.media
Class MediaManager
- java.lang.Object
-
- lumis.service.media.MediaManager
-
- All Implemented Interfaces:
IMediaManager
public class MediaManager extends Object implements IMediaManager
Media manager implementation.- Since:
- 7.0.0
- Version:
- $Revision: 24079 $ $Date: 2020-08-24 18:37:36 -0300 (Mon, 24 Aug 2020) $
-
-
Field Summary
-
Fields inherited from interface lumis.service.media.IMediaManager
TYPE_ALL
-
-
Constructor Summary
Constructors Constructor Description MediaManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Media
get(String mediaId)
Returns the MediaConfig for a media with the given id.Collection<Media>
getChildren(String serviceInstanceId, String folderId, int type)
Returns the entries in the specified folder.Collection<String>
getFolderIdsByParentAndName(String serviceInstanceId, String parentFolderId, String folderName)
Returns the ids of the folders child of the given parent and with the given name.String
getFolderPath(String folderId)
Returns the virtual path to the folder.Media
getFromFileId(String fileId)
Returns the MediaConfig for given file identifier.Set<String>
getMediaPublishToPrincipals(String parentFolderId)
Return a the list of principals for which themedia
is published to.void
moveMedia(String mediaId, String destFolderId)
Moves a media (or a folder) to another folder.void
updateMediaHierarchyPublishTo(String mediaId, Collection<String> heritagePrincipalsId)
Update the list of principals themedia
is published to
-
-
-
Method Detail
-
get
public Media get(String mediaId) throws PortalException
Description copied from interface:IMediaManager
Returns the MediaConfig for a media with the given id.- Specified by:
get
in interfaceIMediaManager
- Parameters:
mediaId
- the id of the media.- Returns:
- the media.
- Throws:
PortalException
-
getFromFileId
public Media getFromFileId(String fileId) throws PortalException
Description copied from interface:IMediaManager
Returns the MediaConfig for given file identifier.- Specified by:
getFromFileId
in interfaceIMediaManager
- Parameters:
fileId
- the file identifier.- Returns:
- the MediaConfig for given file identifier.
- Throws:
PortalException
-
getFolderIdsByParentAndName
public Collection<String> getFolderIdsByParentAndName(String serviceInstanceId, String parentFolderId, 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 interfaceIMediaManager
- 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
public Collection<Media> getChildren(String serviceInstanceId, String folderId, int type) throws PortalException
Description copied from interface:IMediaManager
Returns the entries in the specified folder.- Specified by:
getChildren
in interfaceIMediaManager
- Parameters:
serviceInstanceId
- the media service instance id.folderId
- the id of the folder.type
- the entry types to be returned. Must beMedia.TYPE_FOLDER
,Media.TYPE_MEDIA
orIMediaManager.TYPE_ALL
.- Returns:
- the entries in the specified folder, or an empty collection if none is found.
- Throws:
PortalException
-
getFolderPath
public String getFolderPath(String folderId) throws PortalException
Description copied from interface:IMediaManager
Returns the virtual path to the folder.- Specified by:
getFolderPath
in interfaceIMediaManager
- Parameters:
folderId
- the id of the folder.- Returns:
- the virtual path to the folder.
- Throws:
PortalException
-
moveMedia
public void moveMedia(String mediaId, String destFolderId) throws PortalException
Description copied from interface:IMediaManager
Moves a media (or a folder) to another folder.- Specified by:
moveMedia
in interfaceIMediaManager
- Parameters:
mediaId
- the media's id.destFolderId
- the id of the destination folder.- Throws:
PortalException
-
updateMediaHierarchyPublishTo
public void updateMediaHierarchyPublishTo(String mediaId, Collection<String> heritagePrincipalsId) throws PortalException
Description copied from interface:IMediaManager
Update the list of principals the
media
is published toWhen the
media
type is afolder
, the entire file tree inside it will also be updated taking into account theirinheritance
.- Specified by:
updateMediaHierarchyPublishTo
in interfaceIMediaManager
- Parameters:
mediaId
- Themedia identifier
to updateheritagePrincipalsId
- The list of principals to set.- Throws:
PortalException
-
getMediaPublishToPrincipals
public Set<String> getMediaPublishToPrincipals(String parentFolderId) throws PortalException
Description copied from interface:IMediaManager
Return a the list of principals for which themedia
is published to.- Specified by:
getMediaPublishToPrincipals
in interfaceIMediaManager
- Parameters:
parentFolderId
- Themedia identifier
- Returns:
- A list containing the identifier of all principals.
- Throws:
PortalException
-
-