Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Level 8

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.

View solution in original post

7 Replies

Avatar

Correct answer by
Level 8

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.

Avatar

Level 10
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  

Avatar

Level 3

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.

Avatar

Level 3

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..,,

Avatar

Employee

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. 

Avatar

Level 10
"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