Package com.day.cq.dam.scene7.api
Interface S7ConfigResolver
-
@ProviderType public interface S7ConfigResolver
Provides access to the Scene7 cloud configuration
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADHOC_FOLDERstatic java.lang.StringCHARSETDefault char setstatic java.lang.StringCOMPANY_ALIASThe companyAlias, only supported in DMS7static java.lang.StringCOMPANY_ALIAS_HANDLEScene7 generated company handle ID for the company corresponding to the companyAlias Only supported in DMS7static java.lang.StringCOMPANY_HANDLEScene7 generated company handle IDstatic java.lang.StringCOMPANY_NAMEThe companyNamestatic java.lang.StringCQ_ROOT_PATHcq root folder ID in the scene7 company folder hierarchy, is not the "root path" in the S7 (see getRootPath())static java.lang.StringDEFAULT_CONFIG_FLAGStores the default configuration property flagstatic java.lang.StringEMAILScene7 User email IDstatic java.lang.StringFLASH_TEMPLATES_SERVERThe Scene7 flash templates publish server URL.static java.lang.StringFXG_SERVERDeprecated.static java.lang.StringIMPORT_QUEUE_NAMEThe Scene7 import queue namestatic java.lang.StringIMPORT_QUEUE_TOPICThe import queue topicstatic java.lang.StringPASSWORDScene7 User password IDstatic java.lang.StringPREVIEW_SERVERThe Scene7 preview server URL.static java.lang.StringPREVIEW_SERVER_TOKENThe Scene7 preview server jwt for authorization.static java.lang.StringPREVIEW_SERVER_TOKEN_EXPIRYThe Scene7 preview server jwt expiry.static java.lang.StringPUBLISH_ENABLEDcontrols s7 publish state updates and synchronization of assets/folders already managed by s7static java.lang.StringPUBLISH_SERVERThe Scene7 publish server URL.static java.lang.StringREGIONScene7 region (server mapping)static java.lang.StringROOT_PATHThe "root path" ID in the S7 sense...see getRootPath()static java.lang.StringSYNC_ENABLEDcontrols s7 updates and synchronization of assets/folders already managed by s7static java.lang.StringTARGET_PATHThe target path property, storing the path where Scene7 assets are downloaded into CQ DAM.static java.lang.StringUSER_HANDLEScene7 generated user handle ID
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description S7ConfiggetDefaultS7Config()Deprecated.WARNING: this method embeds the new ResourceResolver into returned S7Config instance! Caller is responsible to callS7Config.close(), or usegetDefaultS7Config(ResourceResolver)instead.S7ConfiggetDefaultS7Config(ResourceResolver resourceResolver)Returns default S7 configuration If run under DMS7 mode, return DMS7 configuration, otherwise, return S7Connect configurationS7ConfiggetDefaultS7Config(ResourceResolver resourceResolver, java.lang.String configRootPath)Deprecated.S7ConfiggetS7Config(ResourceResolver resourceResolver, java.lang.String configPath)Returns the S7Config generated from the configPathS7ConfiggetS7Config(ResourceResolver resourceResolver, java.lang.String email, java.lang.String password, java.lang.String region)Returns a S7Config with the corresponding parameters applied.S7ConfiggetS7ConfigForAssetPath(ResourceResolver resourceResolver, java.lang.String assetPath)Retrieves the Scene7 configuration associated with asset by content path when Scene7 metadata is not availableS7ConfiggetS7ConfigForImageUrl(ResourceResolver resourceResolver, java.lang.String imageUrl)Deprecated.this method is brokenS7ConfiggetS7ConfigForResource(Resource resource)Deprecated.this method returns unreadable config! UsegetS7ConfigForResource(ResourceResolver, Resource)instead.S7ConfiggetS7ConfigForResource(ResourceResolver resourceResolver, Resource resource)Retrieves the Scene7 configuration associated with a DAM asset resource by successively analysing the resource and then its parents.S7ConfiggetS7ConfigForResource(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.S7ConfiggetS7ConfigForRootId(ResourceResolver resourceResolver, java.lang.String rootId)Looks up scene7 configuration for the specified root id (company name?)java.lang.StringgetS7ConfigPathForAssetPath(ResourceResolver resolver, java.lang.String assetPath)Retrieves the Scene7 configuration associated with an asset path.java.lang.StringgetS7ConfigPathForImageUrl(ResourceResolver resolver, java.lang.String domain, java.lang.String companyName)Retrieves the Scene7 configuration associated with an image server URL.java.lang.StringgetS7ConfigPathForResource(ResourceResolver resolver, Resource resource)Retrieves the Scene7 configuration path associated with a DAM asset resource by successively analysing the resource and then its parents.ResourceResolvergetS7ConfigReaderResolver()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)java.util.List<S7Config>getS7Configurations(ResourceResolver resourceResolver, java.lang.String configRootPath)Deprecated.S7ConfiggetSharedS7Config(ResourceResolver resourceResolver, S7Config s7Config)Returns a copy of the given S7Config pointing to the shared companyjava.lang.BooleanisDMS7Enabled()Temporary method for checking if DMS7 feature is enalbedjava.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 urlvoidsetPreviewServerTokenForS7Config(java.lang.String token, S7Config s7config)Sets the preview server jwt token and expirty for Scene7 configuration provided
-
-
-
Field Detail
-
REGION
static final java.lang.String REGION
Scene7 region (server mapping)- See Also:
- Constant Field Values
-
EMAIL
static final java.lang.String EMAIL
Scene7 User email ID- 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
-
CHARSET
static final java.lang.String CHARSET
Default char set- 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
-
ADHOC_FOLDER
static final java.lang.String ADHOC_FOLDER
- 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 configurationemail- - scene7 account name used for connect to Scene7 serverpassword- - scene7 account password used for connect to Scene7 serverregion- - 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 configurationconfigPath- - 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 configurations7Config- - 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 configurationconfigRootPath- - root path where the configurations will be loaded from- Returns:
- list of
S7Configconfigurations
-
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
S7Configconfigurations
-
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 configurationconfigRootPath- - root path where the configurations will be loaded from- Returns:
- default
S7Configconfiguration 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
S7Configconfiguration object
-
getDefaultS7Config
@Deprecated S7Config getDefaultS7Config()
Deprecated.WARNING: this method embeds the new ResourceResolver into returned S7Config instance! Caller is responsible to callS7Config.close(), or usegetDefaultS7Config(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
S7Configconfiguration 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 configurationresource- - 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 configurationresource- - a DAM asset resourceignoreSelectiveSync- - 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! UsegetS7ConfigForResource(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 brokenRetrieves the Scene7 configuration associated with an image server URL. Returns null if no S7Config is found.- Parameters:
resourceResolver- resource resolver to access Scene7 configurationimageUrl- 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 configurationassetPath- 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 configurationrootId- 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 sessionresource- 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 sessiondomain- delivery domain associated with configurationcompanyName- 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 sessionassetPath- 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 tokens7config- Scene7Config for which token has to be set
-
-