Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

author.config value to controler

Avatar

Level 6

Hi Team,

How i can define some values in config.author instance.

how i can get that value in any java file. is there api to get the instance configuration values in AEM.

Regards

Manikantha R

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Please check

Configuring OSGi

http://aempodcast.com/2016/apache-sling/demonstrate-slingosgiconfig-runmodes/#.XOUWAm4zY2w

Yes, there is a API to get OSGI config, check below example for factory config, you can do same for single config instance by changing filter in code.

aem63app-repo/GetFactoryConfigServlet.java at master · arunpatidar02/aem63app-repo · GitHub

@Reference
private ConfigurationAdmin configAdmin;

private static final String filter = "(service.pid=org.apache.sling.security.impl.ReferrerFilter)";

Configuration[] configurations = configAdmin.listConfigurations(filter);



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

Please check

Configuring OSGi

http://aempodcast.com/2016/apache-sling/demonstrate-slingosgiconfig-runmodes/#.XOUWAm4zY2w

Yes, there is a API to get OSGI config, check below example for factory config, you can do same for single config instance by changing filter in code.

aem63app-repo/GetFactoryConfigServlet.java at master · arunpatidar02/aem63app-repo · GitHub

@Reference
private ConfigurationAdmin configAdmin;

private static final String filter = "(service.pid=org.apache.sling.security.impl.ReferrerFilter)";

Configuration[] configurations = configAdmin.listConfigurations(filter);



Arun Patidar