Class DefaultBackofficeConfigurationMediaHelper

    • Field Detail

      • PROPERTY_BACKOFFICE_CONFIGURATION_SECURE_MEDIA_FOLDER

        protected static final java.lang.String PROPERTY_BACKOFFICE_CONFIGURATION_SECURE_MEDIA_FOLDER
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultBackofficeConfigurationMediaHelper

        public DefaultBackofficeConfigurationMediaHelper()
    • Method Detail

      • findMediaByCode

        protected MediaModel findMediaByCode​(java.lang.String mediaCode)
      • removeAmbiguousConfiguration

        protected void removeAmbiguousConfiguration​(java.lang.String mediaCode)
      • getSecureFolder

        public MediaFolderModel getSecureFolder()
        Description copied from interface: BackofficeConfigurationMediaHelper
        The 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:
        getSecureFolder in interface BackofficeConfigurationMediaHelper
        Returns:
        the standard secure media folder for backoffice configurations
        See Also:
        MediaFolderModel
      • assureSecureFolderAssignment

        protected void assureSecureFolderAssignment​(MediaModel mediaModel)
        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 persistChanged argument 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) IllegalStateException will be thrown
        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.
        Parameters:
        mediaModel - media to checked for secure folder assignment
        Throws:
        java.lang.IllegalStateException - if the media is assigned to a non-secure folder
        java.lang.IllegalArgumentException - if the passed media is null
        See Also:
        MediaStorageConfigService, assureSecureFolderAssignment(MediaModel), MediaManager.ROOT_FOLDER_QUALIFIER
      • failOnInsecureFolderAssignment

        protected void failOnInsecureFolderAssignment​(java.lang.String folderQualifier)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setSearchRestrictionService

        public void setSearchRestrictionService​(SearchRestrictionService searchRestrictionService)
      • getMediaService

        protected MediaService getMediaService()
      • setMediaService

        public void setMediaService​(MediaService mediaService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • setMediaStorageConfigService

        public void setMediaStorageConfigService​(MediaStorageConfigService mediaStorageConfigService)
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)
      • setCatalogVersionService

        public void setCatalogVersionService​(CatalogVersionService catalogVersionService)
      • getMediaCatalogId

        public java.lang.String getMediaCatalogId()
      • setMediaCatalogId

        public void setMediaCatalogId​(java.lang.String mediaCatalogId)
      • getMediaCatalogVersion

        public java.lang.String getMediaCatalogVersion()
      • setMediaCatalogVersion

        public void setMediaCatalogVersion​(java.lang.String mediaCatalogVersion)