Class DefaultBackofficeConfigurationMediaHelper
java.lang.Object
com.hybris.backoffice.config.impl.DefaultBackofficeConfigurationMediaHelper
- All Implemented Interfaces:
BackofficeConfigurationMediaHelper
public class DefaultBackofficeConfigurationMediaHelper
extends Object
implements BackofficeConfigurationMediaHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassureSecureFolderAssignment(MediaModel mediaModel) The method assures secure media folder assignment of the given media.protected MediaFolderModelcreateWidgetsConfigMedia(String mediaCode, String mediaMime) Creates Backoffice configuration media and in case media cannot be created
returns existing media with given codeprotected voidfailOnInsecureFolderAssignment(String folderQualifier) protected CatalogVersionModelDeprecated, for removal: This API element is subject to removal in a future version.protected MediaModelfindMediaByCode(String mediaCode) Deprecated, for removal: This API element is subject to removal in a future version.Since 2205, replaced byMediaUtil.findMediaByCode(String).findOrCreateWidgetsConfigMedia(String mediaCode, String mediaMime) Searches for Backoffice configuration media and creates one in case media is not found.findOrCreateWidgetsConfigMedia(String mediaCode, String mediaMime, Consumer<MediaModel> newMediaInitializer) Searches for Backoffice configuration media and creates one in case media is not found.findWidgetsConfigMedia(String mediaCode) Searches for Backoffice configuration media and removes all configurations if given mediaCode
is ambiguous.protected CatalogVersionServiceDeprecated, for removal: This API element is subject to removal in a future version.since 2205protected BackofficeConfigurationDaoDeprecated, for removal: This API element is subject to removal in a future version.since 2205Deprecated, for removal: This API element is subject to removal in a future version.since 2205protected MediaServiceprotected ModelServiceprotected SearchRestrictionServiceThe method tries to load the Media Folder of'backofficeconfiguration'qualifier.protected SessionServiceprotected UserServiceprotected MediaFolderModelprotected voidremoveAmbiguousConfiguration(String mediaCode) voidsetBackofficeMediaUtil(MediaUtil backofficeMediaUtil) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) Deprecated, for removal: This API element is subject to removal in a future version.since 2205voidsetConfigurationDao(BackofficeConfigurationDao configurationDao) voidsetMediaCatalogId(String mediaCatalogId) Deprecated, for removal: This API element is subject to removal in a future version.since 2205voidsetMediaCatalogVersion(String mediaCatalogVersion) Deprecated, for removal: This API element is subject to removal in a future version.since 2205voidsetMediaService(MediaService mediaService) voidsetMediaStorageConfigService(MediaStorageConfigService mediaStorageConfigService) voidsetModelService(ModelService modelService) voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService) voidsetSessionService(SessionService sessionService) voidsetUserService(UserService userService)
-
Field Details
-
PROPERTY_BACKOFFICE_CONFIGURATION_SECURE_MEDIA_FOLDER
- See Also:
-
-
Constructor Details
-
DefaultBackofficeConfigurationMediaHelper
public DefaultBackofficeConfigurationMediaHelper()
-
-
Method Details
-
findOrCreateWidgetsConfigMedia
public MediaModel findOrCreateWidgetsConfigMedia(String mediaCode, String mediaMime, Consumer<MediaModel> newMediaInitializer) Description copied from interface:BackofficeConfigurationMediaHelperSearches for Backoffice configuration media and creates one in case media is not found.- Specified by:
findOrCreateWidgetsConfigMediain interfaceBackofficeConfigurationMediaHelper- Parameters:
mediaCode- code ofMediaModelto be searched formediaMime- mime type used when newMediaModelis creatednewMediaInitializer- initializer callback to call for new media created by this method- Returns:
MediaModelcorresponding with given mediaCode
-
findOrCreateWidgetsConfigMedia
Description copied from interface:BackofficeConfigurationMediaHelperSearches for Backoffice configuration media and creates one in case media is not found.- Specified by:
findOrCreateWidgetsConfigMediain interfaceBackofficeConfigurationMediaHelper- Parameters:
mediaCode- code ofMediaModelto be searched formediaMime- mime type used when newMediaModelis created- Returns:
MediaModelcorresponding with given mediaCode
-
findWidgetsConfigMedia
Description copied from interface:BackofficeConfigurationMediaHelperSearches for Backoffice configuration media and removes all configurations if given mediaCode
is ambiguous.- Specified by:
findWidgetsConfigMediain interfaceBackofficeConfigurationMediaHelper- Parameters:
mediaCode- code ofMediaModelto be searched for- Returns:
MediaModelcorresponding with given mediaCode
-
findMediaByCode
Deprecated, for removal: This API element is subject to removal in a future version.Since 2205, replaced byMediaUtil.findMediaByCode(String). -
createWidgetsConfigMedia
Description copied from interface:BackofficeConfigurationMediaHelperCreates Backoffice configuration media and in case media cannot be created
returns existing media with given code- Specified by:
createWidgetsConfigMediain interfaceBackofficeConfigurationMediaHelper- Parameters:
mediaCode- code ofMediaModelto be createdmediaMime- mime type used when newMediaModelis created- Returns:
MediaModelcorresponding with given mediaCode
-
findBackofficeMediaCatalog
@Deprecated(since="2205", forRemoval=true) protected CatalogVersionModel findBackofficeMediaCatalog()Deprecated, for removal: This API element is subject to removal in a future version.Since 2205, replaced byMediaUtil.findMediaCatalogVersion(). -
removeAmbiguousConfiguration
-
getSecureFolder
Description copied from interface:BackofficeConfigurationMediaHelperThe method tries to load the Media Folder of'backofficeconfiguration'qualifier. If the folder is found it is returned. Otherwise the method tries to create it and return. In case of a race condition, where two subsequent saves happen and the method fails to save the folder, it re-tries the fetch and return before it finally fails.- Specified by:
getSecureFolderin interfaceBackofficeConfigurationMediaHelper- Returns:
- the standard secure media folder for backoffice configurations
- See Also:
-
loadSecureFolder
-
createSecureFolder
-
assureSecureFolderAssignment
The method assures secure media folder assignment of the given media. The following scenarios are covered:- if the media is not assigned to a folder or it is assigned to the root folder it will be assigned to the standard
one and persisted if the
persistChangedargument is set to true - if the media is assigned to a folder which is secure (see
MediaStorageConfigService) nothing will be done - if the media is assigned to a folder which is not secure (see
MediaStorageConfigService)IllegalStateExceptionwill be thrown
- Parameters:
mediaModel- media to checked for secure folder assignment- Throws:
IllegalStateException- if the media is assigned to a non-secure folderIllegalArgumentException- if the passed media isnull- See Also:
- if the media is not assigned to a folder or it is assigned to the root folder it will be assigned to the standard
one and persisted if the
-
failOnInsecureFolderAssignment
-
getSessionService
-
setSessionService
-
getSearchRestrictionService
-
setSearchRestrictionService
-
getMediaService
-
setMediaService
-
getModelService
-
setModelService
-
getConfigurationDao
-
setConfigurationDao
-
getMediaStorageConfigService
-
setMediaStorageConfigService
-
getUserService
-
setUserService
-
getCatalogVersionService
@Deprecated(since="2205", forRemoval=true) protected CatalogVersionService getCatalogVersionService()Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
setCatalogVersionService
@Deprecated(since="2205", forRemoval=true) public void setCatalogVersionService(CatalogVersionService catalogVersionService) Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
getMediaCatalogId
Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
setMediaCatalogId
Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
getMediaCatalogVersion
Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
setMediaCatalogVersion
@Deprecated(since="2205", forRemoval=true) public void setMediaCatalogVersion(String mediaCatalogVersion) Deprecated, for removal: This API element is subject to removal in a future version.since 2205 -
getBackofficeMediaUtil
-
setBackofficeMediaUtil
-
MediaUtil.findMediaCatalogVersion().