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

Scott Plumlee commented on SHINDIG-1445:
----------------------------------------

We are trying to host pages that will load gadgets on machine A, and use 
shindig on machine B. When we try either solution above, and set serverBase to 
a full URL (http://machine:port/gadgets/) I'm seeing the POST call for metadata 
turned into an OPTIONS call that returns nothing. Trying that call via curl or 
a browser results in 'The request sent by the client was syntactically 
incorrect ().'  Can a full URL be used?

> Hardcode serverBase value in shindig-container.js
> -------------------------------------------------
>
>                 Key: SHINDIG-1445
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1445
>             Project: Shindig
>          Issue Type: Bug
>          Components: Javascript 
>    Affects Versions: 2.0.0
>            Reporter: Han Nguyen
>            Priority: Minor
>
> How do we add the context path dynamically for serverBase 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 just 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_(); 
> }; 

-- 
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