Yes, substitution is fine. However it doesn't like "gadget=...", "url=..."
works fine.
eg. background.jpg in todo gadget can't be resolved in this case.
thanks,
li


|------------>
| From:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Henry Saputra <[email protected]>                                      
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |[email protected]                                                       
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |05/20/2011 08:26 PM                                                          
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: question about common container configuraton initialization              
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|





You were saying that you saw error when trying to from gadget=%gadget% and
append /%rawurl% to prxyUrl in container.js?

The getProxyUrl() function should take care of substitution of the template
URL.

- Henry

On Fri, May 20, 2011 at 2:11 PM, Li Xu <[email protected]> wrote:

> Hi, Stanton
> thanks. that helps.
>
> I do notice the difference of the proxyUrl... wondering if this is a
bug...
> should the default be
> "...url=%url%%rewriteMime%" insteadof "...gadget=%gadget%/%rawurl%"?
>
> in init.js
>
>
>       'core.io': {
>         'jsonProxyUrl': 'http://%host%/gadgets/makeRequest',
>         'proxyUrl': 'http://%host%/gadgets/proxy' +
>             '?refresh=%refresh%' +
>             '&container=%container%%rewriteMime%' +
>             '&gadget=%gadget%/%rawurl%'
>       }
>
> in container.js
> "core.io" : {
>     "proxyUrl" : "//%host%${CONTEXT_ROOT}/gadgets/*proxy*
> ?container=%container%&refresh=%refresh%*&url*=%*url*%%rewriteMime%",
>   },
>
> Now container.js supports any context path, thinking about adding it to
the
> default value defined in init.js as well.
> One thought is to define window.__CONTAINER_CONTEXTPATH, so any container
> could easily pass in the value here as a default.
> any suggestions?
>
> thanks,
> li
>
>
> [image: Inactive hide details for Stanton Sievers---05/20/2011 03:32:38
> PM---Hi Li, In most cases, yes, the values initialized via init]Stanton
> Sievers---05/20/2011 03:32:38 PM---Hi Li, In most cases, yes, the values
> initialized via init.js will be overridden.
>
>
> From:
> Stanton Sievers/Westford/IBM@Lotus
> To:
> [email protected]
> Date:
> 05/20/2011 03:32 PM
> Subject:
> Re: question about common container configuraton initialization
> ------------------------------
>
>
>
> Hi Li,
>
> In most cases, yes, the values initialized via init.js will be
overridden.
> However, when you call gadgets.config.init it actually merges the given
> configuration with the new configuration using the "foldConfig" method.
> Thus if container.js doesn't have core.io and rpc configuration, the
> default values passed in init.js will still be there.
>
> I'm assuming that the initializeConfig function is either there for
> testing or as a fail-safe to make sure that some core configuration is
> always there.
>
> Best regards,
> -Stanton
>
>
>
> From:   Li Xu/Raleigh/IBM@IBMUS
> To:     [email protected],
> Date:   05/19/2011 16:45
> Subject:        question about common container configuraton
> initialization
>
>
>
>
> Hi, all
>
> We found configuration is actually initialized with values defined in
> container.js but not initialized with init.js.
> Since configuration defined in container.js is always injected, the value
> initialized by init.js got overwritten by the value defined in
> container.js.
> Is this a bug? can we remove this line in init.js?
> function initializeConfig() {
>    gadgets.config.init({
>      'rpc': {
>        'parentRelayUrl': ''
>      },
>      'core.io': {
>        'jsonProxyUrl': 'http://%host%/gadgets/makeRequest',
>        'proxyUrl': 'http://%host%/gadgets/proxy' +
>            '?refresh=%refresh%' +
>            '&container=%container%%rewriteMime%' +
>            '&gadget=%gadget%/%rawurl%'
>      }
>    });
>  }
>
> thanks,
> li
>
>
>
>
>
>
>


--
Thanks,

Henry

Reply via email to