Interface S7ConfigResolver


  • @ProviderType
    public interface S7ConfigResolver
    Provides access to the Scene7 cloud configuration
    • Field Detail

      • REGION

        static final java.lang.String REGION
        Scene7 region (server mapping)
        See Also:
        Constant Field Values
      • PASSWORD

        static final java.lang.String PASSWORD
        Scene7 User password ID
        See Also:
        Constant Field Values
      • USER_HANDLE

        static final java.lang.String USER_HANDLE
        Scene7 generated user handle ID
        See Also:
        Constant Field Values
      • COMPANY_HANDLE

        static final java.lang.String COMPANY_HANDLE
        Scene7 generated company handle ID
        See Also:
        Constant Field Values
      • ROOT_PATH

        static final java.lang.String ROOT_PATH
        The "root path" ID in the S7 sense...see getRootPath()
        See Also:
        Constant Field Values
      • CQ_ROOT_PATH

        static final java.lang.String CQ_ROOT_PATH
        cq root folder ID in the scene7 company folder hierarchy, is not the "root path" in the S7 (see getRootPath())
        See Also:
        Constant Field Values
      • SYNC_ENABLED

        static final java.lang.String SYNC_ENABLED
        controls s7 updates and synchronization of assets/folders already managed by s7
        See Also:
        Constant Field Values
      • PUBLISH_ENABLED

        static final java.lang.String PUBLISH_ENABLED
        controls s7 publish state updates and synchronization of assets/folders already managed by s7
        See Also:
        Constant Field Values
      • PUBLISH_SERVER

        static final java.lang.String PUBLISH_SERVER
        The Scene7 publish server URL.
        See Also:
        Constant Field Values
      • PREVIEW_SERVER

        static final java.lang.String PREVIEW_SERVER
        The Scene7 preview server URL.
        See Also:
        Constant Field Values
      • PREVIEW_SERVER_TOKEN

        static final java.lang.String PREVIEW_SERVER_TOKEN
        The Scene7 preview server jwt for authorization.
        See Also:
        Constant Field Values
      • PREVIEW_SERVER_TOKEN_EXPIRY

        static final java.lang.String PREVIEW_SERVER_TOKEN_EXPIRY
        The Scene7 preview server jwt expiry.
        See Also:
        Constant Field Values
      • FLASH_TEMPLATES_SERVER

        static final java.lang.String FLASH_TEMPLATES_SERVER
        The Scene7 flash templates publish server URL.
        See Also:
        Constant Field Values
      • TARGET_PATH

        static final java.lang.String TARGET_PATH
        The target path property, storing the path where Scene7 assets are downloaded into CQ DAM.
        See Also:
        Constant Field Values
      • DEFAULT_CONFIG_FLAG

        static final java.lang.String DEFAULT_CONFIG_FLAG
        Stores the default configuration property flag
        See Also:
        Constant Field Values
      • FXG_SERVER

        @Deprecated
        static final java.lang.String FXG_SERVER
        Deprecated.
        The Scene7 FXG server URL.
        See Also:
        Constant Field Values
      • IMPORT_QUEUE_NAME

        static final java.lang.String IMPORT_QUEUE_NAME
        The Scene7 import queue name
        See Also:
        Constant Field Values
      • IMPORT_QUEUE_TOPIC

        static final java.lang.String IMPORT_QUEUE_TOPIC
        The import queue topic
        See Also:
        Constant Field Values
      • COMPANY_NAME

        static final java.lang.String COMPANY_NAME
        The companyName
        See Also:
        Constant Field Values
      • COMPANY_ALIAS

        static final java.lang.String COMPANY_ALIAS
        The companyAlias, only supported in DMS7
        See Also:
        Constant Field Values
      • COMPANY_ALIAS_HANDLE

        static final java.lang.String COMPANY_ALIAS_HANDLE
        Scene7 generated company handle ID for the company corresponding to the companyAlias Only supported in DMS7
        See Also:
        Constant Field Values
    • Method Detail

      • getS7ConfigReaderResolver

        ResourceResolver getS7ConfigReaderResolver()
        Returns:
        *new* ResourceResolver able to read Scene7 Configurations. WARNING: caller is responsible to close it!
      • getS7Config

        S7Config getS7Config​(ResourceResolver resourceResolver,
                             java.lang.String email,
                             java.lang.String password,
                             java.lang.String region)
        Returns a S7Config with the corresponding parameters applied.
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        email - - scene7 account name used for connect to Scene7 server
        password - - scene7 account password used for connect to Scene7 server
        region - - scene7 server region
        Returns:
        the S7Config that match provided username, password and region
      • getS7Config

        S7Config getS7Config​(ResourceResolver resourceResolver,
                             java.lang.String configPath)
        Returns the S7Config generated from the configPath
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        configPath - - path to the target s7 cloud configPath settings
        Returns:
        S7Config referenced by passed in configPath, return null if cannot get s7Config
      • getSharedS7Config

        S7Config getSharedS7Config​(ResourceResolver resourceResolver,
                                   S7Config s7Config)
        Returns a copy of the given S7Config pointing to the shared company
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        s7Config - - config to copy from
        Returns:
        an s7Config configured for the shared company
      • getS7Configurations

        @Deprecated
        java.util.List<S7Config> getS7Configurations​(ResourceResolver resourceResolver,
                                                     java.lang.String configRootPath)
        Deprecated.
        Returns all the S7 configurations loaded from the children of a given root path. It's deprecated from AEM6.4 due to 0DT change, this can only be used for retrieving old configuration under /etc use getS7Configurations(ResourceResolver resourceResolver) instead
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        configRootPath - - root path where the configurations will be loaded from
        Returns:
        list of S7Config configurations
      • getS7Configurations

        java.util.List<S7Config> getS7Configurations​(ResourceResolver resourceResolver)
        Returns all the S7 configurations, include both old configuration(under /etc) and new configuration after 0DT change(under /conf)
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        Returns:
        list of S7Config configurations
      • getDefaultS7Config

        @Deprecated
        S7Config getDefaultS7Config​(ResourceResolver resourceResolver,
                                    java.lang.String configRootPath)
        Deprecated.
        Returns default S7 configuration Deprecated after 0DT chagne in AEM6.4, use the getDefaultS7Config(ResourceResolver resourceResolver) instead
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        configRootPath - - root path where the configurations will be loaded from
        Returns:
        default S7Config configuration object
      • getDefaultS7Config

        S7Config getDefaultS7Config​(ResourceResolver resourceResolver)
        Returns default S7 configuration If run under DMS7 mode, return DMS7 configuration, otherwise, return S7Connect configuration
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        Returns:
        default S7Config configuration object
      • getDefaultS7Config

        @Deprecated
        S7Config getDefaultS7Config()
        Deprecated.
        WARNING: this method embeds the new ResourceResolver into returned S7Config instance! Caller is responsible to call S7Config.close(), or use getDefaultS7Config(ResourceResolver) instead.
        Returns default S7 configuration, resolved using the S7 config service user If run under DMS7 mode, return DMS7 configuration, otherwise, return S7Connect configuration
        Returns:
        default S7Config configuration object
      • getS7ConfigForResource

        S7Config getS7ConfigForResource​(ResourceResolver resourceResolver,
                                        Resource resource)
        Retrieves the Scene7 configuration associated with a DAM asset resource by successively analysing the resource and then its parents. If no S7Config is found this method returns default configuration instead.
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        resource - - a DAM asset resource
        Returns:
        the associated Scene7 configuration or default configuration, null if no configuration and no default configuration found
      • getS7ConfigForResource

        S7Config getS7ConfigForResource​(ResourceResolver resourceResolver,
                                        Resource resource,
                                        boolean ignoreSelectiveSync)
        Retrieves the Scene7 configuration associated with a DAM asset resource by successively analysing the resource and then its parents. If no S7Config is found this method returns default configuration instead.
        Parameters:
        resourceResolver - - resource resolver to access Scene7 configuration
        resource - - a DAM asset resource
        ignoreSelectiveSync - - ignore selective sync and return default config
        Returns:
        the associated Scene7 configuration or default configuration, null if no configuration and no default configuration found
      • getS7ConfigForResource

        @Deprecated
        S7Config getS7ConfigForResource​(Resource resource)
        Deprecated.
        this method returns unreadable config! Use getS7ConfigForResource(ResourceResolver, Resource) instead.
        Retrieves the Scene7 configuration associated with a DAM asset resource by successively analysing the resource and then its parents. If no S7Config is found this method returns null.
        Parameters:
        resource - a DAM asset resource
        Returns:
        the associated Scene7 configuration; null if no configuration is found
      • getS7ConfigForImageUrl

        @Deprecated
        S7Config getS7ConfigForImageUrl​(ResourceResolver resourceResolver,
                                        java.lang.String imageUrl)
        Deprecated.
        this method is broken
        Retrieves the Scene7 configuration associated with an image server URL. Returns null if no S7Config is found.
        Parameters:
        resourceResolver - resource resolver to access Scene7 configuration
        imageUrl - the image server URL
        Returns:
        return associated Scene7 configuration; null if no configuration is found
      • getS7ConfigForAssetPath

        S7Config getS7ConfigForAssetPath​(ResourceResolver resourceResolver,
                                         java.lang.String assetPath)
        Retrieves the Scene7 configuration associated with asset by content path when Scene7 metadata is not available
        Parameters:
        resourceResolver - resource resolver to access Scene7 configuration
        assetPath - the asset content path
        Returns:
        associated Scene7 configuration; null if no configuration is found
      • getS7ConfigForRootId

        S7Config getS7ConfigForRootId​(ResourceResolver resourceResolver,
                                      java.lang.String rootId)
        Looks up scene7 configuration for the specified root id (company name?)
        Parameters:
        resourceResolver - resource resolver to access Scene7 configuration
        rootId - catalog root id
        Returns:
        S7Config object that corresponds to the specified rootId or null if none found.
      • getS7ConfigPathForResource

        java.lang.String getS7ConfigPathForResource​(ResourceResolver resolver,
                                                    Resource resource)
        Retrieves the Scene7 configuration path associated with a DAM asset resource by successively analysing the resource and then its parents. If no S7Config is found this method returns null.
        Parameters:
        resolver - resource resolver associated with user session
        resource - a DAM asset resource
        Returns:
        the associated Scene7 configuration path; null if no configuration is found
      • getS7ConfigPathForImageUrl

        java.lang.String getS7ConfigPathForImageUrl​(ResourceResolver resolver,
                                                    java.lang.String domain,
                                                    java.lang.String companyName)
        Retrieves the Scene7 configuration associated with an image server URL. Returns null if no S7Config is found.
        Parameters:
        resolver - resource resolver associated with user session
        domain - delivery domain associated with configuration
        companyName - companyName associated with configuration
        Returns:
        return associated Scene7 configuration path; null if no configuration is found
      • parseDomainAndCompanyNameForUrl

        java.util.Map<java.lang.String,​java.lang.String> parseDomainAndCompanyNameForUrl​(java.lang.String imageUrl)
        Helper method to extract domain and company information related to an image url
        Parameters:
        imageUrl - image url embedding the domain and company information
        Returns:
        return a map with keys 'domain' and 'companyName' if available
      • getS7ConfigPathForAssetPath

        java.lang.String getS7ConfigPathForAssetPath​(ResourceResolver resolver,
                                                     java.lang.String assetPath)
        Retrieves the Scene7 configuration associated with an asset path. Returns null if no S7Config is found.
        Parameters:
        resolver - resource resolver associated with user session
        assetPath - asset path associated with configuration
        Returns:
        return associated Scene7 configuration path; null if no configuration is found
      • isDMS7Enabled

        java.lang.Boolean isDMS7Enabled()
        Temporary method for checking if DMS7 feature is enalbed
        Returns:
        return if the DMS7 mode is enabled
      • setPreviewServerTokenForS7Config

        void setPreviewServerTokenForS7Config​(java.lang.String token,
                                              S7Config s7config)
        Sets the preview server jwt token and expirty for Scene7 configuration provided
        Parameters:
        token - String containing JWT token
        s7config - Scene7Config for which token has to be set