You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Erik Bi <bi...@cn.ibm.com> on 2012/04/25 04:27:27 UTC

Re: Review Request: Shindig does not accept relative URLs for template libraries

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/
-----------------------------------------------------------

(Updated 2012-04-25 02:27:27.056702)


Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.


Summary
-------

per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.

Solution: 
At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 


This addresses bug shindig-1548.
    https://issues.apache.org/jira/browse/shindig-1548


Diffs
-----

  http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 

Diff: https://reviews.apache.org/r/4818/diff


Testing
-------


Thanks,

Erik


Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Erik Bi <bi...@cn.ibm.com>.

> On 2012-04-26 06:29:45, Henry Saputra wrote:
> > Actually could you also add the gadget.xml you used for testing this?

The way I tested it was changing a gadget to use relative url and check the library template request value in the request via firebug, so I can avoid writing a template library file:) 
Sure, I will write a test gadget&template library file. 
Thanks. 


- Erik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7253
-----------------------------------------------------------


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>


Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7253
-----------------------------------------------------------


Actually could you also add the gadget.xml you used for testing this?

- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>


Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <he...@gmail.com>.
No I stand corrected. The core.util provides client API to get the param
for each supported features in the View.

Fixing the ConfigContributor for core.util seems the right way. I sincerely
apologize for wrong review before =(

Please do attach the proposed patch to the JIRA so we credit your
contributions for fixing the JIRA.

- Henry

On Wed, Apr 25, 2012 at 11:02 PM, Henry Saputra <he...@gmail.com>wrote:

> I dont think thats right. The CoreUtilConfigContributor is pusshing config
> change for "core.util" feature.
>
> The JS code for opensocial-templates will not get the config param pushed
> from CoreUtilConfigContributor AFAK.
>
> - Henry
>
> On Wed, Apr 25, 2012 at 10:16 PM, Zheng Bi <bi...@cn.ibm.com> wrote:
>
>> Yes, that's exactly why we need to add the logic CoreUtilConfigContributor
>> .
>>
>> In the feature opensocial-template, it read the template url from the
>> glabal vairable gadgets.features using *"var* params =
>> gadgets.util.getFeatureParameters(opensocial-templates')", which is
>> initialized by the data pushed by CoreUtilConfigContributor.
>>
>> You can find the code in feature opensocial-template, container.js:
>>  os.Container.processGadget = *function*() {
>>   *if* (!window['gadgets']) {
>>     *return*;
>>   }
>>   *var* params = gadgets.util.getFeatureParameters(opensocial-templates'
>> );
>>   *if* (!params) {
>>     *return*;
>> ....
>>   // Honor the "requireLibrary" feature *param*(s).
>>   *if* (params.requireLibrary) {
>>     *if* (*typeof* params.requireLibrary == 'string') {
>>       os.Container.addRequiredLibrary(params.requireLibrary);
>>
>>
>> ----------------------------------------------
>> ERiK (Zheng BI) PMP
>> IBM Project Vulcan
>> China Development Lab, IBM Shanghai
>> TEL:(86-21)60922769
>> Internet ID: bizheng@cn.ibm.com
>> Addr: 5F, Building 10, No 399, Ke Yuan Road, Zhang Jiang High Tech Park,
>> 201203, Shanghai, China
>> ------------------------------------------------
>>
>>
>>
>> From:        "Henry Saputra" <hs...@apache.org>
>> To:        "Dan Dumont" <dd...@us.ibm.com>, "Stanton Sievers" <
>> sieverssj@gmail.com>, "Ryan Baxter" <rb...@gmail.com>
>> Cc:        "Henry Saputra" <hs...@apache.org>, "shindig" <
>> dev@shindig.apache.org>, Zheng Bi/China/IBM@IBMCN
>> Date:        2012/04/26 04:43
>> Subject:        Re: Review Request: Shindig does not accept relative
>> URLs for template libraries
>> ------------------------------
>>
>>
>>
>>
>> -----------------------------------------------------------
>> This is an automatically generated e-mail. To reply, visit:
>> https://reviews.apache.org/r/4818/#review7243
>> -----------------------------------------------------------
>>
>>
>>
>>
>> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java
>> <https://reviews.apache.org/r/4818/#comment15976>
>>
>>    This seems the wrong approach for me. Each ConfigContributor
>> responsible to add additional config from server.
>>
>>    In this case the CoreUtilConfigContributor is used to add additional
>> logic to push config to init function in the core.util feature.
>>
>>    Not sure how the opensocial-templates JS code could read this new
>> rewritten requireLibrary param.
>>
>>
>> - Henry
>>
>>
>> On 2012-04-25 02:27:27, Erik Bi wrote:
>> >
>> > -----------------------------------------------------------
>> > This is an automatically generated e-mail. To reply, visit:
>> > https://reviews.apache.org/r/4818/
>> > -----------------------------------------------------------
>> >
>> > (Updated 2012-04-25 02:27:27)
>> >
>> >
>> > Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton
>> Sievers.
>> >
>> >
>> > Summary
>> > -------
>> >
>> > per spec, Gadget should be able to use relative URL to define the
>> template-libray, but right now when it uses this approach, client side will
>> end up making a /gadgets/makeRequest call and passes in the relative URL
>> value and fails with an HTTP status of 400.
>> >
>> > Solution:
>> > At client side, the opensocial-template feature will get the
>> template-library URL value from global variable "features", so in this
>> patch it updates the process of generating the init JS which will be passed
>> back to client side to init the "features" variable(in Class
>> "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some
>> specific logic to handle "template-library" parameter, convert the relative
>> url to an absolute one.
>> >
>> >
>> > This addresses bug shindig-1548.
>> >     https://issues.apache.org/jira/browse/shindig-1548
>> >
>> >
>> > Diffs
>> > -----
>> >
>> >
>> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java1327432
>> >
>> > Diff: https://reviews.apache.org/r/4818/diff
>> >
>> >
>> > Testing
>> > -------
>> >
>> >
>> > Thanks,
>> >
>> > Erik
>> >
>> >
>>
>>
>>
>

Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Zheng Bi <bi...@cn.ibm.com>.
>From what I got from looking and debuging the code, it is. At first I 
thought the opensocial-templates feature should get these url info from 
the gadget metadata sent back from server, but it's not, I don't know why. 


It gets the data by call: gadgets.util.getFeatureParameters(
opensocial-templates'); 

os.Container.processGadget = function() { 
  if (!window['gadgets']) { 
    return; 
  } 
  var params = gadgets.util.getFeatureParameters(opensocial-templates'); 
  if (!params) { 
    return; 

In core.util/util.js:

gadgets.util.getFeatureParameters = function(feature) {
    return typeof features[feature] === 'undefined' ? null : 
features[feature];
  };

The features:

gadgets.util = gadgets.util || {};

(function() {

  var features = {};
  var services = {};

  /**
   * Initializes feature parameters.
   */
  function init(config) {
    features = config['core.util'] || {};
  }
  if (gadgets.config) {
    gadgets.config.register('core.util', null, init);
  }


------------------------------------------------
ERiK (Zheng BI) PMP
IBM Project Vulcan
China Development Lab, IBM Shanghai
TEL:(86-21)60922769
Internet ID: bizheng@cn.ibm.com
Addr: 5F, Building 10, No 399, Ke Yuan Road, Zhang Jiang High Tech Park, 
201203, Shanghai, China
------------------------------------------------



From:   Henry Saputra <he...@gmail.com>
To:     Zheng Bi/China/IBM@IBMCN
Cc:     dev@shindig.apache.org, Dan Dumont <dd...@us.ibm.com>, Ryan 
Baxter <rb...@gmail.com>, Stanton Sievers <si...@gmail.com>
Date:   2012/04/26 13:57
Subject:        Re: Review Request: Shindig does not accept relative URLs 
for template libraries



I dont think thats right. The CoreUtilConfigContributor is pusshing config 
change for "core.util" feature.

The JS code for opensocial-templates will not get the config param pushed 
from CoreUtilConfigContributor AFAK.

- Henry

On Wed, Apr 25, 2012 at 10:16 PM, Zheng Bi <bi...@cn.ibm.com> wrote:
Yes, that's exactly why we need to add the logic CoreUtilConfigContributor 
. 

In the feature opensocial-template, it read the template url from the 
glabal vairable gadgets.features using "var params = 
gadgets.util.getFeatureParameters(opensocial-templates')", which is 
initialized by the data pushed by CoreUtilConfigContributor. 

You can find the code in feature opensocial-template, container.js: 
os.Container.processGadget = function() { 
  if (!window['gadgets']) { 
    return; 
  } 
  var params = gadgets.util.getFeatureParameters(opensocial-templates'); 
  if (!params) { 
    return; 
.... 
  // Honor the "requireLibrary" feature param(s). 
  if (params.requireLibrary) { 
    if (typeof params.requireLibrary == 'string') { 
      os.Container.addRequiredLibrary(params.requireLibrary);



----------------------------------------------
ERiK (Zheng BI) PMP
IBM Project Vulcan
China Development Lab, IBM Shanghai
TEL:(86-21)60922769
Internet ID: bizheng@cn.ibm.com
Addr: 5F, Building 10, No 399, Ke Yuan Road, Zhang Jiang High Tech Park, 
201203, Shanghai, China
------------------------------------------------ 



From:        "Henry Saputra" <hs...@apache.org> 
To:        "Dan Dumont" <dd...@us.ibm.com>, "Stanton Sievers" <
sieverssj@gmail.com>, "Ryan Baxter" <rb...@gmail.com> 
Cc:        "Henry Saputra" <hs...@apache.org>, "shindig" <
dev@shindig.apache.org>, Zheng Bi/China/IBM@IBMCN 
Date:        2012/04/26 04:43 
Subject:        Re: Review Request: Shindig does not accept relative URLs 
for template libraries 




-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7243
-----------------------------------------------------------



http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java

<https://reviews.apache.org/r/4818/#comment15976>

   This seems the wrong approach for me. Each ConfigContributor 
responsible to add additional config from server.
   
   In this case the CoreUtilConfigContributor is used to add additional 
logic to push config to init function in the core.util feature.
   
   Not sure how the opensocial-templates JS code could read this new 
rewritten requireLibrary param.


- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton 
Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the 
template-libray, but right now when it uses this approach, client side 
will end up making a /gadgets/makeRequest call and passes in the relative 
URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the 
template-library URL value from global variable "features", so in this 
patch it updates the process of generating the init JS which will be 
passed back to client side to init the "features" variable(in Class 
"org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some 
specific logic to handle "template-library" parameter, convert the 
relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 
1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>




Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <he...@gmail.com>.
I dont think thats right. The CoreUtilConfigContributor is pusshing config
change for "core.util" feature.

The JS code for opensocial-templates will not get the config param pushed
from CoreUtilConfigContributor AFAK.

- Henry

On Wed, Apr 25, 2012 at 10:16 PM, Zheng Bi <bi...@cn.ibm.com> wrote:

> Yes, that's exactly why we need to add the logic CoreUtilConfigContributor
> .
>
> In the feature opensocial-template, it read the template url from the
> glabal vairable gadgets.features using *"var* params =
> gadgets.util.getFeatureParameters(opensocial-templates')", which is
> initialized by the data pushed by CoreUtilConfigContributor.
>
> You can find the code in feature opensocial-template, container.js:
>  os.Container.processGadget = *function*() {
>   *if* (!window['gadgets']) {
>     *return*;
>   }
>   *var* params = gadgets.util.getFeatureParameters(opensocial-templates');
>   *if* (!params) {
>     *return*;
> ....
>   // Honor the "requireLibrary" feature *param*(s).
>   *if* (params.requireLibrary) {
>     *if* (*typeof* params.requireLibrary == 'string') {
>       os.Container.addRequiredLibrary(params.requireLibrary);
>
>
> ----------------------------------------------
> ERiK (Zheng BI) PMP
> IBM Project Vulcan
> China Development Lab, IBM Shanghai
> TEL:(86-21)60922769
> Internet ID: bizheng@cn.ibm.com
> Addr: 5F, Building 10, No 399, Ke Yuan Road, Zhang Jiang High Tech Park,
> 201203, Shanghai, China
> ------------------------------------------------
>
>
>
> From:        "Henry Saputra" <hs...@apache.org>
> To:        "Dan Dumont" <dd...@us.ibm.com>, "Stanton Sievers" <
> sieverssj@gmail.com>, "Ryan Baxter" <rb...@gmail.com>
> Cc:        "Henry Saputra" <hs...@apache.org>, "shindig" <
> dev@shindig.apache.org>, Zheng Bi/China/IBM@IBMCN
> Date:        2012/04/26 04:43
> Subject:        Re: Review Request: Shindig does not accept relative URLs
> for template libraries
> ------------------------------
>
>
>
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/#review7243
> -----------------------------------------------------------
>
>
>
>
> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java
> <https://reviews.apache.org/r/4818/#comment15976>
>
>    This seems the wrong approach for me. Each ConfigContributor
> responsible to add additional config from server.
>
>    In this case the CoreUtilConfigContributor is used to add additional
> logic to push config to init function in the core.util feature.
>
>    Not sure how the opensocial-templates JS code could read this new
> rewritten requireLibrary param.
>
>
> - Henry
>
>
> On 2012-04-25 02:27:27, Erik Bi wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/4818/
> > -----------------------------------------------------------
> >
> > (Updated 2012-04-25 02:27:27)
> >
> >
> > Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> >
> >
> > Summary
> > -------
> >
> > per spec, Gadget should be able to use relative URL to define the
> template-libray, but right now when it uses this approach, client side will
> end up making a /gadgets/makeRequest call and passes in the relative URL
> value and fails with an HTTP status of 400.
> >
> > Solution:
> > At client side, the opensocial-template feature will get the
> template-library URL value from global variable "features", so in this
> patch it updates the process of generating the init JS which will be passed
> back to client side to init the "features" variable(in Class
> "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some
> specific logic to handle "template-library" parameter, convert the relative
> url to an absolute one.
> >
> >
> > This addresses bug shindig-1548.
> >     https://issues.apache.org/jira/browse/shindig-1548
> >
> >
> > Diffs
> > -----
> >
> >
> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java1327432
> >
> > Diff: https://reviews.apache.org/r/4818/diff
> >
> >
> > Testing
> > -------
> >
> >
> > Thanks,
> >
> > Erik
> >
> >
>
>
>

Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Zheng Bi <bi...@cn.ibm.com>.
Yes, that's exactly why we need to add the logic CoreUtilConfigContributor 
. 

In the feature opensocial-template, it read the template url from the 
glabal vairable gadgets.features using "var params = 
gadgets.util.getFeatureParameters(opensocial-templates')", which is 
initialized by the data pushed by CoreUtilConfigContributor. 

You can find the code in feature opensocial-template, container.js: 

os.Container.processGadget = function() {
  if (!window['gadgets']) {
    return;
  }
  var params = gadgets.util.getFeatureParameters(opensocial-templates');
  if (!params) {
    return;
....
  // Honor the "requireLibrary" feature param(s).
  if (params.requireLibrary) {
    if (typeof params.requireLibrary == 'string') {
      os.Container.addRequiredLibrary(params.requireLibrary);


----------------------------------------------
ERiK (Zheng BI) PMP
IBM Project Vulcan
China Development Lab, IBM Shanghai
TEL:(86-21)60922769
Internet ID: bizheng@cn.ibm.com
Addr: 5F, Building 10, No 399, Ke Yuan Road, Zhang Jiang High Tech Park, 
201203, Shanghai, China
------------------------------------------------



From:   "Henry Saputra" <hs...@apache.org>
To:     "Dan Dumont" <dd...@us.ibm.com>, "Stanton Sievers" 
<si...@gmail.com>, "Ryan Baxter" <rb...@gmail.com>
Cc:     "Henry Saputra" <hs...@apache.org>, "shindig" 
<de...@shindig.apache.org>, Zheng Bi/China/IBM@IBMCN
Date:   2012/04/26 04:43
Subject:        Re: Review Request: Shindig does not accept relative URLs 
for template libraries




-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7243
-----------------------------------------------------------



http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java

<https://reviews.apache.org/r/4818/#comment15976>

    This seems the wrong approach for me. Each ConfigContributor 
responsible to add additional config from server.
 
    In this case the CoreUtilConfigContributor is used to add additional 
logic to push config to init function in the core.util feature.
 
    Not sure how the opensocial-templates JS code could read this new 
rewritten requireLibrary param.


- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton 
Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the 
template-libray, but right now when it uses this approach, client side 
will end up making a /gadgets/makeRequest call and passes in the relative 
URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the 
template-library URL value from global variable "features", so in this 
patch it updates the process of generating the init JS which will be 
passed back to client side to init the "features" variable(in Class 
"org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some 
specific logic to handle "template-library" parameter, convert the 
relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 
1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>



Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7243
-----------------------------------------------------------



http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java
<https://reviews.apache.org/r/4818/#comment15976>

    This seems the wrong approach for me. Each ConfigContributor responsible to add additional config from server.
    
    In this case the CoreUtilConfigContributor is used to add additional logic to push config to init function in the core.util feature.
    
    Not sure how the opensocial-templates JS code could read this new rewritten requireLibrary param.


- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>


Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7221
-----------------------------------------------------------


Need time to review the flow but would be nice to add test gadget you use to validate the fix.

- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>


Re: Review Request: Shindig does not accept relative URLs for template libraries

Posted by Henry Saputra <hs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4818/#review7252
-----------------------------------------------------------

Ship it!


+1 LGTM


http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java
<https://reviews.apache.org/r/4818/#comment16030>

    Looks like I  was wrong. The core.util provides API to get the param for each feature.
    
    In this case opensocial-templates feature will call gadgets.util.getFeatureParameters(opensocial-templates') to get the requireLibrary param and its been fixed by the server code.


- Henry


On 2012-04-25 02:27:27, Erik Bi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4818/
> -----------------------------------------------------------
> 
> (Updated 2012-04-25 02:27:27)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, and Stanton Sievers.
> 
> 
> Summary
> -------
> 
> per spec, Gadget should be able to use relative URL to define the template-libray, but right now when it uses this approach, client side will end up making a /gadgets/makeRequest call and passes in the relative URL value and fails with an HTTP status of 400.
> 
> Solution: 
> At client side, the opensocial-template feature will get the template-library URL value from global variable "features", so in this patch it updates the process of generating the init JS which will be passed back to client side to init the "features" variable(in Class "org.apache.shindig.gadgets.config.CoreUtilConfigContributor"), adds some specific logic to handle "template-library" parameter, convert the relative url to an absolute one. 
> 
> 
> This addresses bug shindig-1548.
>     https://issues.apache.org/jira/browse/shindig-1548
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/config/CoreUtilConfigContributor.java 1327432 
> 
> Diff: https://reviews.apache.org/r/4818/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Erik
> 
>