Author: awiner
Date: Wed Jul 15 22:22:01 2009
New Revision: 794439
URL: http://svn.apache.org/viewvc?rev=794439&view=rev
Log:
Don't hardcode paths to servlets; put the full path in config, not just the
host
Modified:
incubator/shindig/trunk/config/container.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-current/feature.xml
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
Modified: incubator/shindig/trunk/config/container.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/config/container.js?rev=794439&r1=794438&r2=794439&view=diff
==============================================================================
--- incubator/shindig/trunk/config/container.js (original)
+++ incubator/shindig/trunk/config/container.js Wed Jul 15 22:22:01 2009
@@ -136,7 +136,9 @@
"opensocial-0.8" : {
// Path to fetch opensocial data from
// Must be on the same domain as the gadget rendering server
- "path" : "http://%host%",
+ "path" : "http://%host%/social/rpc",
+ // Path to issue invalidate calls
+ "invalidatePath" : "http://%host%/gadgets/api/rpc",
"domain" : "shindig",
"enableCaja" : false,
"supportedFields" : {
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-current/feature.xml
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-current/feature.xml?rev=794439&r1=794438&r2=794439&view=diff
==============================================================================
---
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-current/feature.xml
(original)
+++
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-current/feature.xml
Wed Jul 15 22:22:01 2009
@@ -34,13 +34,8 @@
gadgets.config.register("opensocial-0.8", requiredConfig,
function(config) {
- var configParams = config["opensocial-0.8"];
- var path = configParams.path;
- path = path.replace("%host%", document.location.host);
-
ShindigContainer = function() {
- JsonRpcContainer.call(this, path,
- configParams.domain, configParams.supportedFields);
+ JsonRpcContainer.call(this, config["opensocial-0.8"]);
};
ShindigContainer.inherits(JsonRpcContainer);
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js?rev=794439&r1=794438&r2=794439&view=diff
==============================================================================
---
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
(original)
+++
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
Wed Jul 15 22:22:01 2009
@@ -23,9 +23,19 @@
* @fileoverview JSON-RPC based opensocial container.
*/
-var JsonRpcContainer = function(baseUrl, domain, supportedFieldsArray) {
+var JsonRpcContainer = function(configParams) {
opensocial.Container.call(this);
+ var path = configParams.path;
+ // Path for social API calls
+ this.path_ = path.replace("%host%", document.location.host);
+
+ // Path for calls to invalidate
+ var invalidatePath = configParams.invalidatePath;
+ this.invalidatePath_ = invalidatePath.replace("%host%",
+ document.location.host);
+
+ var supportedFieldsArray = configParams.supportedFields;
var supportedFieldsMap = {};
for (var objectType in supportedFieldsArray) {
if (supportedFieldsArray.hasOwnProperty(objectType)) {
@@ -37,8 +47,8 @@
}
}
- this.environment_ = new opensocial.Environment(domain, supportedFieldsMap);
- this.baseUrl_ = baseUrl;
+ this.environment_ = new opensocial.Environment(configParams.domain,
+ supportedFieldsMap);
this.securityToken_ = shindig.auth.getSecurityToken();
@@ -206,7 +216,7 @@
"POST_DATA" : gadgets.json.stringify(jsonBatchData)
};
- var url = [this.baseUrl_, "/social/rpc"];
+ var url = [this.path_];
var token = shindig.auth.getSecurityToken();
if (token) {
url.push("?st=", encodeURIComponent(token));
@@ -439,7 +449,7 @@
"POST_DATA" : gadgets.json.stringify(rpc)
};
- var url = [this.baseUrl_, "/gadgets/api/rpc"];
+ var url = [this.invalidatePath_];
var token = shindig.auth.getSecurityToken();
if (token) {
url.push("?st=", encodeURIComponent(token));