You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com> on 2013/06/28 01:45:21 UTC

Inter-Widget communication. Is this possible?

Hello,

I'm trying to do some inter-widget communication. I've just take a look to:

http://davidsherlockomelette.blogspot.com.es/2013/02/inter-widget-communication-in-rave.html 

and here
http://www.slideshare.net/DavidSherlock/flashtalk-david

That's what I want.

And I'm doing exactly the same but with Dojo topic:

http://dojotoolkit.org/reference-guide/1.9/dojo/topic.html

I understand that it's the same feature of different frameworks.

For this to work it's known that the framework must be implemented as a 
feature. Something I will do for dojo in wookie.

I think that it must be like this because a feature is loaded once for 
all widgets on the portal. Instead of loading different
instances of the framework for each widget what will not work because 
isolated.

What I don't understand is how Rave manages Wookie features? Because I 
think that a feature that is declared must be inserted on top of the 
general Rave header instead of the IFrame of the widget. Is this right 
or not?

Is there any good reference for doing this on Rave?

If I have to do this with OpenAjax I will do of course.


Thank you in advance.


Re: Inter-Widget communication. Is this possible?

Posted by Scott Wilson <sc...@gmail.com>.
On 1 Jul 2013, at 08:18, Gonzalo Aguilar Delgado wrote:

> Hi Scott,
> 
> Thank you a lot for your directions. I will take a look. It looks quite interesting since W3C wookie widgets are loaded in a IFrame that cannot access the main page.
> 
> So a widget that's loaded by Rave will not be able to access anything inside that main page. I'm curious about how Rave circumvents this.

I believe the current version uses "fragment identifier messaging" (FIM) as a lowest-common-denominator x-frame signalling method, although there are some other transport mechanisms (Flash components, HTML5 messaging etc). Basically it mutates location.href to put the message metadata into a URL fragment.

More here:

http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification

Sadly FIM also messes up other technologies that use fragment identifiers, such as JQuery Mobile:

https://issues.apache.org/jira/browse/RAVE-772

> 
> Thank's again, and best regards,
> 
> 
> El 28/06/13 10:52, Scott Wilson escribió:
>> W3C Provider module in Rave
> 


Re: Inter-Widget communication. Is this possible?

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hi Christian,

Thank you a lot for your directions. I think I have enough information 
to take a look.

Kindest regards,

El 02/07/13 09:59, Christian Fischer escribió:
> Hi Gonzalo,
>
> For Shindig look at this:
>
> \shindig\features\src\main\javascript\features\container.site.gadget\gadget_holder.js
>      osapi.container.GadgetHolder.prototype.render = function(gadgetInfo,
>      viewParams, renderParams) {
>        this.iframeId_ = osapi.container.GadgetHolder.IFRAME_ID_PREFIX_ +
>            this.site_.getId();
>        this.gadgetInfo_ = gadgetInfo;
>        this.viewParams_ = viewParams;
>        this.renderParams_ = renderParams;
>      //  if (this.hasFeature_(gadgetInfo, 'pubsub-2')) {
>      //    this.doOaaIframeHtml_();
>      //  } else {
>      //    this.doNormalIframeHtml_();
>      //  }
>        this.doOaaIframeHtml_();  // Always use OpenAjax Iframes
>      };
>
> For wookie at the moment I don't excactly know the source for this, 
> but have a look at
> \wookie-snapshot\src\org\apache\wookie\util\html\StartPageProcessor.java
> under the section
> private void addFeatures(IHtmlProcessor engine,W3CWidget model) (...)
> there, the Feature where added to the widgets/containers and thus, 
> also a special iframe should be used. Again: read the OpenAjax 
> Documentation ;)
>
> BTW: its useful to build a sparate/individual wookie and shindig build 
> for rave to understand the workflow (for me it was so).
>
> Greets, Christian
>
> Am 01.07.2013 09:18, schrieb Gonzalo Aguilar Delgado:
>> Hi Scott,
>>
>> Thank you a lot for your directions. I will take a look. It looks 
>> quite interesting since W3C wookie widgets are loaded in a IFrame 
>> that cannot access the main page.
>>
>> So a widget that's loaded by Rave will not be able to access anything 
>> inside that main page. I'm curious about how Rave circumvents this.
>>
>> Thank's again, and best regards,
>>
>>
>> El 28/06/13 10:52, Scott Wilson escribió:
>>> W3C Provider module in Rave
>>
>


Re: Inter-Widget communication. Is this possible?

Posted by Christian Fischer <c....@cs-hertwig.de>.
Hi Gonzalo,

For Shindig look at this:

\shindig\features\src\main\javascript\features\container.site.gadget\gadget_holder.js

    osapi.container.GadgetHolder.prototype.render = function(gadgetInfo,
    viewParams, renderParams) {

      this.iframeId_ = osapi.container.GadgetHolder.IFRAME_ID_PREFIX_ +

          this.site_.getId();

      this.gadgetInfo_ = gadgetInfo;

      this.viewParams_ = viewParams;

      this.renderParams_ = renderParams;

    //  if (this.hasFeature_(gadgetInfo, 'pubsub-2')) {

    //    this.doOaaIframeHtml_();

    //  } else {

    //    this.doNormalIframeHtml_();

    //  }

      this.doOaaIframeHtml_();  // Always use OpenAjax Iframes

    };


For wookie at the moment I don't excactly know the source for this, but
have a look at

\wookie-snapshot\src\org\apache\wookie\util\html\StartPageProcessor.java

under the section

private void addFeatures(IHtmlProcessor engine,W3CWidget model) (...)

there, the Feature where added to the widgets/containers and thus, also
a special iframe should be used. Again: read the OpenAjax Documentation ;)

BTW: its useful to build a sparate/individual wookie and shindig build
for rave to understand the workflow (for me it was so).

Greets, Christian

Am 01.07.2013 09:18, schrieb Gonzalo Aguilar Delgado:
> Hi Scott,
>
> Thank you a lot for your directions. I will take a look. It looks
> quite interesting since W3C wookie widgets are loaded in a IFrame that
> cannot access the main page.
>
> So a widget that's loaded by Rave will not be able to access anything
> inside that main page. I'm curious about how Rave circumvents this.
>
> Thank's again, and best regards,
>
>
> El 28/06/13 10:52, Scott Wilson escribió:
>> W3C Provider module in Rave
>


Re: Inter-Widget communication. Is this possible?

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hi Scott,

Thank you a lot for your directions. I will take a look. It looks quite 
interesting since W3C wookie widgets are loaded in a IFrame that cannot 
access the main page.

So a widget that's loaded by Rave will not be able to access anything 
inside that main page. I'm curious about how Rave circumvents this.

Thank's again, and best regards,


El 28/06/13 10:52, Scott Wilson escribió:
> W3C Provider module in Rave


Re: Inter-Widget communication. Is this possible?

Posted by Scott Wilson <sc...@gmail.com>.
On 28 Jun 2013, at 08:47, Gonzalo Aguilar Delgado wrote:

> Hi Christian,
> 
> I managed to make it work with OpenAjax as you told me. It's great and works perfectly.
> 
> Do you know any reference about implementation details? I want to know more about how wookie and rave communicates. I find this specially difficult

Hi Gonazalo,

The Wookie OpenAjax feature is quite simple, and just looks for the availability of the OpenAjax Hub in Rave, and then provides the widget with access to it:

http://svn.apache.org/viewvc/wookie/trunk/features/openajax/OpenAjaxClient.js?view=markup

Wookie injects features into the Widget HTML, but doesn't interact directly with Rave at this level; in this case we know Rave implements OpenAjax so we just test for its availability (it would also work in any other platform using OpenAjax).

The point at which Wookie and Rave interact is through the W3C Provider module in Rave; this calls the Wookie REST API to instantiate a Widget and generate the embed code.

Here's the API Reference:

http://wookie.apache.org/docs/api.html

And here is the integration module within Rave:

http://svn.apache.org/viewvc/rave/trunk/rave-providers/rave-w3c-provider/

HTH,

S

> 
> Thank you a lot!
> 
> 
> El 28/06/13 07:02, Christian Fischer escribió:
>> Hello,
>> 
>>> What I don't understand is how Rave manages Wookie features? Because I think that a feature that is declared must be inserted on top of the general Rave header instead of the IFrame of the widget. Is this right or not? 
>> 
>> Rave uses special OpenAjax Iframes for displaying OpenAjax enabled Widgets. Try reading the OpenAjax Hub Reference: http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification
>> 
>> Greets,
>> Christian
> 


Re: Inter-Widget communication. Is this possible?

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hi Christian,

I managed to make it work with OpenAjax as you told me. It's great and 
works perfectly.

Do you know any reference about implementation details? I want to know 
more about how wookie and rave communicates. I find this specially difficult

Thank you a lot!


El 28/06/13 07:02, Christian Fischer escribió:
> Hello,
>
>> What I don't understand is how Rave manages Wookie features? Because 
>> I think that a feature that is declared must be inserted on top of 
>> the general Rave header instead of the IFrame of the widget. Is this 
>> right or not? 
>
> Rave uses special OpenAjax Iframes for displaying OpenAjax enabled 
> Widgets. Try reading the OpenAjax Hub Reference: 
> http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification
>
> Greets,
> Christian


Re: Inter-Widget communication. Is this possible?

Posted by Christian Fischer <c....@cs-hertwig.de>.
Hello,

> What I don't understand is how Rave manages Wookie features? Because I
> think that a feature that is declared must be inserted on top of the
> general Rave header instead of the IFrame of the widget. Is this right
> or not? 

Rave uses special OpenAjax Iframes for displaying OpenAjax enabled
Widgets. Try reading the OpenAjax Hub Reference:
http://www.openajax.org/member/wiki/OpenAjax_Hub_2.0_Specification

Greets,
Christian