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




Reply via email to