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