You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Christian Fischer <c....@cs-hertwig.de> on 2012/08/28 16:12:26 UTC

Re: Customize RAVE towards generic IWC

Hi all,

the Holidays are over, so it's time to integrate my Code for the 
Inter-Widget-Communication-Helper into RAVE.

What i have done so far:
apache-portal-resources -> integrated my custom JavaScript and CSS 
through the custom_js.tag and custom_css.tag. This works quite well 
everytime the Page loads :)

The Problem is, that i must inject a little piece of Code into EACH 
Widget without manipulating the original widget - everytime a iframe 
gets loaded.
Example:
original Widget:
<html><head><script src="widget_script.js"> ... </head>...</html>

loaded Widget with Code-Injection:
<html><head><script src="widget_script.js"> ... <script 
src="myscript.js"> ... </head>...</html>

Is this possible with RAVE? At this point, I have found nothing in the 
sources that would make it possible. I Think the only way is to use a 
custom build of wookie that injects the script for me.
The rave-providers -> W3CWidgetRenderer just loads the List of Widgets 
from the Wookie-Store and builds the Block for the rave.registerwidget 
function (At least I think that).

It would be nice if i can inject the code to all widgets when loading 
the page, whether they are OpenSocial or W3C Widgets.

Has anyone suggestions for me?
Is it possible to load a "default feature" for each widget?

Thanks,
Christian



Am 15.07.2012 21:19, schrieb Scott Wilson:
> On 14 Jul 2012, at 20:15, Chris Geer wrote:
>
>> On Sat, Jul 14, 2012 at 2:15 AM, Christian Fischer <fl...@web.de>wrote:
>>
>>> Hi all,
>>>
>>> i would like to get familar with the RAVE-Development because i will use
>>> it for my master-thesis.
>>> I'll need to extend RAVE for implementing an Inter-Widget-Communication
>>> (IWC) Helper.
>>> That means, i will implement a Training Environment for Widgets which
>>> doesn't Support IWC originally.
>>> -> Widgets without IWC schould after the Training support the IWC with
>>> other Widgets.
>>> (Only during the User-Session. Original Widget should NOT be modified.)
>>>
>> Thanks for your interest in Rave. We are always looking for new ways to
>> utilize the Rave platform and hope you can share your work with the
>> community as you go.
>>
>>> For that, i MUST inject some JavaScript Code into each Widget and the
>>> Portal-Page everytime when RAVE loads a Widget from the Wookie-Widget-Store
>>> or from antother Store (Wookie is first enough).
>>> We have successfully implemented a testing Environment in Apache Wookie by
>>> injecting some JS-Code.
>>> Now, i want to Integrate a IWC-Training-Environment in RAVE for Mashups.
>>> -> Is it generally possible to inject Code into widgets each time widgets
>>> gets Displayed?
>>>
>> It is very easy to include custom code in the container (page). All you
>> really need to do is customize the custom_js.tag file and point to your
>> custom javascript. This will allow access to that script from the page. As
>> for injecting code into the widget, I'm not sure the best way to do that
>> with Wookie. With OpenSocial gadgets, you could have a custom feature and
>> reference it from your gadgets.
>>
> Its almost exactly the same with Wookie using custom features - there are some step-by-step instructions here on how to inject JS into Wookie widgets by creating a new feature spec:
>
> http://incubator.apache.org/wookie/docs/developer/features.html
>
> That should work without needing to modify anything in Rave.
>
>>> -> Where must i start to get my Custom Code to get Loaded by RAVE each
>>> Time widgets gets Displayed?
>>> -> Where is my entrypoint to get famililar with the RAVE-Source Code?
>>> (Already followed the instructions on the Webpage, Eclipse is ready to run
>>> with RAVE).
>>>
>>> The Basic Idea is to send Events from the Widgets over OpenAjax pubsub to
>>> the portal-Page and implement a Training Environment storing the learned
>>> Events and Destinations in RAVE's Database according to the logged-in user.
>>>
>> As a general note, Rave already supports OpenAjaxHub for IWC. Again, I'm
>> not horribly familiar with the W3C widgets (Wookie) but on the OpenSocial
>> side all you have to do is include the pubsub2 feature in your gadgets and
>> pub/sub works like a champ. I suspect you can already do it from the Wookie
>> side as well but someone else will have to confirm.
> For Wookie its almost the same. Add the following line to your Widget's config.xml file:
>
> <feature name="http://www.openajax.org/hub">
>
> ... and you can then call "hub.publish" and "hub.subscribe" from your Widget's javascript.
>
>
>> Chris
>>
>>> Tanks for Your Help,
>>>
>>> Christian
>>>


Re: OpenAjax Hub - Widget gets no connection

Posted by Aaron Gooch <eo...@gmail.com>.
I also noticed this was an issue if you wanted to include the feature for
opensocial-templates. You have to specify in the gadget xml that you want
to include the opensocial-templates feature.

Aaron

On Mon, Oct 8, 2012 at 1:29 PM, Christian Fischer
<c....@cs-hertwig.de>wrote:

> Hello,
>
> this works perfect. This saves a lot of time! many thanks!
>
> Greets,
> Christian
>
> Am 08.10.2012 16:58, schrieb Franklin, Matthew B.:
>
>  -----Original Message-----
>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.**de<c....@cs-hertwig.de>
>>> ]
>>> Sent: Monday, October 08, 2012 10:16 AM
>>> To: dev@rave.apache.org
>>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>>
>>> Thanks for the answer. Then, i must go deeper into shindig when it
>>> parses the gadget spec.
>>>
>> If you really have no ability to modify the spec files and you can assume
>> that EVERY gadget needs the pubsub feature, then you can override the
>> default render code to always call the doOaaIframeHtml_ [1]:
>>
>>
>> ORIGINAL:
>>
>> 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_();
>>    }
>> };
>>
>> REPLACEMENT
>>
>> 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;
>>
>>      this.doOaaIframeHtml_();
>> };
>>
>> [1] http://svn.apache.org/repos/**asf/shindig/trunk/features/**
>> src/main/javascript/features/**container.site.gadget/gadget_**holder.js<http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js>
>>
>>  Greets,
>>> Christian
>>>
>>> Am 08.10.2012 16:07, schrieb Noe-Payne, Erin A.:
>>>
>>>> Christian, it SHOULD be the equivalent, and for the majority of
>>>> features it
>>>>
>>> would be. However, in the case of pubsub-2 and I want to say views, it
>>> is not.
>>>
>>>> Shindig parses a gadget spec file and builds a metadata object
>>>> including a list
>>>>
>>> of features that are required in the gadget. It does not look at forced
>>> requires,
>>> and it does not walk the dependency tree.  So if the <Require
>>> feature="pubsub-2"/> tag is not in the moduleprefs of the gadget, it
>>> will not
>>> be returned as part of the metadata object from shindig.  That metadata
>>> object is what informs the container whether the gadget is rendered to
>>> support pubsub.
>>>
>>>> To my knowledge you cannot get pubsub to work without requiring directly
>>>>
>>> in the gadget spec.
>>>
>>>> -----Original Message-----
>>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.**de<c....@cs-hertwig.de>
>>>>> ]
>>>>> Sent: Monday, October 08, 2012 9:42 AM
>>>>> To: dev@rave.apache.org
>>>>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>>>>
>>>>> Hi Erin,
>>>>>
>>>>> adding the feature pubsub-2 to the forced libs isn't enough?
>>>>> This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each
>>>>> Gadget? Isn't?
>>>>> I need to add this functionality for each gadget without modifying the
>>>>> source of the Gadgets. How this is otherwise possible?
>>>>>
>>>>> Greets,
>>>>> Christian
>>>>>
>>>>>
>>>>> Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
>>>>>
>>>>>> Hi Christian,
>>>>>>
>>>>>> In order for pubsub-2 to work it MUST be required in the gadget spec:
>>>>>>
>>>>> <Require feature="pubsub-2"/>. This is because at the time the iframe
>>>>> is
>>>>> rendered on the client, the container needs to do some special tricks
>>>>> to
>>>>>
>>>> hook
>>>
>>>> up pubsub, and it decides whether or not to do that based on whether the
>>>>> feature is require in the module prefs. Just including the source is
>>>>> not
>>>>>
>>>> enough.
>>>
>>>> Let me know if that works!
>>>>>> Erin
>>>>>>
>>>>>>  -----Original Message-----
>>>>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.**de<c....@cs-hertwig.de>
>>>>>>> ]
>>>>>>> Sent: Monday, October 08, 2012 9:17 AM
>>>>>>> To: dev@rave.apache.org
>>>>>>> Subject: OpenAjax Hub - Widget gets no connection
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>>>>>>> OpenAjax Hub by assuming the following Scenario:
>>>>>>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a
>>>>>>> new
>>>>>>> Feature in the Shindig build.
>>>>>>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding
>>>>>>> my
>>>>>>> feature and the pubsub-2 feature at the end of the line
>>>>>>>
>>>>>>> shindig.gadget-rewrite.**default-forced-libs=core:**
>>>>>>> pubsub-2:rpc:iwc-client
>>>>>>>
>>>>>>> in file rave.shindig.properties.
>>>>>>> 3. loading the page, checking that the gadgets.Hub instance is there,
>>>>>>> all fine right now.
>>>>>>> 4. checking if the IfameHubClient is connected with the Hub by
>>>>>>> calling
>>>>>>> gadgets.Hub.isConnected() returns always *false* - except the
>>>>>>> original
>>>>>>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>>>>>>> seconds (gadgets.Hub is loaded!)
>>>>>>>
>>>>>>>
>>>>>>> Greets & Thanks,
>>>>>>> Christian
>>>>>>>
>>>>>>
>

Re: OpenAjax Hub - Widget gets no connection

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

this works perfect. This saves a lot of time! many thanks!

Greets,
Christian

Am 08.10.2012 16:58, schrieb Franklin, Matthew B.:
>> -----Original Message-----
>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>> Sent: Monday, October 08, 2012 10:16 AM
>> To: dev@rave.apache.org
>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>
>> Thanks for the answer. Then, i must go deeper into shindig when it
>> parses the gadget spec.
> If you really have no ability to modify the spec files and you can assume that EVERY gadget needs the pubsub feature, then you can override the default render code to always call the doOaaIframeHtml_ [1]:
>
>
> ORIGINAL:
>
> 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_();
>    }
> };
>
> REPLACEMENT
>
> 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;
>
>      this.doOaaIframeHtml_();
> };
>
> [1] http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js
>
>> Greets,
>> Christian
>>
>> Am 08.10.2012 16:07, schrieb Noe-Payne, Erin A.:
>>> Christian, it SHOULD be the equivalent, and for the majority of features it
>> would be. However, in the case of pubsub-2 and I want to say views, it is not.
>>> Shindig parses a gadget spec file and builds a metadata object including a list
>> of features that are required in the gadget. It does not look at forced requires,
>> and it does not walk the dependency tree.  So if the <Require
>> feature="pubsub-2"/> tag is not in the moduleprefs of the gadget, it will not
>> be returned as part of the metadata object from shindig.  That metadata
>> object is what informs the container whether the gadget is rendered to
>> support pubsub.
>>> To my knowledge you cannot get pubsub to work without requiring directly
>> in the gadget spec.
>>>> -----Original Message-----
>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>>> Sent: Monday, October 08, 2012 9:42 AM
>>>> To: dev@rave.apache.org
>>>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>>>
>>>> Hi Erin,
>>>>
>>>> adding the feature pubsub-2 to the forced libs isn't enough?
>>>> This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each
>>>> Gadget? Isn't?
>>>> I need to add this functionality for each gadget without modifying the
>>>> source of the Gadgets. How this is otherwise possible?
>>>>
>>>> Greets,
>>>> Christian
>>>>
>>>>
>>>> Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
>>>>> Hi Christian,
>>>>>
>>>>> In order for pubsub-2 to work it MUST be required in the gadget spec:
>>>> <Require feature="pubsub-2"/>. This is because at the time the iframe is
>>>> rendered on the client, the container needs to do some special tricks to
>> hook
>>>> up pubsub, and it decides whether or not to do that based on whether the
>>>> feature is require in the module prefs. Just including the source is not
>> enough.
>>>>> Let me know if that works!
>>>>> Erin
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>>>>> Sent: Monday, October 08, 2012 9:17 AM
>>>>>> To: dev@rave.apache.org
>>>>>> Subject: OpenAjax Hub - Widget gets no connection
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>>>>>> OpenAjax Hub by assuming the following Scenario:
>>>>>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>>>>>> Feature in the Shindig build.
>>>>>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>>>>>> feature and the pubsub-2 feature at the end of the line
>>>>>>
>>>>>> shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>>>>>>
>>>>>> in file rave.shindig.properties.
>>>>>> 3. loading the page, checking that the gadgets.Hub instance is there,
>>>>>> all fine right now.
>>>>>> 4. checking if the IfameHubClient is connected with the Hub by calling
>>>>>> gadgets.Hub.isConnected() returns always *false* - except the original
>>>>>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>>>>>> seconds (gadgets.Hub is loaded!)
>>>>>>
>>>>>>
>>>>>> Greets & Thanks,
>>>>>> Christian


RE: OpenAjax Hub - Widget gets no connection

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>Sent: Monday, October 08, 2012 10:16 AM
>To: dev@rave.apache.org
>Subject: Re: OpenAjax Hub - Widget gets no connection
>
>Thanks for the answer. Then, i must go deeper into shindig when it
>parses the gadget spec.

If you really have no ability to modify the spec files and you can assume that EVERY gadget needs the pubsub feature, then you can override the default render code to always call the doOaaIframeHtml_ [1]:


ORIGINAL:

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_();
  }
};

REPLACEMENT

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;

    this.doOaaIframeHtml_();
};

[1] http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js

>
>Greets,
>Christian
>
>Am 08.10.2012 16:07, schrieb Noe-Payne, Erin A.:
>> Christian, it SHOULD be the equivalent, and for the majority of features it
>would be. However, in the case of pubsub-2 and I want to say views, it is not.
>>
>> Shindig parses a gadget spec file and builds a metadata object including a list
>of features that are required in the gadget. It does not look at forced requires,
>and it does not walk the dependency tree.  So if the <Require
>feature="pubsub-2"/> tag is not in the moduleprefs of the gadget, it will not
>be returned as part of the metadata object from shindig.  That metadata
>object is what informs the container whether the gadget is rendered to
>support pubsub.
>>
>> To my knowledge you cannot get pubsub to work without requiring directly
>in the gadget spec.
>>
>>> -----Original Message-----
>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>> Sent: Monday, October 08, 2012 9:42 AM
>>> To: dev@rave.apache.org
>>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>>
>>> Hi Erin,
>>>
>>> adding the feature pubsub-2 to the forced libs isn't enough?
>>> This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each
>>> Gadget? Isn't?
>>> I need to add this functionality for each gadget without modifying the
>>> source of the Gadgets. How this is otherwise possible?
>>>
>>> Greets,
>>> Christian
>>>
>>>
>>> Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
>>>> Hi Christian,
>>>>
>>>> In order for pubsub-2 to work it MUST be required in the gadget spec:
>>> <Require feature="pubsub-2"/>. This is because at the time the iframe is
>>> rendered on the client, the container needs to do some special tricks to
>hook
>>> up pubsub, and it decides whether or not to do that based on whether the
>>> feature is require in the module prefs. Just including the source is not
>enough.
>>>> Let me know if that works!
>>>> Erin
>>>>
>>>>> -----Original Message-----
>>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>>>> Sent: Monday, October 08, 2012 9:17 AM
>>>>> To: dev@rave.apache.org
>>>>> Subject: OpenAjax Hub - Widget gets no connection
>>>>>
>>>>> Hi,
>>>>>
>>>>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>>>>> OpenAjax Hub by assuming the following Scenario:
>>>>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>>>>> Feature in the Shindig build.
>>>>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>>>>> feature and the pubsub-2 feature at the end of the line
>>>>>
>>>>> shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>>>>>
>>>>> in file rave.shindig.properties.
>>>>> 3. loading the page, checking that the gadgets.Hub instance is there,
>>>>> all fine right now.
>>>>> 4. checking if the IfameHubClient is connected with the Hub by calling
>>>>> gadgets.Hub.isConnected() returns always *false* - except the original
>>>>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>>>>> seconds (gadgets.Hub is loaded!)
>>>>>
>>>>>
>>>>> Greets & Thanks,
>>>>> Christian


Re: OpenAjax Hub - Widget gets no connection

Posted by Christian Fischer <c....@cs-hertwig.de>.
Thanks for the answer. Then, i must go deeper into shindig when it 
parses the gadget spec.

Greets,
Christian

Am 08.10.2012 16:07, schrieb Noe-Payne, Erin A.:
> Christian, it SHOULD be the equivalent, and for the majority of features it would be. However, in the case of pubsub-2 and I want to say views, it is not.
>
> Shindig parses a gadget spec file and builds a metadata object including a list of features that are required in the gadget. It does not look at forced requires, and it does not walk the dependency tree.  So if the <Require feature="pubsub-2"/> tag is not in the moduleprefs of the gadget, it will not be returned as part of the metadata object from shindig.  That metadata object is what informs the container whether the gadget is rendered to support pubsub.
>
> To my knowledge you cannot get pubsub to work without requiring directly in the gadget spec.
>
>> -----Original Message-----
>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>> Sent: Monday, October 08, 2012 9:42 AM
>> To: dev@rave.apache.org
>> Subject: Re: OpenAjax Hub - Widget gets no connection
>>
>> Hi Erin,
>>
>> adding the feature pubsub-2 to the forced libs isn't enough?
>> This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each
>> Gadget? Isn't?
>> I need to add this functionality for each gadget without modifying the
>> source of the Gadgets. How this is otherwise possible?
>>
>> Greets,
>> Christian
>>
>>
>> Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
>>> Hi Christian,
>>>
>>> In order for pubsub-2 to work it MUST be required in the gadget spec:
>> <Require feature="pubsub-2"/>. This is because at the time the iframe is
>> rendered on the client, the container needs to do some special tricks to hook
>> up pubsub, and it decides whether or not to do that based on whether the
>> feature is require in the module prefs. Just including the source is not enough.
>>> Let me know if that works!
>>> Erin
>>>
>>>> -----Original Message-----
>>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>>> Sent: Monday, October 08, 2012 9:17 AM
>>>> To: dev@rave.apache.org
>>>> Subject: OpenAjax Hub - Widget gets no connection
>>>>
>>>> Hi,
>>>>
>>>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>>>> OpenAjax Hub by assuming the following Scenario:
>>>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>>>> Feature in the Shindig build.
>>>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>>>> feature and the pubsub-2 feature at the end of the line
>>>>
>>>> shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>>>>
>>>> in file rave.shindig.properties.
>>>> 3. loading the page, checking that the gadgets.Hub instance is there,
>>>> all fine right now.
>>>> 4. checking if the IfameHubClient is connected with the Hub by calling
>>>> gadgets.Hub.isConnected() returns always *false* - except the original
>>>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>>>> seconds (gadgets.Hub is loaded!)
>>>>
>>>>
>>>> Greets & Thanks,
>>>> Christian


RE: OpenAjax Hub - Widget gets no connection

Posted by "Noe-Payne, Erin A." <er...@mitre.org>.
Christian, it SHOULD be the equivalent, and for the majority of features it would be. However, in the case of pubsub-2 and I want to say views, it is not.

Shindig parses a gadget spec file and builds a metadata object including a list of features that are required in the gadget. It does not look at forced requires, and it does not walk the dependency tree.  So if the <Require feature="pubsub-2"/> tag is not in the moduleprefs of the gadget, it will not be returned as part of the metadata object from shindig.  That metadata object is what informs the container whether the gadget is rendered to support pubsub.

To my knowledge you cannot get pubsub to work without requiring directly in the gadget spec.

>-----Original Message-----
>From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>Sent: Monday, October 08, 2012 9:42 AM
>To: dev@rave.apache.org
>Subject: Re: OpenAjax Hub - Widget gets no connection
>
>Hi Erin,
>
>adding the feature pubsub-2 to the forced libs isn't enough?
>This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each
>Gadget? Isn't?
>I need to add this functionality for each gadget without modifying the
>source of the Gadgets. How this is otherwise possible?
>
>Greets,
>Christian
>
>
>Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
>> Hi Christian,
>>
>> In order for pubsub-2 to work it MUST be required in the gadget spec:
><Require feature="pubsub-2"/>. This is because at the time the iframe is
>rendered on the client, the container needs to do some special tricks to hook
>up pubsub, and it decides whether or not to do that based on whether the
>feature is require in the module prefs. Just including the source is not enough.
>>
>> Let me know if that works!
>> Erin
>>
>>> -----Original Message-----
>>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>>> Sent: Monday, October 08, 2012 9:17 AM
>>> To: dev@rave.apache.org
>>> Subject: OpenAjax Hub - Widget gets no connection
>>>
>>> Hi,
>>>
>>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>>> OpenAjax Hub by assuming the following Scenario:
>>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>>> Feature in the Shindig build.
>>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>>> feature and the pubsub-2 feature at the end of the line
>>>
>>> shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>>>
>>> in file rave.shindig.properties.
>>> 3. loading the page, checking that the gadgets.Hub instance is there,
>>> all fine right now.
>>> 4. checking if the IfameHubClient is connected with the Hub by calling
>>> gadgets.Hub.isConnected() returns always *false* - except the original
>>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>>> seconds (gadgets.Hub is loaded!)
>>>
>>>
>>> Greets & Thanks,
>>> Christian


Re: OpenAjax Hub - Widget gets no connection

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

adding the feature pubsub-2 to the forced libs isn't enough?
This SHOULD be the equivalent to <Require feature="pubsub-2"/> in each 
Gadget? Isn't?
I need to add this functionality for each gadget without modifying the 
source of the Gadgets. How this is otherwise possible?

Greets,
Christian


Am 08.10.2012 15:29, schrieb Noe-Payne, Erin A.:
> Hi Christian,
>
> In order for pubsub-2 to work it MUST be required in the gadget spec: <Require feature="pubsub-2"/>. This is because at the time the iframe is rendered on the client, the container needs to do some special tricks to hook up pubsub, and it decides whether or not to do that based on whether the feature is require in the module prefs. Just including the source is not enough.
>
> Let me know if that works!
> Erin
>
>> -----Original Message-----
>> From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>> Sent: Monday, October 08, 2012 9:17 AM
>> To: dev@rave.apache.org
>> Subject: OpenAjax Hub - Widget gets no connection
>>
>> Hi,
>>
>> has anyone an idea why a OpenSocial Gadget gets no connection to the
>> OpenAjax Hub by assuming the following Scenario:
>> 1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>> Feature in the Shindig build.
>> 2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>> feature and the pubsub-2 feature at the end of the line
>>
>> shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>>
>> in file rave.shindig.properties.
>> 3. loading the page, checking that the gadgets.Hub instance is there,
>> all fine right now.
>> 4. checking if the IfameHubClient is connected with the Hub by calling
>> gadgets.Hub.isConnected() returns always *false* - except the original
>> pubsub-gadgets shipped with rave/shindig - even then trying after x
>> seconds (gadgets.Hub is loaded!)
>>
>>
>> Greets & Thanks,
>> Christian


RE: OpenAjax Hub - Widget gets no connection

Posted by "Noe-Payne, Erin A." <er...@mitre.org>.
Hi Christian,

In order for pubsub-2 to work it MUST be required in the gadget spec: <Require feature="pubsub-2"/>. This is because at the time the iframe is rendered on the client, the container needs to do some special tricks to hook up pubsub, and it decides whether or not to do that based on whether the feature is require in the module prefs. Just including the source is not enough.

Let me know if that works!
Erin

>-----Original Message-----
>From: Christian Fischer [mailto:c.fischer@cs-hertwig.de]
>Sent: Monday, October 08, 2012 9:17 AM
>To: dev@rave.apache.org
>Subject: OpenAjax Hub - Widget gets no connection
>
>Hi,
>
>has anyone an idea why a OpenSocial Gadget gets no connection to the
>OpenAjax Hub by assuming the following Scenario:
>1. Using a custom Build of Shindig and Apache RAVE, i added only a new
>Feature in the Shindig build.
>2. Forcing all OpenSocial Gadgets to use this new feature by adding my
>feature and the pubsub-2 feature at the end of the line
>
>shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client
>
>in file rave.shindig.properties.
>3. loading the page, checking that the gadgets.Hub instance is there,
>all fine right now.
>4. checking if the IfameHubClient is connected with the Hub by calling
>gadgets.Hub.isConnected() returns always *false* - except the original
>pubsub-gadgets shipped with rave/shindig - even then trying after x
>seconds (gadgets.Hub is loaded!)
>
>
>Greets & Thanks,
>Christian

OpenAjax Hub - Widget gets no connection

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

has anyone an idea why a OpenSocial Gadget gets no connection to the 
OpenAjax Hub by assuming the following Scenario:
1. Using a custom Build of Shindig and Apache RAVE, i added only a new 
Feature in the Shindig build.
2. Forcing all OpenSocial Gadgets to use this new feature by adding my 
feature and the pubsub-2 feature at the end of the line

shindig.gadget-rewrite.default-forced-libs=core:pubsub-2:rpc:iwc-client

in file rave.shindig.properties.
3. loading the page, checking that the gadgets.Hub instance is there, 
all fine right now.
4. checking if the IfameHubClient is connected with the Hub by calling 
gadgets.Hub.isConnected() returns always *false* - except the original 
pubsub-gadgets shipped with rave/shindig - even then trying after x 
seconds (gadgets.Hub is loaded!)


Greets & Thanks,
Christian

Re: Customize RAVE towards generic IWC

Posted by Christian Fischer <c....@cs-hertwig.de>.
Am 25.09.2012 17:13, schrieb Christian Fischer:
> Am 28.08.2012 17:09, schrieb Chris Geer:
>> On Tue, Aug 28, 2012 at 7:12 AM, Christian Fischer
>> <c....@cs-hertwig.de>wrote:
>>
>>> Hi all,
>>>
>>> the Holidays are over, so it's time to integrate my Code for the
>>> Inter-Widget-Communication-Helper into RAVE.
>>>
>>> What i have done so far:
>>> apache-portal-resources -> integrated my custom JavaScript and CSS 
>>> through
>>> the custom_js.tag and custom_css.tag. This works quite well 
>>> everytime the
>>> Page loads :)
>>>
>>> The Problem is, that i must inject a little piece of Code into EACH 
>>> Widget
>>> without manipulating the original widget - everytime a iframe gets 
>>> loaded.
>>> Example:
>>> original Widget:
>>> <html><head><script src="widget_script.js"> ... </head>...</html>
>>>
>>> loaded Widget with Code-Injection:
>>> <html><head><script src="widget_script.js"> ... <script 
>>> src="myscript.js">
>>> ... </head>...</html>
>>>
>>> Is this possible with RAVE? At this point, I have found nothing in the
>>> sources that would make it possible. I Think the only way is to use a
>>> custom build of wookie that injects the script for me.
>>> The rave-providers -> W3CWidgetRenderer just loads the List of Widgets
>>> from the Wookie-Store and builds the Block for the rave.registerwidget
>>> function (At least I think that).
>>>
>>> It would be nice if i can inject the code to all widgets when 
>>> loading the
>>> page, whether they are OpenSocial or W3C Widgets.
>>>
>>> Has anyone suggestions for me?
>>> Is it possible to load a "default feature" for each widget?
>>>
>> I don't believe there is a way to do this at the moment at a Rave 
>> level. On
>> the OpenSocial side I'm sure you could modify one of the shindig core
>> features that gets loaded with every widget and add your code to that 
>> but I
>> don't know about the Wookie side.
>
> Hi Chris,
>
> i get the things up and working fine for W3C widgets by using a custom 
> build of wookie.
> For Opensocial Gadgets you said, that there should be a way with the 
> shindig core features that gets loaded with every widget.
> Can you explain a litte more about that?
> I need to insert my custom JS-File reference to each Gadget and i need 
> to enable the pubsub-2 feature in each gadget without modifying any 
> source core of the original gadget.
>
> I tried to use a custom build of shindig with rave but i get security 
> errors when loading OpenSocial Gadgets:
> "Unable to render OpenSocial Gadget: Gadget is not trusted to render 
> in this container."
> Have you any hint for this problem? (Current Shindig Snapshot)
>
The Error above: "Unable to render OpenSocial Gadget..." exists only 
with the current RAVE-Snapshot, it is not a Shindig fault.
I used the latest SVN version today which causes the error. With an 
older 0.16 snaphot it works quite well.

However, when i access 
http://localhost:8080/samplecontainer/samplecontainer.html i get a 
malformed-security-token error.
Is this a RAVE related Bug?

> Thanks,
> Christian
>


Re: Customize RAVE towards generic IWC

Posted by Christian Fischer <c....@cs-hertwig.de>.
Am 28.08.2012 17:09, schrieb Chris Geer:
> On Tue, Aug 28, 2012 at 7:12 AM, Christian Fischer
> <c....@cs-hertwig.de>wrote:
>
>> Hi all,
>>
>> the Holidays are over, so it's time to integrate my Code for the
>> Inter-Widget-Communication-**Helper into RAVE.
>>
>> What i have done so far:
>> apache-portal-resources -> integrated my custom JavaScript and CSS through
>> the custom_js.tag and custom_css.tag. This works quite well everytime the
>> Page loads :)
>>
>> The Problem is, that i must inject a little piece of Code into EACH Widget
>> without manipulating the original widget - everytime a iframe gets loaded.
>> Example:
>> original Widget:
>> <html><head><script src="widget_script.js"> ... </head>...</html>
>>
>> loaded Widget with Code-Injection:
>> <html><head><script src="widget_script.js"> ... <script src="myscript.js">
>> ... </head>...</html>
>>
>> Is this possible with RAVE? At this point, I have found nothing in the
>> sources that would make it possible. I Think the only way is to use a
>> custom build of wookie that injects the script for me.
>> The rave-providers -> W3CWidgetRenderer just loads the List of Widgets
>> from the Wookie-Store and builds the Block for the rave.registerwidget
>> function (At least I think that).
>>
>> It would be nice if i can inject the code to all widgets when loading the
>> page, whether they are OpenSocial or W3C Widgets.
>>
>> Has anyone suggestions for me?
>> Is it possible to load a "default feature" for each widget?
>>
> I don't believe there is a way to do this at the moment at a Rave level. On
> the OpenSocial side I'm sure you could modify one of the shindig core
> features that gets loaded with every widget and add your code to that but I
> don't know about the Wookie side.

Hi Chris,

i get the things up and working fine for W3C widgets by using a custom 
build of wookie.
For Opensocial Gadgets you said, that there should be a way with the 
shindig core features that gets loaded with every widget.
Can you explain a litte more about that?
I need to insert my custom JS-File reference to each Gadget and i need 
to enable the pubsub-2 feature in each gadget without modifying any 
source core of the original gadget.

I tried to use a custom build of shindig which rave but i get security 
errors when loading OpenSocial Gadgets:
"Unable to render OpenSocial Gadget: Gadget is not trusted to render in 
this container."
Have you any hint for this problem? (Current Shindig Snapshot)

Thanks,
Christian

>> Thanks,
>> Christian
>>
>>
>>
>> Am 15.07.2012 21:19, schrieb Scott Wilson:
>>
>>   On 14 Jul 2012, at 20:15, Chris Geer wrote:
>>>   On Sat, Jul 14, 2012 at 2:15 AM, Christian Fischer <flyinghuman@web.de
>>>>> wrote:
>>>>   Hi all,
>>>>> i would like to get familar with the RAVE-Development because i will use
>>>>> it for my master-thesis.
>>>>> I'll need to extend RAVE for implementing an Inter-Widget-Communication
>>>>> (IWC) Helper.
>>>>> That means, i will implement a Training Environment for Widgets which
>>>>> doesn't Support IWC originally.
>>>>> -> Widgets without IWC schould after the Training support the IWC with
>>>>> other Widgets.
>>>>> (Only during the User-Session. Original Widget should NOT be modified.)
>>>>>
>>>>>   Thanks for your interest in Rave. We are always looking for new ways to
>>>> utilize the Rave platform and hope you can share your work with the
>>>> community as you go.
>>>>
>>>>   For that, i MUST inject some JavaScript Code into each Widget and the
>>>>> Portal-Page everytime when RAVE loads a Widget from the
>>>>> Wookie-Widget-Store
>>>>> or from antother Store (Wookie is first enough).
>>>>> We have successfully implemented a testing Environment in Apache Wookie
>>>>> by
>>>>> injecting some JS-Code.
>>>>> Now, i want to Integrate a IWC-Training-Environment in RAVE for Mashups.
>>>>> -> Is it generally possible to inject Code into widgets each time
>>>>> widgets
>>>>> gets Displayed?
>>>>>
>>>>>   It is very easy to include custom code in the container (page). All you
>>>> really need to do is customize the custom_js.tag file and point to your
>>>> custom javascript. This will allow access to that script from the page.
>>>> As
>>>> for injecting code into the widget, I'm not sure the best way to do that
>>>> with Wookie. With OpenSocial gadgets, you could have a custom feature and
>>>> reference it from your gadgets.
>>>>
>>>>   Its almost exactly the same with Wookie using custom features - there
>>> are some step-by-step instructions here on how to inject JS into Wookie
>>> widgets by creating a new feature spec:
>>>
>>> http://incubator.apache.org/**wookie/docs/developer/**features.html<http://incubator.apache.org/wookie/docs/developer/features.html>
>>>
>>> That should work without needing to modify anything in Rave.
>>>
>>>   -> Where must i start to get my Custom Code to get Loaded by RAVE each
>>>>> Time widgets gets Displayed?
>>>>> -> Where is my entrypoint to get famililar with the RAVE-Source Code?
>>>>> (Already followed the instructions on the Webpage, Eclipse is ready to
>>>>> run
>>>>> with RAVE).
>>>>>
>>>>> The Basic Idea is to send Events from the Widgets over OpenAjax pubsub
>>>>> to
>>>>> the portal-Page and implement a Training Environment storing the learned
>>>>> Events and Destinations in RAVE's Database according to the logged-in
>>>>> user.
>>>>>
>>>>>   As a general note, Rave already supports OpenAjaxHub for IWC. Again,
>>>> I'm
>>>> not horribly familiar with the W3C widgets (Wookie) but on the OpenSocial
>>>> side all you have to do is include the pubsub2 feature in your gadgets
>>>> and
>>>> pub/sub works like a champ. I suspect you can already do it from the
>>>> Wookie
>>>> side as well but someone else will have to confirm.
>>>>
>>> For Wookie its almost the same. Add the following line to your Widget's
>>> config.xml file:
>>>
>>> <feature name="http://www.openajax.org/**hub<http://www.openajax.org/hub>
>>> ">
>>>
>>> ... and you can then call "hub.publish" and "hub.subscribe" from your
>>> Widget's javascript.
>>>
>>>
>>>   Chris
>>>>   Tanks for Your Help,
>>>>> Christian
>>>>>
>>>>>


Generic IWC-Extension for Apache RAVE

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

i have finished my project to get a most intuitive IWC-Integration & 
user-customized IWC-Configuration in Apache RAVE, and of course, this 
concept should work for other Platforms as well.
What we do, is to observe the users inputs in all widgets and do some 
pattern-detection for unnecessary user-inputs.
In the current prototype the pattern detection primary recognizes double 
entered user inputs and saves the associations between the found 
ui-elements from the different widgets.

To support "all" widgets, no matter if opensocial or W3C widgets, it is 
necessary to force the use of the "pubsub-2" feature in opensocial and 
the " http://www.openajax.org/hub " feature in W3C widgets AND a new 
feature which must also forced to be used by all widgets: i call it the 
"iwc-client" feature.
In my current implementation the iwc-client Feature observes the user's 
interaction with the widget and then send this information to a central 
point where all information from all widgets gets analyzed for a 
pattern-detection.
Currently this is a W3C-Widget which a user must only add to the 
Dashboard to get the new functionality. It should also be possible to 
integrate this in the RAVE-Portal page.

Of course  not all  widgets  will be useable  for the basic patterns  
used in the Prototype (double  value  detection),  but for  
demonstration  purposes  widgets  with  HTML  input
elements  are  working  fine.  The  next  step  is  to  find  out which  
patterns  are  useful  for listening to. In Addition to that, we suggest 
that each widget container should have the
ability forcing to load specific features into any widgets if needed. 
The ROLE-IWC (XMPP) inclusion can also benefit from this, i think.

We will set up a Demo-Server, so that anyone can test this 
implementation, but for now i have created a screencast where you can 
see it in action [1].

I like to hear upon your response to this idea.
In Late February or in March 2013 we are going to release a Paper which 
describes the Concept in more detail. If you can read German, my 
master-thesis about this project should also be online available in 
February 2013. If there is interest to read this, please mail to me and 
i'll give you the Link.

Greets & thanks for the support,

Christian


[1] http://www.youtube.com/watch?v=ycAmvfno5WE

Re: Customize RAVE towards generic IWC

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

> On 31 Aug 2012, at 09:04, Christian Fischer wrote:
>
>> Am 31.08.2012 09:08, schrieb Scott Wilson:
>>> On 31 Aug 2012, at 06:59, Christian Fischer wrote:
>>>
>>>> Hi,
>>>>
>>>> for me it doesn't work:
>>>>
>>>> For Wookie Widgets i use the feature
>>>>
>>>> <feature name="http://www.openajax.org/hub" required="true"/>
>>>>
>>>> thereby i can use hub.subscribe and hub.publish -- all fine for communication between wookie widgets. For Opensocial i use the feature
>>>>
>>>> <Require feature="pubsub-2">
>>>>
>>>> thereby i can access the hub by gadgets.Hub.subscribe and gadgets.Hub.publish -- all fine for communication between Opensocial Widgets.
>>>>
>>>> There are 2 instances of the OpenAjax hub (window.hub and window.gadgets.Hub) - that should be the reason why communication between OpenSocial and Wookie Widgets doesn't work at the moment. I'm wrong?
>>>>
>>>> I think it should be possible to communicate between W3C and OpenSocial Widgets - this would simplyfy some things and would RAVE more "attractive" for some people.
>>> Hi Christian,
>>>
>>> I tested it using the demo OpenAjax gadgets, and a W3C widget including the following HTML:
>>>
>>> <button onclick="hub.publish('org.apache.shindig.random-number','42');">Publish!</button>
>>>
>>> Clicking the publish button in the W3C Widget results in a message displaying in the OpenAjax Hub Subscriber gadget, e.g.:
>>>
>>> message : 42
>>> received at: Fri Aug 31 2012 07:54:04 GMT+0100 (BST)
>>>
>>> So it seems to work OK for me.
>> Thanks, i tryed a few configurations - now it seems to work.
>>
>> however, if i'm subscribing to the channel '*' (all channels) it doesn't work.
>> Are there any security restictions? For my use case, i need a widget that listens to ALL Messages which should work by subscribe to the channel '*'.
>>
>> Some testings:
>>
>> Shindig <-> Wookie
>> publish random number -> subcribe to 'org.apache.shindig.random-number': OK
>> subcribe to 'org.apache.shindig.random-number' <- publish random number: OK
>> publish random number -> subscribe to '*' : not OK
>> only wookie:
>> publish random number at 'org.apache.shindig.random-number' & subscribe to '*' : not OK
>> publish 'any_message' at 'any channel" & subscribe to '*' : OK
> I don't really know enough about how OpenAjax Hub is set up to answer that one - as far as I'm aware Wookie and Shindig use the same version of the OpenAjax JS library, and set up OOA iframes in the same manner.

Ok, i found the fault: the wildcard '*' only takes care of one token:

|for example the topic name org.openajax.example.token.one has 5 tokens|.

So i must subscribe to the channel "*.*.*.*.*" for receiving all 
messages at channels with 5 tokens.

Thanks.


>>>> Christian
>>>>
>>>>
>>>>
>>>>> On 30 Aug 2012, at 16:50, Christian Fischer wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
>>>>>>
>>>>>> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
>>>>>>
>>>>>> How can I easily get a communcation between shindig and wookie via pubsub?
>>>>> It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:
>>>>>
>>>>> <feature name="http://www.openajax.org/hub" required="true"/>
>>>>>
>>>>> It should then be capable of pubsub when deployed in Rave.
>>>>>
>>>>>
>>>>>> Greets & thanks,
>>>>>> Christian


Re: Customize RAVE towards generic IWC

Posted by Scott Wilson <sc...@gmail.com>.
On 31 Aug 2012, at 09:04, Christian Fischer wrote:

> 
> 
> Am 31.08.2012 09:08, schrieb Scott Wilson:
>> On 31 Aug 2012, at 06:59, Christian Fischer wrote:
>> 
>>> Hi,
>>> 
>>> for me it doesn't work:
>>> 
>>> For Wookie Widgets i use the feature
>>> 
>>> <feature name="http://www.openajax.org/hub" required="true"/>
>>> 
>>> thereby i can use hub.subscribe and hub.publish -- all fine for communication between wookie widgets. For Opensocial i use the feature
>>> 
>>> <Require feature="pubsub-2">
>>> 
>>> thereby i can access the hub by gadgets.Hub.subscribe and gadgets.Hub.publish -- all fine for communication between Opensocial Widgets.
>>> 
>>> There are 2 instances of the OpenAjax hub (window.hub and window.gadgets.Hub) - that should be the reason why communication between OpenSocial and Wookie Widgets doesn't work at the moment. I'm wrong?
>>> 
>>> I think it should be possible to communicate between W3C and OpenSocial Widgets - this would simplyfy some things and would RAVE more "attractive" for some people.
>> Hi Christian,
>> 
>> I tested it using the demo OpenAjax gadgets, and a W3C widget including the following HTML:
>> 
>> <button onclick="hub.publish('org.apache.shindig.random-number','42');">Publish!</button>
>> 
>> Clicking the publish button in the W3C Widget results in a message displaying in the OpenAjax Hub Subscriber gadget, e.g.:
>> 
>> message : 42
>> received at: Fri Aug 31 2012 07:54:04 GMT+0100 (BST)
>> 
>> So it seems to work OK for me.
> Thanks, i tryed a few configurations - now it seems to work.
> 
> however, if i'm subscribing to the channel '*' (all channels) it doesn't work.
> Are there any security restictions? For my use case, i need a widget that listens to ALL Messages which should work by subscribe to the channel '*'.
> 
> Some testings:
> 
> Shindig <-> Wookie
> publish random number -> subcribe to 'org.apache.shindig.random-number': OK
> subcribe to 'org.apache.shindig.random-number' <- publish random number: OK
> publish random number -> subscribe to '*' : not OK
> only wookie:
> publish random number at 'org.apache.shindig.random-number' & subscribe to '*' : not OK
> publish 'any_message' at 'any channel" & subscribe to '*' : OK

I don't really know enough about how OpenAjax Hub is set up to answer that one - as far as I'm aware Wookie and Shindig use the same version of the OpenAjax JS library, and set up OOA iframes in the same manner.

>> 
>>> Christian
>>> 
>>> 
>>> 
>>>> On 30 Aug 2012, at 16:50, Christian Fischer wrote:
>>>> 
>>>>> Hi all,
>>>>> 
>>>>> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
>>>>> 
>>>>> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
>>>>> 
>>>>> How can I easily get a communcation between shindig and wookie via pubsub?
>>>> It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:
>>>> 
>>>> <feature name="http://www.openajax.org/hub" required="true"/>
>>>> 
>>>> It should then be capable of pubsub when deployed in Rave.
>>>> 
>>>> 
>>>>> Greets & thanks,
>>>>> Christian
> 


Re: Customize RAVE towards generic IWC

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

Am 31.08.2012 09:08, schrieb Scott Wilson:
> On 31 Aug 2012, at 06:59, Christian Fischer wrote:
>
>> Hi,
>>
>> for me it doesn't work:
>>
>> For Wookie Widgets i use the feature
>>
>> <feature name="http://www.openajax.org/hub" required="true"/>
>>
>> thereby i can use hub.subscribe and hub.publish -- all fine for communication between wookie widgets. For Opensocial i use the feature
>>
>> <Require feature="pubsub-2">
>>
>> thereby i can access the hub by gadgets.Hub.subscribe and gadgets.Hub.publish -- all fine for communication between Opensocial Widgets.
>>
>> There are 2 instances of the OpenAjax hub (window.hub and window.gadgets.Hub) - that should be the reason why communication between OpenSocial and Wookie Widgets doesn't work at the moment. I'm wrong?
>>
>> I think it should be possible to communicate between W3C and OpenSocial Widgets - this would simplyfy some things and would RAVE more "attractive" for some people.
> Hi Christian,
>
> I tested it using the demo OpenAjax gadgets, and a W3C widget including the following HTML:
>
> <button onclick="hub.publish('org.apache.shindig.random-number','42');">Publish!</button>
>
> Clicking the publish button in the W3C Widget results in a message displaying in the OpenAjax Hub Subscriber gadget, e.g.:
>
> message : 42
> received at: Fri Aug 31 2012 07:54:04 GMT+0100 (BST)
>
> So it seems to work OK for me.
Thanks, i tryed a few configurations - now it seems to work.

however, if i'm subscribing to the channel '*' (all channels) it doesn't 
work.
Are there any security restictions? For my use case, i need a widget 
that listens to ALL Messages which should work by subscribe to the 
channel '*'.

Some testings:

Shindig <-> Wookie
publish random number -> subcribe to 'org.apache.shindig.random-number': OK
subcribe to 'org.apache.shindig.random-number' <- publish random number: OK
publish random number -> subscribe to '*' : not OK
only wookie:
publish random number at 'org.apache.shindig.random-number' & subscribe 
to '*' : not OK
publish 'any_message' at 'any channel" & subscribe to '*' : OK
>
>> Christian
>>
>>
>>
>>> On 30 Aug 2012, at 16:50, Christian Fischer wrote:
>>>
>>>> Hi all,
>>>>
>>>> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
>>>>
>>>> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
>>>>
>>>> How can I easily get a communcation between shindig and wookie via pubsub?
>>> It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:
>>>
>>> <feature name="http://www.openajax.org/hub" required="true"/>
>>>
>>> It should then be capable of pubsub when deployed in Rave.
>>>
>>>
>>>> Greets & thanks,
>>>> Christian


Re: Customize RAVE towards generic IWC

Posted by Scott Wilson <sc...@gmail.com>.
On 31 Aug 2012, at 06:59, Christian Fischer wrote:

> Hi,
> 
> for me it doesn't work:
> 
> For Wookie Widgets i use the feature
> 
> <feature name="http://www.openajax.org/hub" required="true"/>
> 
> thereby i can use hub.subscribe and hub.publish -- all fine for communication between wookie widgets. For Opensocial i use the feature
> 
> <Require feature="pubsub-2">
> 
> thereby i can access the hub by gadgets.Hub.subscribe and gadgets.Hub.publish -- all fine for communication between Opensocial Widgets.
> 
> There are 2 instances of the OpenAjax hub (window.hub and window.gadgets.Hub) - that should be the reason why communication between OpenSocial and Wookie Widgets doesn't work at the moment. I'm wrong?
> 
> I think it should be possible to communicate between W3C and OpenSocial Widgets - this would simplyfy some things and would RAVE more "attractive" for some people.

Hi Christian,

I tested it using the demo OpenAjax gadgets, and a W3C widget including the following HTML:

<button onclick="hub.publish('org.apache.shindig.random-number','42');">Publish!</button>

Clicking the publish button in the W3C Widget results in a message displaying in the OpenAjax Hub Subscriber gadget, e.g.:

message : 42
received at: Fri Aug 31 2012 07:54:04 GMT+0100 (BST)

So it seems to work OK for me.

> 
> Christian
> 
> 
> 
>> On 30 Aug 2012, at 16:50, Christian Fischer wrote:
>> 
>>> Hi all,
>>> 
>>> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
>>> 
>>> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
>>> 
>>> How can I easily get a communcation between shindig and wookie via pubsub?
>> It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:
>> 
>> <feature name="http://www.openajax.org/hub" required="true"/>
>> 
>> It should then be capable of pubsub when deployed in Rave.
>> 
>> 
>>> Greets & thanks,
>>> Christian
> 


Re: Customize RAVE towards generic IWC

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

for me it doesn't work:

For Wookie Widgets i use the feature

<feature name="http://www.openajax.org/hub" required="true"/>

thereby i can use hub.subscribe and hub.publish -- all fine for 
communication between wookie widgets. For Opensocial i use the feature

<Require feature="pubsub-2">

thereby i can access the hub by gadgets.Hub.subscribe and 
gadgets.Hub.publish -- all fine for communication between Opensocial 
Widgets.

There are 2 instances of the OpenAjax hub (window.hub and 
window.gadgets.Hub) - that should be the reason why communication 
between OpenSocial and Wookie Widgets doesn't work at the moment. I'm wrong?

I think it should be possible to communicate between W3C and OpenSocial 
Widgets - this would simplyfy some things and would RAVE more 
"attractive" for some people.

Christian



> On 30 Aug 2012, at 16:50, Christian Fischer wrote:
>
>> Hi all,
>>
>> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
>>
>> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
>>
>> How can I easily get a communcation between shindig and wookie via pubsub?
> It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:
>
> <feature name="http://www.openajax.org/hub" required="true"/>
>
> It should then be capable of pubsub when deployed in Rave.
>
>
>> Greets & thanks,
>> Christian


Re: Customize RAVE towards generic IWC

Posted by Scott Wilson <sc...@gmail.com>.
On 30 Aug 2012, at 16:50, Christian Fischer wrote:

> Hi all,
> 
> i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is not possible to publish soemthing from a wookie-widget to a shindig-widget or vice versa.
> 
> I think for a portal like the Rave portal it should be possible to receive messages from other widgets too.
> 
> How can I easily get a communcation between shindig and wookie via pubsub?

It should work already; however widgets need to declare the openajax feature as required. E.g. in the W3C widgets' config.xml it needs to have:

<feature name="http://www.openajax.org/hub" required="true"/>

It should then be capable of pubsub when deployed in Rave.


> 
> Greets & thanks,
> Christian


Re: Customize RAVE towards generic IWC

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

i try a bit with the OpenAjax pubsub Feature. For my Testsystem it is 
not possible to publish soemthing from a wookie-widget to a 
shindig-widget or vice versa.

I think for a portal like the Rave portal it should be possible to 
receive messages from other widgets too.

How can I easily get a communcation between shindig and wookie via pubsub?

Greets & thanks,
Christian

Re: Customize RAVE towards generic IWC

Posted by Chris Geer <ch...@cxtsoftware.com>.
On Tue, Aug 28, 2012 at 7:12 AM, Christian Fischer
<c....@cs-hertwig.de>wrote:

> Hi all,
>
> the Holidays are over, so it's time to integrate my Code for the
> Inter-Widget-Communication-**Helper into RAVE.
>
> What i have done so far:
> apache-portal-resources -> integrated my custom JavaScript and CSS through
> the custom_js.tag and custom_css.tag. This works quite well everytime the
> Page loads :)
>
> The Problem is, that i must inject a little piece of Code into EACH Widget
> without manipulating the original widget - everytime a iframe gets loaded.
> Example:
> original Widget:
> <html><head><script src="widget_script.js"> ... </head>...</html>
>
> loaded Widget with Code-Injection:
> <html><head><script src="widget_script.js"> ... <script src="myscript.js">
> ... </head>...</html>
>
> Is this possible with RAVE? At this point, I have found nothing in the
> sources that would make it possible. I Think the only way is to use a
> custom build of wookie that injects the script for me.
> The rave-providers -> W3CWidgetRenderer just loads the List of Widgets
> from the Wookie-Store and builds the Block for the rave.registerwidget
> function (At least I think that).
>
> It would be nice if i can inject the code to all widgets when loading the
> page, whether they are OpenSocial or W3C Widgets.
>
> Has anyone suggestions for me?
> Is it possible to load a "default feature" for each widget?
>

I don't believe there is a way to do this at the moment at a Rave level. On
the OpenSocial side I'm sure you could modify one of the shindig core
features that gets loaded with every widget and add your code to that but I
don't know about the Wookie side.

>
> Thanks,
> Christian
>
>
>
> Am 15.07.2012 21:19, schrieb Scott Wilson:
>
>  On 14 Jul 2012, at 20:15, Chris Geer wrote:
>>
>>  On Sat, Jul 14, 2012 at 2:15 AM, Christian Fischer <flyinghuman@web.de
>>> >wrote:
>>>
>>>  Hi all,
>>>>
>>>> i would like to get familar with the RAVE-Development because i will use
>>>> it for my master-thesis.
>>>> I'll need to extend RAVE for implementing an Inter-Widget-Communication
>>>> (IWC) Helper.
>>>> That means, i will implement a Training Environment for Widgets which
>>>> doesn't Support IWC originally.
>>>> -> Widgets without IWC schould after the Training support the IWC with
>>>> other Widgets.
>>>> (Only during the User-Session. Original Widget should NOT be modified.)
>>>>
>>>>  Thanks for your interest in Rave. We are always looking for new ways to
>>> utilize the Rave platform and hope you can share your work with the
>>> community as you go.
>>>
>>>  For that, i MUST inject some JavaScript Code into each Widget and the
>>>> Portal-Page everytime when RAVE loads a Widget from the
>>>> Wookie-Widget-Store
>>>> or from antother Store (Wookie is first enough).
>>>> We have successfully implemented a testing Environment in Apache Wookie
>>>> by
>>>> injecting some JS-Code.
>>>> Now, i want to Integrate a IWC-Training-Environment in RAVE for Mashups.
>>>> -> Is it generally possible to inject Code into widgets each time
>>>> widgets
>>>> gets Displayed?
>>>>
>>>>  It is very easy to include custom code in the container (page). All you
>>> really need to do is customize the custom_js.tag file and point to your
>>> custom javascript. This will allow access to that script from the page.
>>> As
>>> for injecting code into the widget, I'm not sure the best way to do that
>>> with Wookie. With OpenSocial gadgets, you could have a custom feature and
>>> reference it from your gadgets.
>>>
>>>  Its almost exactly the same with Wookie using custom features - there
>> are some step-by-step instructions here on how to inject JS into Wookie
>> widgets by creating a new feature spec:
>>
>> http://incubator.apache.org/**wookie/docs/developer/**features.html<http://incubator.apache.org/wookie/docs/developer/features.html>
>>
>> That should work without needing to modify anything in Rave.
>>
>>  -> Where must i start to get my Custom Code to get Loaded by RAVE each
>>>> Time widgets gets Displayed?
>>>> -> Where is my entrypoint to get famililar with the RAVE-Source Code?
>>>> (Already followed the instructions on the Webpage, Eclipse is ready to
>>>> run
>>>> with RAVE).
>>>>
>>>> The Basic Idea is to send Events from the Widgets over OpenAjax pubsub
>>>> to
>>>> the portal-Page and implement a Training Environment storing the learned
>>>> Events and Destinations in RAVE's Database according to the logged-in
>>>> user.
>>>>
>>>>  As a general note, Rave already supports OpenAjaxHub for IWC. Again,
>>> I'm
>>> not horribly familiar with the W3C widgets (Wookie) but on the OpenSocial
>>> side all you have to do is include the pubsub2 feature in your gadgets
>>> and
>>> pub/sub works like a champ. I suspect you can already do it from the
>>> Wookie
>>> side as well but someone else will have to confirm.
>>>
>> For Wookie its almost the same. Add the following line to your Widget's
>> config.xml file:
>>
>> <feature name="http://www.openajax.org/**hub<http://www.openajax.org/hub>
>> ">
>>
>> ... and you can then call "hub.publish" and "hub.subscribe" from your
>> Widget's javascript.
>>
>>
>>  Chris
>>>
>>>  Tanks for Your Help,
>>>>
>>>> Christian
>>>>
>>>>
>