[ 
https://issues.apache.org/jira/browse/SHINDIG-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918774#action_12918774
 ] 

Han Nguyen commented on SHINDIG-1330:
-------------------------------------

@ Kevin,

How do you change Shindig context root, specifically the serverBase value set 
in the function of shindig-container.js below?
shindig.BaseIfrGadget = function(opt_params) {
  shindig.Gadget.call(this, opt_params);
  this.serverBase_ = '/gadgets/'; // default gadget server
  this.queryIfrGadgetType_();
};

Looks like serverBase value is hardcoded to '/gadgets/', and we don't know how 
it can be dynamically set, but we've learned that if it's not updated with the 
context root
accordingly then the gadget won't be rendered, is that what you're experiencing?
setServerBase() won't help in this case because 1. the above function is 
invoked prior setServerBase() and 2. this.serverBase is hardcoded in that 
function.

So to get around, we currently set serverBase as opt_params when creating a 
gadget. For example: with "/shindig" as a context root, we create gadget0 as 
follow
  var gadget0 = shindig.container.createGadget({specUrl: 
'http://www.google.com/ig/modules/horoscope.xml', serverBase: 
'/shindig/gadgets/'});
Then, we modified shindig.BaseIfrGadget = function(opt_params) in 
shindig-container.js so it will set the serverBase from the opt_params input

shindig.BaseIfrGadget = function(opt_params) {
  shindig.Gadget.call(this, opt_params);
  if(opt_params.serverBase) {
          this.serverBase_ = opt_params.serverBase;
          } else {
          this.serverBase_ = '/gadgets/'; // default gadget server
  }
  this.queryIfrGadgetType_();
};

Alternatively, you can hard code the context root "/shindig" in the serverBase 
value as seen here

shindig.BaseIfrGadget = function(opt_params) {
  shindig.Gadget.call(this, opt_params);
  this.serverBase_ = '/shindig/gadgets/'; // default gadget server
  this.queryIfrGadgetType_();
};

 I think the question is left for anyone who knows how to update the context 
root value in the function above dynamically. Let us know if that helps.

Javier, do you have other insight for this?

Han

> Incorporate OpenAjax Hub as Pub-Sub Mechanism for Shindig (Open Social 1.next)
> ------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1330
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1330
>             Project: Shindig
>          Issue Type: Bug
>          Components: Javascript 
>    Affects Versions: 2.0.0
>         Environment: Shindig trunk.
> Java 5
> Windows
> FireFox, Safari, Chrome
>            Reporter: Han Nguyen
>             Fix For: 2.0.0
>
>         Attachments: pubsub2.patch
>
>
> This patch is an initial alpha implementation by Javier Pedemonte 
> (OpenAjaxHub/IBM) based on the proposal described here
> http://wiki.opensocial.org/index.php?title=Incorporate_Open_Ajax_Hub_as_Pub-Sub_Mechanism_for_OpenSocial_1.next
> While there are still more work, the patch provides a new pubsub feature 
> which uses OAHub as the underlying eventing model. 
> The /content/container/sample-pubsub-2.html demonstrates a simple pubsub 
> example using the feature.
> API documentation can be found in the comments of the 
> /javascript/features/pubsub-2/pubsub-2.js

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to