How to Fetch OSGI configurations in Javascript to display in Dialog Filed Value | Community
Skip to main content
Level 3
October 16, 2015
Solved

How to Fetch OSGI configurations in Javascript to display in Dialog Filed Value

  • October 16, 2015
  • 7 replies
  • 6552 views

Hi All,

There is an requirement where dialog should display the value of OSGI configuration. How to do that? This is an custom widget and how to call an OSGI Service / fetch OSGI config value in javascript

if there is any way or API please suggest.

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 Scott_Brodersen

If the values only need to be displayed on loading and not updated during the lifetime of the page, I would use the component JSP to obtain the properties. Otherwise you could create a servlet that does what you want and call it using Javascript.

7 replies

Scott_Brodersen
Scott_BrodersenAccepted solution
Level 8
October 16, 2015

If the values only need to be displayed on loading and not updated during the lifetime of the page, I would use the component JSP to obtain the properties. Otherwise you could create a servlet that does what you want and call it using Javascript.

smacdonald2008
Level 10
October 16, 2015
See the Community AEM page for a list of resources that show more AEM/OSGI use cases: https://helpx.adobe.com/marketing-cloud/experience-manager.html  
smacdonald2008
Level 10
October 16, 2015
Level 3
October 16, 2015

If I am not wrong accessing osgi config from javascript would essentially require user to have access to felix console. in most cases authors will not have that priviledge.

KishCq5Author
Level 3
October 16, 2015

Hi All,

my issue is the default hybris importer(/etc/importers/hybris.html) widget(hybrisimporter.js) which is of xtype hybrisimporter  has to be customized. On load the fields base store, catalog, dam path etc should be disabled and prepopulated with OSGI configurations of the same.....my question is how to read the configuration values in javascript? Is there any API which is used to directly call OSGI config node under config.author and read the property and value of it..,please suggest different ways of achieving it..,,

Adobe Employee
October 16, 2015

I do not understand your usecase. What I suggest is, write a servlet that loads from these config nodes by referencing the service of that osgi node. Then it can return you a json. 

smacdonald2008
Level 10
October 16, 2015
"How to call an OSGI service" We have many community articles that show how to call OSGI operations.  I recommend looking at this article as a starting point. https://helpx.adobe.com/experience-manager/using/first-osgi.html