|
From: <tre...@us...> - 2008-02-13 14:20:54
|
Revision: 748
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=748&view=rev
Author: trevorolio
Date: 2008-02-13 06:20:56 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
Yet another tweak to try and convince the viewer applet not to throw security exceptions when running against round robin DNS.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.js
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/ogoglio.js
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.js 2008-02-13 04:20:59 UTC (rev 747)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.js 2008-02-13 14:20:56 UTC (rev 748)
@@ -439,14 +439,24 @@
}
function writeApplet(){
+ var loginCookie = getLoginCookie();
if(loginCookie == null){
appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
return;
}
- var serviceURI = getServiceURI();
- var html = "<applet id='viewer' codebase='" + serviceURI + "' code='com.ogoglio.bodyeditor.BodyEditorApplet' archive='ogoglio-common.jar,ogoglio-body-editor-applet.jar' width='300' height='400' mayscript='true'>";
+ requestService(handleService);
+}
+
+function handleService(serviceXML){
+ if(serviceXML == null){
+ appletDiv.innerHTML = "There was an error and I could not talk to the server. Sorry.";
+ return;
+ }
+ var loginCookie = getLoginCookie();
+ var serverIP = serviceXML.getAttribute("serverip"); //we pass this in because Firefox and Applets on XP can resolve different IPs using load balanced DNS
+ var html = "<applet id='viewer' codebase='" + getCodeBase(serverIP) + "' code='com.ogoglio.bodyeditor.BodyEditorApplet' archive='ogoglio-common.jar,ogoglio-body-editor-applet.jar' width='300' height='400' mayscript='true'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
- html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
+ html += "<param name='serviceURI' value='" + getCodeBase(serverIP) + "' />";
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
html += "</applet>";
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/ogoglio.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/ogoglio.js 2008-02-13 04:20:59 UTC (rev 747)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/ogoglio.js 2008-02-13 14:20:56 UTC (rev 748)
@@ -8,6 +8,11 @@
return locLink.protocol + "//" + locLink.host + appPath;
}
+function getCodeBase(serverIP){
+ var locLink = document.location;
+ return locLink.protocol + "//" + serverIP + (locLink.port == "" ? "" : ":" + locLink.port) + appPath;
+}
+
// Ignores Firebug (http://www.getfirebug.com/) console calls for browsers without firebug
if(!window.console || !console.firebug){
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js 2008-02-13 04:20:59 UTC (rev 747)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/spaceui.js 2008-02-13 14:20:56 UTC (rev 748)
@@ -99,11 +99,11 @@
}
var loginCookie = getLoginCookie();
var serverIP = serviceXML.getAttribute("serverip"); //we pass this in because Firefox and Applets on XP can resolve different IPs using load balanced DNS
- var serviceURI = getServiceURI();
+ var codeBase = getCodeBase(serverIP);
- var html = "<applet id='viewer' archive='ogoglio-common.jar,ogoglio-viewer-applet.jar' codebase='" + serviceURI + "' code='com.ogoglio.viewer.applet.ViewerApplet' width='" + viewerWidth + "' height='" + viewerHeight + "' mayscript='true'>";
+ var html = "<applet id='viewer' archive='ogoglio-common.jar,ogoglio-viewer-applet.jar' codebase='" + codeBase + "' code='com.ogoglio.viewer.applet.ViewerApplet' width='" + viewerWidth + "' height='" + viewerHeight + "' mayscript='true'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
- html += "<param name='serviceURI' value='" + serviceURI + "' />";
+ html += "<param name='serviceURI' value='" + codeBase + "' />";
html += "<param name='serverIP' value='" + serverIP + "' />";
html += "<param name='spaceID' value='" + locationParameters['spaceID'] + "' />";
html += "<param name='image' value='" + appletLoadingImagePath + "' />";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|