Interface S7ConfigResolver


  • @ProviderType
    public interface S7ConfigResolver
    Provides access to the Scene7 cloud configuration
    • 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,
                             String email,
                             String password,
                             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,
                             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
        List<S7Config> getS7Configurations​(ResourceResolver resourceResolver,
                                           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

        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,
                                    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,
                                        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,
                                         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,
                                      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

        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

        String getS7ConfigPathForImageUrl​(ResourceResolver resolver,
                                          String domain,
                                          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

        Map<String,​String> parseDomainAndCompanyNameForUrl​(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

        String getS7ConfigPathForAssetPath​(ResourceResolver resolver,
                                           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

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

        void setPreviewServerTokenForS7Config​(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