Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the WSO2 Dashboard Server (WSO2 DS), the gadget technology is based on the  OpenSocial public specification.   WSO2 DS renders the gadgets and add other features (e.g., communication, security, UI layouts) using  Apache Shindig, which is an OpenSocial container and solution that is used to start hosting OpenSocial apps quickly, by providing the code to render gadgets, proxy requests, and handle REST and RPC requests. Inter-gadget communication is the capability of one gadget being able to communicate with another gadget (such as, the capability of Gadget X to send some data to Gadget Y and Gadget Y's capability of getting updated with the data that it received. Apache Shindig uses the publisher-subscriber  communication paradigm for communication purposes, which is commonly known as the Pub/Sub model. This paradigm is asynchronous, loosely coupled, autonomous and also a data-centric approach for communication. The following are the three main components that make-up this paradigm: Publisher, Subscriber and Notification System. WSO2 Dashboard Server (WSO2 DS) supports inter-gadget communication with the help of publisher and subscriber gadgets, allowing gadgets to communicate with each other while running within a dashboard. 

...

Gadgets convey their interest to either publish or subscribe to a channel via the gadgets.Hub.* API. Therefore, the pubsub-2 feature needs to be imported to load the necessary API fragments and this feature can be declared in the ModulePrefs section of the gadget. The following image explains the publisher-subscriber  communication paradigm:
 

Real world scenarios

The WSO2 DS pub/sub model can be used for various requirements in the real world. The following is an example of a real world scenario where inter-gadget communication in WSO2 DS comes in use.

If there are two gadgets where one has a time slider and another gadget displays the number of builds for each app based on a time period, and if the latter mentioned gadget is required to display the number of builds for each app based on the time period that was selected in the time slider gadget, then the gadget with the time slider needs to be a publisher gadget and the other gadget needs to be a subscriber gadget as it needs to listen to the time slider gadget's channel.

What's Next?

Info
iconfalse

See how pub-sub is configured for inter-gadget communication in /wiki/spaces/SM100/pages/14221862To learn how to configure a gadget for inter-gadget communication, see Configuring Gadgets for Inter-gadget Communication, and to enable inter-gadget communication among gadgets, see  Enabling Inter-gadget Communication.