Package de.hybris.platform.jalo.media
Class MediaManager
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.media.MediaManager
-
- All Implemented Interfaces:
ItemLifecycleListener,java.io.Serializable
public class MediaManager extends Manager
The manager for media items.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMediaManager.InputStreamWithSizeprotected static classMediaManager.MediaManagerSerializableDTO-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAMEIdentifier of this manager used at core-spring.xml spring configuration.static java.lang.StringMEDIACONTAINERDeprecated.since ages - use CoreConstants.TC.MEDIACONTAINER insteadstatic java.lang.StringMEDIACONTEXTDeprecated.since ages - use CoreConstants.TC.MEDIACONTEXT insteadstatic java.lang.StringMEDIAFOLDERDeprecated.since ages - use CoreConstants.TC.MEDIAFOLDER insteadstatic java.lang.StringMEDIAFORMATDeprecated.since ages - use CoreConstants.TC.MEDIAFORMAT insteadstatic java.lang.StringMEDIAFORMATMAPPINGDeprecated.since ages - use CoreConstants.TC.MEDIAFORMATMAPPING insteadstatic java.lang.StringMEDIAFORMATTERDeprecated.since ages - use CommonsConstants.TC.MEDIAFORMATTER insteadstatic java.lang.StringPREFERRED_URL_STRATEGY_IDstatic java.lang.StringROOT_FOLDER_QUALIFIERIdentifier of the root media folder created at system initialization.
-
Constructor Summary
Constructors Constructor Description MediaManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcheckBeforeItemRemoval(SessionContext ctx, Item item)Superclass method overridden to avoid call to EJB layer.MediacreateMedia(PK pk, java.lang.String code)Creates a new media item.MediacreateMedia(PK pkBase, java.lang.String code, ComposedType type)Creates a new media item with a specific type.MediacreateMedia(java.lang.String code)Creates a new media item.MediacreateMedia(java.lang.String code, MediaFormat format)Creates a new media with given code and format.MediacreateMedia(java.lang.String code, ComposedType type)Creates a new media item with a specific type.MediaContainercreateMediaContainer(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new container with given parameters.MediaContainercreateMediaContainer(java.lang.String qualifier)Creates a new container with given qualifier.MediaContainercreateMediaContainer(java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new container with given parameters.MediaContextcreateMediaContext(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new context with given parameters.MediaContextcreateMediaContext(java.lang.String qualifier)Creates a new context with given qualifier.MediaContextcreateMediaContext(java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new context with given parameters.MediaFoldercreateMediaFolder(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new folder with given parameters.MediaFoldercreateMediaFolder(java.lang.String qualifier, java.lang.String path)Creates a new folder with given qualifier and path.MediaFoldercreateMediaFolder(java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new folder with given parameters.MediaFormatcreateMediaFormat(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new format with given parameters.MediaFormatcreateMediaFormat(java.lang.String qualifier)Creates a new format with given qualifier.MediaFormatcreateMediaFormat(java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new format with given parameters.MediaFormatMappingcreateMediaFormatMapping(MediaFormat source, MediaFormat target)Creates a new mapping with given source and target format.MediaFormatMappingcreateMediaFormatMapping(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new mapping with given parameters.MediaFormatMappingcreateMediaFormatMapping(java.util.Map<java.lang.String,java.lang.Object> attributeValues)Creates a new mapping with given parameters.protected MediaSourcecreateMediaSource(AbstractMedia media)voiddeleteMedia(java.lang.String folderQualifier, java.lang.String location)Delete media.voiddeleteMediaDataUnlessReferenced(PK mediaPk, java.lang.Long dataPk, java.lang.String folderQualifier, java.lang.String location)This method deletes media data unless it is referenced by another media object.java.util.CollectiongetAllMedia()Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get ade.hybris.platform.core.model.media.MediaModels instances.java.util.List<MediaContext>getAllMediaContexts()Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get aMediaContexts instances.java.util.Collection<MediaFolder>getAllMediaFolders()Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get aMediaFolderModels instances.java.util.CollectiongetAllMedias()Deprecated.since 'medias' is incorrect term.java.lang.StringgetBestMime(java.lang.String filePath)Gets the best mime for provided media file path.java.lang.StringgetBestMime(java.lang.String fileName, byte[] firstBytes, java.lang.String overrideMime)Gets the best mime.java.lang.StringgetDownloadURLForMedia(java.lang.String folderQualifier, MediaSource mediaSource)java.lang.StringgetFileExtensionFromMime(java.lang.String mime)Gets the file extension from mime.static MediaManagergetInstance()Gets the instance of this manager.byte[]getMediaAsByteArray(java.lang.String folderQualifier, java.lang.String location)java.io.FilegetMediaAsFile(java.lang.String folderQualifier, java.lang.String location)This method try to return media data asFile.java.io.InputStreamgetMediaAsStream(MediaSource mediaSource)Gets media as stream.java.io.InputStreamgetMediaAsStream(java.lang.String folderQualifier, java.lang.String location)Gets the media as stream.MediaManager.InputStreamWithSizegetMediaAsStreamWithSize(java.lang.String folderQualifier, java.lang.String location)Gets the media as stream with its size.java.util.CollectiongetMediaByCode(java.lang.String searchString)Finds all media which code matches the specified search pattern.java.util.CollectiongetMediaByMimeType(java.lang.String mimePattern)Finds all media whose mime type matches the given pattern.java.util.CollectiongetMediaByURL(java.lang.String urlPattern)Deprecated.since agesjava.util.CollectiongetMediaByURLExact(java.lang.String url)Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get ade.hybris.platform.core.model.media.MediaModels instances for a specifiedde.hybris.platform.core.model.media.MediaModel.CODE.java.util.Collection<MediaFolder>getMediaFolderByQualifier(java.lang.String searchString)Finds all folders whose qualifier matches the specified search pattern.MediaFormatgetMediaFormatByQualifier(java.lang.String qualifier)Gets first media format matching given qualifier.MediaHeadersRegistrygetMediaHeadersRegistry()java.util.CollectiongetMediasByCode(java.lang.String searchString)Deprecated.since 'medias' is incorrect termjava.util.CollectiongetMediasByMimeType(java.lang.String mimePattern)Deprecated.since 'medias' is incorrect termMediaStorageRegistrygetMediaStorageFactory()protected java.lang.StringgetMediaTypeCode()Gets the code of the media type.java.lang.StringgetMimeTypeByExtension(java.lang.String fileExtension)Returns the MimeType for the given fileextension.MediaFoldergetOrCreateRootMediaFolder()Gets the or create root media folder.MediaFoldergetRootMediaFolder()Deprecated.since ages - useMediaService.getRootFolder()insteadjava.lang.StringgetURLForMedia(java.lang.String folderQualifier, MediaSource mediaSource)booleanhasData(MediaSource mediaSource)booleanhasForeignDataOwners(PK mediaPk, java.lang.Long dataPk)voidinitializeMediaStorage(boolean freshInit)Executes any configured media storage initializer on initialization process.booleanisFolderConfiguredAsSecured(java.lang.String folderQualifier)booleanisPathTargetSecuredFolder(java.lang.String folderQualifier, java.lang.String location)booleanisSecuredFolder(java.lang.String folderQualifier)booleanisZipRelatedMime(java.lang.String mime)protected voidnotifyItemRemoval(SessionContext ctx, Item item)Superclass method overridden to avoid call to EJB layer.voidsetLocalMediaFileCache(LocalMediaFileCacheService localMediaFileCache)voidsetLocationHashService(MediaLocationHashService locationHashService)voidsetMediaHeadersRegistry(MediaHeadersRegistry mediaHeadersRegistry)voidsetMediaStorageConfigService(MediaStorageConfigService mediaStorageConfig)voidsetMediaStorageRegistry(MediaStorageRegistry mediaStorageRegistry)voidsetMimeService(MimeService mimeService)StoredMediaDatastoreMedia(MediaDataStoreCommand command)Store media.voidverifyMediaHashForLocation(java.lang.String folderQualifier, java.lang.String location, java.lang.String storedHash)java.lang.ObjectwriteReplace()-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Field Detail
-
BEAN_NAME
public static final java.lang.String BEAN_NAME
Identifier of this manager used at core-spring.xml spring configuration.- See Also:
- Constant Field Values
-
MEDIAFOLDER
@Deprecated public static final java.lang.String MEDIAFOLDER
Deprecated.since ages - use CoreConstants.TC.MEDIAFOLDER insteadConstant identifier forMediaFoldertype.
-
MEDIACONTAINER
@Deprecated public static final java.lang.String MEDIACONTAINER
Deprecated.since ages - use CoreConstants.TC.MEDIACONTAINER insteadConstant identifier forMediaContainertype.
-
MEDIACONTEXT
@Deprecated public static final java.lang.String MEDIACONTEXT
Deprecated.since ages - use CoreConstants.TC.MEDIACONTEXT insteadConstant identifier forMediaContexttype.
-
MEDIAFORMAT
@Deprecated public static final java.lang.String MEDIAFORMAT
Deprecated.since ages - use CoreConstants.TC.MEDIAFORMAT insteadConstant identifier forMediaFormattype.
-
MEDIAFORMATMAPPING
@Deprecated public static final java.lang.String MEDIAFORMATMAPPING
Deprecated.since ages - use CoreConstants.TC.MEDIAFORMATMAPPING insteadConstant identifier forMediaFormatMappingtype.
-
MEDIAFORMATTER
@Deprecated public static final java.lang.String MEDIAFORMATTER
Deprecated.since ages - use CommonsConstants.TC.MEDIAFORMATTER insteadConstant identifier forMediaFormattertype.
-
ROOT_FOLDER_QUALIFIER
public static final java.lang.String ROOT_FOLDER_QUALIFIER
Identifier of the root media folder created at system initialization.- See Also:
- Constant Field Values
-
PREFERRED_URL_STRATEGY_ID
public static final java.lang.String PREFERRED_URL_STRATEGY_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
setMimeService
public void setMimeService(MimeService mimeService)
-
setMediaHeadersRegistry
public void setMediaHeadersRegistry(MediaHeadersRegistry mediaHeadersRegistry)
-
setLocalMediaFileCache
public void setLocalMediaFileCache(LocalMediaFileCacheService localMediaFileCache)
-
setMediaStorageConfigService
public void setMediaStorageConfigService(MediaStorageConfigService mediaStorageConfig)
-
setMediaStorageRegistry
public void setMediaStorageRegistry(MediaStorageRegistry mediaStorageRegistry)
-
setLocationHashService
public void setLocationHashService(MediaLocationHashService locationHashService)
-
getMediaStorageFactory
public MediaStorageRegistry getMediaStorageFactory()
-
getFileExtensionFromMime
public java.lang.String getFileExtensionFromMime(java.lang.String mime)
Gets the file extension from mime.
-
getBestMime
public java.lang.String getBestMime(java.lang.String fileName, byte[] firstBytes, java.lang.String overrideMime)Gets the best mime.
-
getBestMime
public java.lang.String getBestMime(java.lang.String filePath)
Gets the best mime for provided media file path.
-
hasForeignDataOwners
public boolean hasForeignDataOwners(PK mediaPk, java.lang.Long dataPk)
-
storeMedia
public StoredMediaData storeMedia(MediaDataStoreCommand command)
Store media.- Returns:
- the stored media data
-
deleteMedia
public void deleteMedia(java.lang.String folderQualifier, java.lang.String location)Delete media.- Parameters:
folderQualifier- the folder qualifierlocation- the location
-
deleteMediaDataUnlessReferenced
public void deleteMediaDataUnlessReferenced(PK mediaPk, java.lang.Long dataPk, java.lang.String folderQualifier, java.lang.String location)
This method deletes media data unless it is referenced by another media object. If current transaction is running deletion will be delayed just after success commit. If there is no running transaction delete operation will be executed immediately.- Parameters:
mediaPk- PK of the given media objectdataPk- Data PK of the given media objectfolderQualifier- Folder qualifier of the given media objectlocation- Location of media data in the storage
-
getMediaAsStreamWithSize
public MediaManager.InputStreamWithSize getMediaAsStreamWithSize(java.lang.String folderQualifier, java.lang.String location)
Gets the media as stream with its size.- Parameters:
folderQualifier- the folder qualifierlocation- the location- Returns:
- the
MediaManager.InputStreamWithSizeobject containing a stream with its size
-
getMediaAsStream
public java.io.InputStream getMediaAsStream(java.lang.String folderQualifier, java.lang.String location)Gets the media as stream.- Parameters:
folderQualifier- the folder qualifierlocation- the location- Returns:
- the media as stream
-
getMediaAsStream
public java.io.InputStream getMediaAsStream(MediaSource mediaSource)
Gets media as stream. This method returns stream for backed binary data if media has it or tries to get stream directly from its URL if it does not have real data.- Parameters:
mediaSource- Wrapper interface for the media object.- Returns:
- the media as stream
-
getMediaAsByteArray
public byte[] getMediaAsByteArray(java.lang.String folderQualifier, java.lang.String location) throws java.io.IOException- Throws:
java.io.IOException
-
hasData
public boolean hasData(MediaSource mediaSource)
-
getMediaHeadersRegistry
public MediaHeadersRegistry getMediaHeadersRegistry()
-
isZipRelatedMime
public boolean isZipRelatedMime(java.lang.String mime)
-
verifyMediaHashForLocation
public void verifyMediaHashForLocation(java.lang.String folderQualifier, java.lang.String location, java.lang.String storedHash)
-
isPathTargetSecuredFolder
public boolean isPathTargetSecuredFolder(java.lang.String folderQualifier, java.lang.String location)
-
isFolderConfiguredAsSecured
public boolean isFolderConfiguredAsSecured(java.lang.String folderQualifier)
-
getMediaAsFile
public java.io.File getMediaAsFile(java.lang.String folderQualifier, java.lang.String location)This method try to return media data asFile. It may throwUnsupportedOperationExceptionwhen underlyingMediaStorageStrategydoes not support it.- Parameters:
folderQualifier- the folder qualifierlocation- the location- Returns:
- the media as file
-
getURLForMedia
public java.lang.String getURLForMedia(java.lang.String folderQualifier, MediaSource mediaSource)
-
getDownloadURLForMedia
public java.lang.String getDownloadURLForMedia(java.lang.String folderQualifier, MediaSource mediaSource)
-
createMediaSource
protected MediaSource createMediaSource(AbstractMedia media)
-
initializeMediaStorage
public void initializeMediaStorage(boolean freshInit)
Executes any configured media storage initializer on initialization process.- Parameters:
freshInit- determines whether it is fresh init or update
-
isSecuredFolder
public boolean isSecuredFolder(java.lang.String folderQualifier)
-
getInstance
public static MediaManager getInstance()
Gets the instance of this manager.- Returns:
- instance of this manager
-
checkBeforeItemRemoval
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
Superclass method overridden to avoid call to EJB layer.- Overrides:
checkBeforeItemRemovalin classManager- Parameters:
ctx- the current session contextitem- the item which should be removed- Throws:
ConsistencyCheckException- thrown to abort removal due to consistency errors- Since:
- 2.10
-
notifyItemRemoval
protected void notifyItemRemoval(SessionContext ctx, Item item)
Superclass method overridden to avoid call to EJB layer.- Overrides:
notifyItemRemovalin classManager- Parameters:
ctx- the currency session contextitem- the item which is going to be removed- Since:
- 2.10
-
getMediaTypeCode
protected java.lang.String getMediaTypeCode()
Gets the code of the media type.- Returns:
- code of media type
-
createMedia
public Media createMedia(java.lang.String code)
Creates a new media item. By this time no URL is set and no data is available.- Parameters:
code- code of new media
-
createMedia
public Media createMedia(PK pk, java.lang.String code)
Creates a new media item. By this time no URL is set and no data is available.- Parameters:
pk- the pk for the new item; it will be equipped with type code additionally (- ) code- code of new media
-
createMedia
public Media createMedia(java.lang.String code, ComposedType type)
Creates a new media item with a specific type. By this time no URL is set and no data is available. Please note that this does not set any attribute declared by this type! UseComposedType.newInstance(Map)to achieve attribute checks.- Parameters:
code- the code of the new mediatype- the type of the new media
-
createMedia
public Media createMedia(PK pkBase, java.lang.String code, ComposedType type)
Creates a new media item with a specific type. By this time no URL is set and no data is available. Please note that this does not set any attribute declared by this type! UseComposedType.newInstance(Map)to achieve attribute checks.- Parameters:
pkBase- the pk for the new item; it will be equipped with type code additionally (- ) code- the code of the new mediatype- the type of the new media
-
getAllMedias
@Deprecated public java.util.Collection getAllMedias()
Deprecated.since 'medias' is incorrect term. Please usegetAllMedia()instead.Gets all media items.
-
getAllMedia
@Deprecated public java.util.Collection getAllMedia()
Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get ade.hybris.platform.core.model.media.MediaModels instances. See more at loading by exemplary model.Gets all media items.
-
getMediasByCode
@Deprecated public java.util.Collection getMediasByCode(java.lang.String searchString)
Deprecated.since 'medias' is incorrect termFinds all media which code matches the specified search pattern. Wildcards are '%' and '_' ( as in SQL LIKE statements ).- Parameters:
searchString- pattern used for searching
-
getMediaByCode
public java.util.Collection getMediaByCode(java.lang.String searchString)
Finds all media which code matches the specified search pattern. Wildcards are '%' and '_' ( as in SQL LIKE statements ).- Parameters:
searchString- pattern used for searching
-
getMediasByMimeType
@Deprecated public java.util.Collection getMediasByMimeType(java.lang.String mimePattern)
Deprecated.since 'medias' is incorrect termFinds all media whose mime type matches the given pattern.- Parameters:
mimePattern- a SQL pattern for the mime type- Returns:
- a collection of
Mediaobjects
-
getMediaByMimeType
public java.util.Collection getMediaByMimeType(java.lang.String mimePattern)
Finds all media whose mime type matches the given pattern.- Parameters:
mimePattern- a SQL pattern for the mime type- Returns:
- a collection of
Mediaobjects
-
getMediaByURL
@Deprecated public java.util.Collection getMediaByURL(java.lang.String urlPattern)
Deprecated.since agesFinds all media whose url matches the given pattern.- Parameters:
urlPattern- a SQL pattern for the url- Returns:
- a collection of
Mediaobjects
-
getMediaByURLExact
@Deprecated public java.util.Collection getMediaByURLExact(java.lang.String url)
Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get ade.hybris.platform.core.model.media.MediaModels instances for a specifiedde.hybris.platform.core.model.media.MediaModel.CODE. See more at loading by exemplary model.Finds a media for a given url.- Parameters:
url- the url media will be needed- Returns:
- all media matching given url
-
getMimeTypeByExtension
public java.lang.String getMimeTypeByExtension(java.lang.String fileExtension)
Returns the MimeType for the given fileextension. If the Extension is unknown the Binary-Mimetype will be returned.- Parameters:
fileExtension- Fileextension, no dot, allowed are Lower- and Uppercases.- Returns:
- Mimetypestring
-
createMediaFolder
public MediaFolder createMediaFolder(java.lang.String qualifier, java.lang.String path)
Creates a new folder with given qualifier and path.- Parameters:
qualifier- qualifier for new folderpath- path for new folder- Returns:
- created folder
- Since:
- 3.1-u4
-
createMediaFolder
public MediaFolder createMediaFolder(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new folder with given parameters.- Parameters:
attributeValues- parameters used for creation- Returns:
- created folder
- Since:
- 3.1-u4
-
createMediaFolder
public MediaFolder createMediaFolder(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new folder with given parameters.- Parameters:
attributeValues- parameters used for creationctx- session context- Returns:
- created folder
- Since:
- 3.1-u4
-
getMediaFolderByQualifier
public java.util.Collection<MediaFolder> getMediaFolderByQualifier(java.lang.String searchString)
Finds all folders whose qualifier matches the specified search pattern. Wildcards are '%' and '_' ( as in SQL LIKE statements ).- Parameters:
searchString- pattern used for searching the folders- Returns:
- list of found folders
- Since:
- 3.1-u4
-
getAllMediaFolders
@Deprecated public java.util.Collection<MediaFolder> getAllMediaFolders()
Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get aMediaFolderModels instances. See more at loading by exemplary model.Gets allMediaFolder's in system.- Returns:
- all folders installed
- Since:
- 3.1-u4
-
getRootMediaFolder
@Deprecated public MediaFolder getRootMediaFolder()
Deprecated.since ages - useMediaService.getRootFolder()insteadGets the root folder.- Returns:
- root folder
- Throws:
JaloSystemException- when root media folder does not exist- Since:
- 3.1-u4
-
getOrCreateRootMediaFolder
public MediaFolder getOrCreateRootMediaFolder()
Gets the or create root media folder.- Returns:
- the or create root media folder
-
createMediaContainer
public MediaContainer createMediaContainer(java.lang.String qualifier)
Creates a new container with given qualifier.- Parameters:
qualifier- qualifier for new container- Returns:
- created container
-
createMediaContainer
public MediaContainer createMediaContainer(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new container with given parameters.- Parameters:
attributeValues- parameters used for creation- Returns:
- created container
-
createMediaContainer
public MediaContainer createMediaContainer(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new container with given parameters.- Parameters:
attributeValues- parameters used for creationctx- session context- Returns:
- created container
-
createMediaFormat
public MediaFormat createMediaFormat(java.lang.String qualifier)
Creates a new format with given qualifier.- Parameters:
qualifier- qualifier for new format- Returns:
- created format
-
createMediaFormat
public MediaFormat createMediaFormat(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new format with given parameters.- Parameters:
attributeValues- parameters used for creation- Returns:
- created format
-
createMediaFormat
public MediaFormat createMediaFormat(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new format with given parameters.- Parameters:
attributeValues- parameters used for creationctx- session context- Returns:
- created format
-
createMediaContext
public MediaContext createMediaContext(java.lang.String qualifier)
Creates a new context with given qualifier.- Parameters:
qualifier- qualifier for new context- Returns:
- created context
-
createMediaContext
public MediaContext createMediaContext(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new context with given parameters.- Parameters:
attributeValues- parameters used for creation- Returns:
- created context
-
createMediaContext
public MediaContext createMediaContext(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new context with given parameters.- Parameters:
attributeValues- parameters used for creationctx- session context- Returns:
- created context
-
createMediaFormatMapping
public MediaFormatMapping createMediaFormatMapping(MediaFormat source, MediaFormat target)
Creates a new mapping with given source and target format.- Parameters:
source- source formattarget- target format- Returns:
- created mapping
-
createMediaFormatMapping
public MediaFormatMapping createMediaFormatMapping(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new mapping with given parameters.- Parameters:
attributeValues- parameters used for creation- Returns:
- created mapping
-
createMediaFormatMapping
public MediaFormatMapping createMediaFormatMapping(SessionContext ctx, java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Creates a new mapping with given parameters.- Parameters:
attributeValues- parameters used for creationctx- session context- Returns:
- created mapping
-
createMedia
public Media createMedia(java.lang.String code, MediaFormat format)
Creates a new media with given code and format.- Parameters:
code- code for new mediaformat- format for new media- Returns:
- created media
-
getAllMediaContexts
@Deprecated public java.util.List<MediaContext> getAllMediaContexts()
Deprecated.since ages - use plainFlexibleSearchService.getModelsByExample(Object)to get aMediaContexts instances. See more at loading by exemplary model.Gets all media contexts in system.- Returns:
- list of all contexts in system
-
getMediaFormatByQualifier
public MediaFormat getMediaFormatByQualifier(java.lang.String qualifier)
Gets first media format matching given qualifier.- Parameters:
qualifier- qualifier a format is needed for- Returns:
- media format with given qualifier
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException- Specified by:
writeReplacein classManager- Throws:
java.io.ObjectStreamException
-
-