Expand my Community achievements bar.

SOLVED

Fetching cloud service configuration in AEM code

Avatar

Level 8

Hello All,

 

Tools -> Cloud Service -> CIF configuration.  Here, There is a configuration under Basic, Features, Advanced tab.  How to fetch these data in AEM code?  Under Basic tab, there is Language section. I wanted to fetch this value in my sling model. Can someone help me with this?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Mahesh_Gunaje 
Please use https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/webser... 

Example

String[] services = pageProperties.getInherited("cq:cloudserviceconfigs", new String[]{});
ConfigurationManager cfgMgr = resource.getResourceResolver().adaptTo(ConfigurationManager.class);
if(cfgMgr != null) {
    String accountID = null;
    Configuration cfg = cfgMgr.getConfiguration("googleanalytics", services);
    if(cfg != null) {
        accountID = cfg.get("accountID", null);
    }

    if(accountID != null) {
    


Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Mahesh_Gunaje 
Please use https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/webser... 

Example

String[] services = pageProperties.getInherited("cq:cloudserviceconfigs", new String[]{});
ConfigurationManager cfgMgr = resource.getResourceResolver().adaptTo(ConfigurationManager.class);
if(cfgMgr != null) {
    String accountID = null;
    Configuration cfg = cfgMgr.getConfiguration("googleanalytics", services);
    if(cfg != null) {
        accountID = cfg.get("accountID", null);
    }

    if(accountID != null) {
    


Arun Patidar