how to send org.osgi.service.event.Event to frontend javascript | Community
Skip to main content
Adobe Employee
April 16, 2021
Solved

how to send org.osgi.service.event.Event to frontend javascript

  • April 16, 2021
  • 3 replies
  • 1893 views

I have a requirement where i need to update the status of an icon based on an 

org.osgi.service.event.Event

 the icon needs to be hidden or visible or title needs to be changed based on the value of that event. How can we send this event to the front end javascript so that i can update the ui according to this?

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 joerghoh

This is not that easy for some reasons:

  1. Native AEM does not support a server-side-push possibility.
  2. Your client needs to register its interest ini a certain OSGI event on the server.
  3. How would play together via cache? You would need to bypass for this type of push.

With these constraints I think that you should design your application in a way, which is capable to avoid this dependency, mostyl for scalability reasons.

 

3 replies

Kiran_Vedantam
Community Advisor
Community Advisor
April 16, 2021

Hi @tasunil1,

 

Once you get the required value in sightly, you can share it with the front end as per my answer here.

 

Hope this helps.

 

Thanks,

Kiran Vedantam

tasunil1Adobe EmployeeAuthor
Adobe Employee
April 16, 2021
Hi @kiran_vedantam the main issue which i am facing is how to send the osgi event to the JS. From JS to HTML i can do the binding. but how to make the event reach the JS?
arunpatidar
Community Advisor
Community Advisor
April 16, 2021

Hi,

Do you need to update the icon asynchronously or on page load.

If it is on page load then you can read those node values using nodepath.json and update it.

 

But if there is a monitoring/dashborad page that needs to be updated, in that case, you need to write a polling service in javascript to fetch the same data and update the icon, title.

Arun Patidar
tasunil1Adobe EmployeeAuthor
Adobe Employee
April 16, 2021
hello @arunpatidar no i need to do it asynchronously. what happens is i send an event to process something then if it is successfull i need to update the icon on the same page
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
April 18, 2021

This is not that easy for some reasons:

  1. Native AEM does not support a server-side-push possibility.
  2. Your client needs to register its interest ini a certain OSGI event on the server.
  3. How would play together via cache? You would need to bypass for this type of push.

With these constraints I think that you should design your application in a way, which is capable to avoid this dependency, mostyl for scalability reasons.