Package lumis.service.media
Class MediaManager
- java.lang.Object
-
- lumis.service.media.MediaManager
-
- All Implemented Interfaces:
IMediaManager
public class MediaManager extends java.lang.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(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 themedia
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 themedia
is published to
-
-
-
Method Detail
-
get
public Media get(java.lang.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(java.lang.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 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 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 java.util.Collection<Media> getChildren(java.lang.String serviceInstanceId, java.lang.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 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 interfaceIMediaManager
- 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 interfaceIMediaManager
- 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 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 java.util.Set<java.lang.String> getMediaPublishToPrincipals(java.lang.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
-
-