Fetching cloud service configuration in AEM code | Community
Skip to main content
Level 7
September 2, 2024
Solved

Fetching cloud service configuration in AEM code

  • September 2, 2024
  • 1 reply
  • 545 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @mahesh_gunaje 
Please use https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/webservicesupport/ConfigurationManager.html 

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) {

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 2, 2024

Hi @mahesh_gunaje 
Please use https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/webservicesupport/ConfigurationManager.html 

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