[adding dev] thanks for responding Ruchira, We had some trouble figuring out the random number based ID part. didn't realize it was done custom by you not part of shindig. ones we figured that part we could successfully publish messages from dashboard to gadget.
On Mon, Sep 14, 2015 at 4:04 PM, ruchira wageesha < [email protected]> wrote: > UES uses [1], which is the underline framework of shinding as well, to do > secure communication between iframes. > > AFAICR, these is something called a manage hub which you create for a > page. Iframes can connect to that managed hub where manage hub mediates the > messages. > > A container called, inline container can also connect to the hub. Inline > container is used to send pub-sub messages from the web page to the hub. > Then, the hub distribute it to all connected containers. > > AFAIK, ues.hub variable which is created, is a managed hub. By default > when you publish a message to the hub with a channel, it will notify all > subscribers of that channel. But, I have done several overridings to the > default hub behaviour to enable wiring based data publishing. So, if there > is no matching connection between two containers, then it will not get > notified. > > I am adding manu as well. He might help you to understand any unclear > stuff. > > /Ruchira > > [1] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification#Table_of_Contents > [2] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification_Publish_Subscribe_Overview > [3] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification_Managed_Hub_Overview > [4] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification_Managed_Hub_APIs > [5] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification_Managed_Hub_Containers > [6] > http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification_Unmanaged_Hub > > On Thu, Sep 10, 2015 at 4:54 PM, Lalanke Athauda <[email protected]> wrote: > >> Hi, >> I'm Lalanke, newly joined to UES team. I need a big help from you. >> >> You have created inter gadget pubsub communication nicely in UES 2.0.0. >> It works fine. We can check the communication by adding g1 and g2 gadgets. >> They are working fine when we wire g2 with g1. Though there are no >> documentation we can see the code and learn. >> >> My problem is about communication among dashboard and gadgets. I want to >> communicate from dashboard and gadgets by using pubsub. Is it supported in >> UES 2.0.0. Since there is no doc I don't know how to do it. >> >> I tried from my dashboard like this, >> >> ues.hub.publish("org.wso2.ues.token.ch", "msg"); >> >> Then add following lines to my gadget, >> >> <?xml version="1.0" encoding="UTF-8" ?> >> <Module> >> <ModulePrefs title="AccessTokenGadget" height="250" >> description="display access token"> >> <Require feature="pubsub-2"> >> <Param name="topics"> >> <![CDATA[ >> <Topic title="token-channel" >> name="org.wso2.ues.token.ch" >> description="sample channel to access token channel" >> type="object" >> subscribe="true"/> >> ]]> >> </Param> >> </Require> >> <Require feature="dynamic-height"/> >> </ModulePrefs> >> <Content type="html"> >> <![CDATA[ >> <head> >> <script language="javascript" type="text/javascript" >> src="/portal/js/jquery-1.10.2.js"></script> >> <script language="javascript" type="text/javascript" >> src="/portal/store/carbon.super/gadget/access-token-gadget/js/access-token.js"></script> >> <head> >> <body> >> <h4>Access Token gadget</h4> >> <div id="output"> </div> >> </body> >> ]]> >> </Content> >> </Module> >> >> my *access-token.js* file, >> >> gadgets.HubSettings.onConnect = function() { >> >> gadgets.Hub.subscribe('org.wso2.ues.token.ch', function(topic, data, >> subscriberData) { >> >> $('#output').append(data); >> }); >> >> }; >> >> When I run this, it doesn't do anything. There is a wiring we need to do >> if we communicate among gadgets. But here we don't have those. >> >> I really need your help to solve this problem. I look forward to your >> favourable response and thank you in advance for your time and >> consideration. >> >> -- >> Lalanke Athauda >> Software Engineer >> WSO2 Inc. >> Mobile: 0772264301 >> > > -- With regards, *Manu*ranga Perera. phone : 071 7 70 20 50 mail : [email protected]
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
