|
|
|
Nolte, Tim
|
FYI, this bug fix breaks in MapServer installs. I see that it has been
hard-coded to 'layers/MapGuide/php/CreateSession.php' which isn't valid for MapServer. Seems like somehow we need a more generic way for creating the session. I'm not familiar with how MapGuide works with sessions but for the most part we are looking at PHP sessions which should be pretty standard. What are the thoughts here? - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email] Sent: Sunday, November 08, 2009 10:16 PM To: [hidden email] Subject: [fusion-commits] r1966 - trunk/lib Author: liuar Date: 2009-11-08 22:15:36 -0500 (Sun, 08 Nov 2009) New Revision: 1966 Modified: trunk/lib/fusion.js Log: Fixed http://trac.osgeo.org/fusion/ticket/300 pre-create a session to avoid the unauthorized dialog, which is a defect of safari and chrome. Modified: trunk/lib/fusion.js =================================================================== --- trunk/lib/fusion.js 2009-11-06 16:05:28 UTC (rev 1965) +++ trunk/lib/fusion.js 2009-11-09 03:15:36 UTC (rev 1966) @@ -227,7 +227,8 @@ initialize : function(options) { options = options || {}; var sessionIdParam = this.getQueryParam('Session'); - this.sessionId = sessionIdParam || (options.sessionId || null); + // Override the pre-created sessionId by user specified sessionId(if exist) + this.sessionId = sessionIdParam || options.sessionId || this.sessionId; if (options.applicationDefinitionURL) { this.applicationDefinitionURL = options.applicationDefinitionURL; @@ -252,11 +253,11 @@ this.sScriptLang = ""; /* - * if the application has been loaded from the same host as - * fusion is installed in, then technically we don't need to - * use the redirect script because we conform to the - * Same Origin Policy for XmlHttpRequest to work. - */ + * if the application has been loaded from the same host as + * fusion is installed in, then technically we don't need to + * use the redirect script because we conform to the + * Same Origin Policy for XmlHttpRequest to work. + */ var test = window.location.protocol+'//'+window.location.host; var configUrl = 'config.json'; //if (this.fusionURL.indexOf(test,0) == 0) { @@ -1147,7 +1148,7 @@ var fusionURL = r + Fusion.getFusionURL() + configUrl; - var xhr = new XMLHttpRequest(); + var xhr = getXmlHttpRequest(); xhr.open("GET", fusionURL, false); xhr.send(null); @@ -1174,7 +1175,7 @@ } Fusion.configuration.mapguide.mapAgentUrl = s + 'mapagent/mapagent.fcgi'; return Fusion.configuration.mapguide.mapAgentUrl; - } + } var addElement = function(element) { if (!element) { @@ -1188,29 +1189,50 @@ } document.writeln('<script src="' + src + '"><\/script>'); - } + } - if(navigator.userAgent.indexOf("MSIE")>0 || navigator.userAgent.indexOf("Firefox")>0){ - var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); - if(appDefUrl){ - - var xhr = new XMLHttpRequest(); - var mapAgentUrl = getAgentUrl(); - xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); - xhr.send(null); - var appDefXML = xhr.responseXML.documentElement; - - if(appDefXML){ - var googleElement = appDefXML.getElementsByTagName("GoogleScript")[0]; - var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0]; - var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0]; + var getXmlHttpRequest = function(){ + try { return new XMLHttpRequest(); } + catch (e) { try { return new ActiveXObject('Msxml2.XMLHTTP'); } + catch (e) { try { return new ActiveXObject('Microsoft.XMLHTTP'); } + catch (e) { return null; }}} + } + + /** + * Function: createSessionId + * + * Pre-create a session to avoid the 401 Unauthorized dialog + * + */ + var createSessionId = function(){ + var xhr = getXmlHttpRequest(); + xhr.open("GET", Fusion.fusionURL+"layers/MapGuide/php/CreateSession.php",false); + xhr.send(null); + var o; + eval('o='+xhr.responseText); + Fusion.sessionId = o.sessionId; + } + + createSessionId(); + var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); + if(appDefUrl){ + var xhr = new getXmlHttpRequest(); + var mapAgentUrl = getAgentUrl(); + xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml&SESSION="+ Fusion.sessionId, false); + xhr.send(null); + var appDefXML = xhr.responseXML.documentElement; + + if(appDefXML){ + var googleElement = appDefXML.getElementsByTagName("GoogleScript")[0]; + var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0]; + var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0]; - addElement(googleElement); - addElement(yahooElement); - addElement(veElement); - } + addElement(googleElement); + addElement(yahooElement); + addElement(veElement); } } + })(); _______________________________________________ fusion-commits mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-commits _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Paul Spencer-2
|
I think Zak is working on a more generic solution here. The code here
should not have affected MapServer, it should only be invoked when the application definition is being loaded from a URL that starts with Library:// which indicates it is stored in a MapGuide repository. The original issue that was being solved was how to automatically add commercial mapping APIs to an application - this required knowing if any of them are referenced in an Application Definition which required pre-requesting the ApplicationDefinition - which, when stored in a MapGuide repository issues an authentication challenge unless using a pre-established session - which is what this commit was about. Zak is going to try refactoring this to work generically for MapServer and MapGuide by moving the code so that it runs at a slightly later time in initialization. Cheers Paul On 2009-11-09, at 1:49 PM, Nolte, Tim wrote: > FYI, this bug fix breaks in MapServer installs. I see that it has been > hard-coded to 'layers/MapGuide/php/CreateSession.php' which isn't > valid > for MapServer. Seems like somehow we need a more generic way for > creating the session. I'm not familiar with how MapGuide works with > sessions but for the most part we are looking at PHP sessions which > should be pretty standard. What are the thoughts here? > > - Tim > > ---- > Timothy J Nolte - [hidden email] > Network Planning Engineer > > iPCS Wireless, Inc. > 4717 Broadmoor Ave, Suite G > Kentwood, MI 49512 > > Office: 616-656-5163 > PCS: 616-706-2438 > Fax: 616-554-6484 > Web: www.ipcswirelessinc.com > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of > [hidden email] > Sent: Sunday, November 08, 2009 10:16 PM > To: [hidden email] > Subject: [fusion-commits] r1966 - trunk/lib > > Author: liuar > Date: 2009-11-08 22:15:36 -0500 (Sun, 08 Nov 2009) > New Revision: 1966 > > Modified: > trunk/lib/fusion.js > Log: > Fixed http://trac.osgeo.org/fusion/ticket/300 > pre-create a session to avoid the unauthorized dialog, which is a > defect > of safari and chrome. > > Modified: trunk/lib/fusion.js > =================================================================== > --- trunk/lib/fusion.js 2009-11-06 16:05:28 UTC (rev 1965) > +++ trunk/lib/fusion.js 2009-11-09 03:15:36 UTC (rev 1966) > @@ -227,7 +227,8 @@ > initialize : function(options) { > options = options || {}; > var sessionIdParam = this.getQueryParam('Session'); > - this.sessionId = sessionIdParam || (options.sessionId || > null); > + // Override the pre-created sessionId by user > specified sessionId(if exist) > + this.sessionId = sessionIdParam || > options.sessionId || this.sessionId; > > if (options.applicationDefinitionURL) { > this.applicationDefinitionURL = > options.applicationDefinitionURL; > @@ -252,11 +253,11 @@ > this.sScriptLang = ""; > > /* > - * if the application has been loaded from the > same > host as > - * fusion is installed in, then technically we > don't need to > - * use the redirect script because we conform to > the > - * Same Origin Policy for XmlHttpRequest to work. > - */ > + * if the application has been loaded from the > same host as > + * fusion is installed in, then technically we > don't need to > + * use the redirect script because we conform to > the > + * Same Origin Policy for XmlHttpRequest to > work. > + */ > var test = > window.location.protocol+'//'+window.location.host; > var configUrl = 'config.json'; > //if (this.fusionURL.indexOf(test,0) == 0) { > @@ -1147,7 +1148,7 @@ > > var fusionURL = r + Fusion.getFusionURL() + configUrl; > > - var xhr = new XMLHttpRequest(); > + var xhr = getXmlHttpRequest(); > xhr.open("GET", fusionURL, false); > xhr.send(null); > > @@ -1174,7 +1175,7 @@ > } > Fusion.configuration.mapguide.mapAgentUrl = s + > 'mapagent/mapagent.fcgi'; > return Fusion.configuration.mapguide.mapAgentUrl; > - } > + } > > var addElement = function(element) { > if (!element) { > @@ -1188,29 +1189,50 @@ > } > > document.writeln('<script src="' + src + '"><\/script>'); > - } > + } > > - if(navigator.userAgent.indexOf("MSIE")>0 || > navigator.userAgent.indexOf("Firefox")>0){ > - var appDefUrl = > Fusion.getQueryParam('ApplicationDefinition'); > - if(appDefUrl){ > - > - var xhr = new XMLHttpRequest(); > - var mapAgentUrl = getAgentUrl(); > - xhr.open("GET", mapAgentUrl + > "? > OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu > ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); > - xhr.send(null); > - var appDefXML = xhr.responseXML.documentElement; > > - > - if(appDefXML){ > - var googleElement = > appDefXML.getElementsByTagName("GoogleScript")[0]; > - var yahooElement = > appDefXML.getElementsByTagName("YahooScript")[0]; > - var veElement = > appDefXML.getElementsByTagName("VirtualEarthScript")[0]; > + var getXmlHttpRequest = function(){ > + try { return new XMLHttpRequest(); } > + catch (e) { try { return new > ActiveXObject('Msxml2.XMLHTTP'); } > + catch (e) { try { return new > ActiveXObject('Microsoft.XMLHTTP'); } > + catch (e) { return null; }}} > + } > + > + /** > + * Function: createSessionId > + * > + * Pre-create a session to avoid the 401 Unauthorized dialog > + * > + */ > + var createSessionId = function(){ > + var xhr = getXmlHttpRequest(); > + xhr.open("GET", > Fusion.fusionURL+"layers/MapGuide/php/CreateSession.php",false); > + xhr.send(null); > + var o; > + eval('o='+xhr.responseText); > + Fusion.sessionId = o.sessionId; > + } > + > + createSessionId(); > + var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); > + if(appDefUrl){ > + var xhr = new getXmlHttpRequest(); > + var mapAgentUrl = getAgentUrl(); > + xhr.open("GET", mapAgentUrl + > "? > OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu > ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text > %2Fxml&SESSION="+ > Fusion.sessionId, false); > + xhr.send(null); > + var appDefXML = xhr.responseXML.documentElement; > + > + if(appDefXML){ > + var googleElement = > appDefXML.getElementsByTagName("GoogleScript")[0]; > + var yahooElement = > appDefXML.getElementsByTagName("YahooScript")[0]; > + var veElement = > appDefXML.getElementsByTagName("VirtualEarthScript")[0]; > > - addElement(googleElement); > - addElement(yahooElement); > - addElement(veElement); > - } > + addElement(googleElement); > + addElement(yahooElement); > + addElement(veElement); > } > } > + > > })(); > > > _______________________________________________ > fusion-commits mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/fusion-commits > > _______________________________________________ > fusion-dev mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/fusion-dev __________________________________________ Paul Spencer Chief Technology Officer DM Solutions Group Inc http://research.dmsolutions.ca/ _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Nolte, Tim
|
Sounds good. Just wanted to bring it up. Perhaps I should have just made
the comment on TRAC directly instead of here. If that is the recommendation please just say the word. It's interesting that you say that this should only apply to MapGuide installs and shouldn't affect MapServer installs. Not sure but I was actually getting JavaScript errors in Firebug with these code changes. - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Spencer Sent: Monday, November 09, 2009 1:55 PM To: Nolte, Tim Cc: [hidden email] Subject: Re: [fusion-dev] RE: [fusion-commits] r1966 - trunk/lib I think Zak is working on a more generic solution here. The code here should not have affected MapServer, it should only be invoked when the application definition is being loaded from a URL that starts with Library:// which indicates it is stored in a MapGuide repository. The original issue that was being solved was how to automatically add commercial mapping APIs to an application - this required knowing if any of them are referenced in an Application Definition which required pre-requesting the ApplicationDefinition - which, when stored in a MapGuide repository issues an authentication challenge unless using a pre-established session - which is what this commit was about. Zak is going to try refactoring this to work generically for MapServer and MapGuide by moving the code so that it runs at a slightly later time in initialization. Cheers Paul On 2009-11-09, at 1:49 PM, Nolte, Tim wrote: > FYI, this bug fix breaks in MapServer installs. I see that it has been > hard-coded to 'layers/MapGuide/php/CreateSession.php' which isn't > valid > for MapServer. Seems like somehow we need a more generic way for > creating the session. I'm not familiar with how MapGuide works with > sessions but for the most part we are looking at PHP sessions which > should be pretty standard. What are the thoughts here? > > - Tim > > ---- > Timothy J Nolte - [hidden email] > Network Planning Engineer > > iPCS Wireless, Inc. > 4717 Broadmoor Ave, Suite G > Kentwood, MI 49512 > > Office: 616-656-5163 > PCS: 616-706-2438 > Fax: 616-554-6484 > Web: www.ipcswirelessinc.com > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of > [hidden email] > Sent: Sunday, November 08, 2009 10:16 PM > To: [hidden email] > Subject: [fusion-commits] r1966 - trunk/lib > > Author: liuar > Date: 2009-11-08 22:15:36 -0500 (Sun, 08 Nov 2009) > New Revision: 1966 > > Modified: > trunk/lib/fusion.js > Log: > Fixed http://trac.osgeo.org/fusion/ticket/300 > pre-create a session to avoid the unauthorized dialog, which is a > defect > of safari and chrome. > > Modified: trunk/lib/fusion.js > =================================================================== > --- trunk/lib/fusion.js 2009-11-06 16:05:28 UTC (rev 1965) > +++ trunk/lib/fusion.js 2009-11-09 03:15:36 UTC (rev 1966) > @@ -227,7 +227,8 @@ > initialize : function(options) { > options = options || {}; > var sessionIdParam = this.getQueryParam('Session'); > - this.sessionId = sessionIdParam || (options.sessionId || > null); > + // Override the pre-created sessionId by user > specified sessionId(if exist) > + this.sessionId = sessionIdParam || > options.sessionId || this.sessionId; > > if (options.applicationDefinitionURL) { > this.applicationDefinitionURL = > options.applicationDefinitionURL; > @@ -252,11 +253,11 @@ > this.sScriptLang = ""; > > /* > - * if the application has been loaded from the > same > host as > - * fusion is installed in, then technically we > don't need to > - * use the redirect script because we conform to > the > - * Same Origin Policy for XmlHttpRequest to work. > - */ > + * if the application has been loaded from the > same host as > + * fusion is installed in, then technically we > don't need to > + * use the redirect script because we conform to > the > + * Same Origin Policy for XmlHttpRequest to > work. > + */ > var test = > window.location.protocol+'//'+window.location.host; > var configUrl = 'config.json'; > //if (this.fusionURL.indexOf(test,0) == 0) { > @@ -1147,7 +1148,7 @@ > > var fusionURL = r + Fusion.getFusionURL() + configUrl; > > - var xhr = new XMLHttpRequest(); > + var xhr = getXmlHttpRequest(); > xhr.open("GET", fusionURL, false); > xhr.send(null); > > @@ -1174,7 +1175,7 @@ > } > Fusion.configuration.mapguide.mapAgentUrl = s + > 'mapagent/mapagent.fcgi'; > return Fusion.configuration.mapguide.mapAgentUrl; > - } > + } > > var addElement = function(element) { > if (!element) { > @@ -1188,29 +1189,50 @@ > } > > document.writeln('<script src="' + src + '"><\/script>'); > - } > + } > > - if(navigator.userAgent.indexOf("MSIE")>0 || > navigator.userAgent.indexOf("Firefox")>0){ > - var appDefUrl = > Fusion.getQueryParam('ApplicationDefinition'); > - if(appDefUrl){ > - > - var xhr = new XMLHttpRequest(); > - var mapAgentUrl = getAgentUrl(); > - xhr.open("GET", mapAgentUrl + > "? > OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu > ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); > - xhr.send(null); > - var appDefXML = xhr.responseXML.documentElement; > > - > - if(appDefXML){ > - var googleElement = > appDefXML.getElementsByTagName("GoogleScript")[0]; > - var yahooElement = > appDefXML.getElementsByTagName("YahooScript")[0]; > - var veElement = > appDefXML.getElementsByTagName("VirtualEarthScript")[0]; > + var getXmlHttpRequest = function(){ > + try { return new XMLHttpRequest(); } > + catch (e) { try { return new > ActiveXObject('Msxml2.XMLHTTP'); } > + catch (e) { try { return new > ActiveXObject('Microsoft.XMLHTTP'); } > + catch (e) { return null; }}} > + } > + > + /** > + * Function: createSessionId > + * > + * Pre-create a session to avoid the 401 Unauthorized dialog > + * > + */ > + var createSessionId = function(){ > + var xhr = getXmlHttpRequest(); > + xhr.open("GET", > Fusion.fusionURL+"layers/MapGuide/php/CreateSession.php",false); > + xhr.send(null); > + var o; > + eval('o='+xhr.responseText); > + Fusion.sessionId = o.sessionId; > + } > + > + createSessionId(); > + var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); > + if(appDefUrl){ > + var xhr = new getXmlHttpRequest(); > + var mapAgentUrl = getAgentUrl(); > + xhr.open("GET", mapAgentUrl + > "? > OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu > ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text > %2Fxml&SESSION="+ > Fusion.sessionId, false); > + xhr.send(null); > + var appDefXML = xhr.responseXML.documentElement; > + > + if(appDefXML){ > + var googleElement = > appDefXML.getElementsByTagName("GoogleScript")[0]; > + var yahooElement = > appDefXML.getElementsByTagName("YahooScript")[0]; > + var veElement = > appDefXML.getElementsByTagName("VirtualEarthScript")[0]; > > - addElement(googleElement); > - addElement(yahooElement); > - addElement(veElement); > - } > + addElement(googleElement); > + addElement(yahooElement); > + addElement(veElement); > } > } > + > > })(); > > > _______________________________________________ > fusion-commits mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/fusion-commits > > _______________________________________________ > fusion-dev mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/fusion-dev __________________________________________ Paul Spencer Chief Technology Officer DM Solutions Group Inc http://research.dmsolutions.ca/ _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Paul Spencer-2
|
here is fine, sometimes the trac emails get lost in the mix :) I'm
not sure either, which was why I mentioned that it should only be affecting that one specific case - there must be a problem with that code and we will need to fix it if the other approach doesn't work. Paul On 2009-11-09, at 2:09 PM, Nolte, Tim wrote: > Sounds good. Just wanted to bring it up. Perhaps I should have just > made > the comment on TRAC directly instead of here. If that is the > recommendation please just say the word. It's interesting that you say > that this should only apply to MapGuide installs and shouldn't affect > MapServer installs. Not sure but I was actually getting JavaScript > errors in Firebug with these code changes. > > - Tim > > ---- > Timothy J Nolte - [hidden email] > Network Planning Engineer > > iPCS Wireless, Inc. > 4717 Broadmoor Ave, Suite G > Kentwood, MI 49512 > > Office: 616-656-5163 > PCS: 616-706-2438 > Fax: 616-554-6484 > Web: www.ipcswirelessinc.com > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of Paul Spencer > Sent: Monday, November 09, 2009 1:55 PM > To: Nolte, Tim > Cc: [hidden email] > Subject: Re: [fusion-dev] RE: [fusion-commits] r1966 - trunk/lib > > I think Zak is working on a more generic solution here. The code here > should not have affected MapServer, it should only be invoked when the > application definition is being loaded from a URL that starts with > Library:// which indicates it is stored in a MapGuide repository. The > original issue that was being solved was how to automatically add > commercial mapping APIs to an application - this required knowing if > any of them are referenced in an Application Definition which required > pre-requesting the ApplicationDefinition - which, when stored in a > MapGuide repository issues an authentication challenge unless using a > pre-established session - which is what this commit was about. > > Zak is going to try refactoring this to work generically for MapServer > and MapGuide by moving the code so that it runs at a slightly later > time in initialization. > > Cheers > > Paul > > On 2009-11-09, at 1:49 PM, Nolte, Tim wrote: > >> FYI, this bug fix breaks in MapServer installs. I see that it has >> been >> hard-coded to 'layers/MapGuide/php/CreateSession.php' which isn't >> valid >> for MapServer. Seems like somehow we need a more generic way for >> creating the session. I'm not familiar with how MapGuide works with >> sessions but for the most part we are looking at PHP sessions which >> should be pretty standard. What are the thoughts here? >> >> - Tim >> >> ---- >> Timothy J Nolte - [hidden email] >> Network Planning Engineer >> >> iPCS Wireless, Inc. >> 4717 Broadmoor Ave, Suite G >> Kentwood, MI 49512 >> >> Office: 616-656-5163 >> PCS: 616-706-2438 >> Fax: 616-554-6484 >> Web: www.ipcswirelessinc.com >> -----Original Message----- >> From: [hidden email] >> [mailto:[hidden email]] On Behalf Of >> [hidden email] >> Sent: Sunday, November 08, 2009 10:16 PM >> To: [hidden email] >> Subject: [fusion-commits] r1966 - trunk/lib >> >> Author: liuar >> Date: 2009-11-08 22:15:36 -0500 (Sun, 08 Nov 2009) >> New Revision: 1966 >> >> Modified: >> trunk/lib/fusion.js >> Log: >> Fixed http://trac.osgeo.org/fusion/ticket/300 >> pre-create a session to avoid the unauthorized dialog, which is a >> defect >> of safari and chrome. >> >> Modified: trunk/lib/fusion.js >> =================================================================== >> --- trunk/lib/fusion.js 2009-11-06 16:05:28 UTC (rev 1965) >> +++ trunk/lib/fusion.js 2009-11-09 03:15:36 UTC (rev 1966) >> @@ -227,7 +227,8 @@ >> initialize : function(options) { >> options = options || {}; >> var sessionIdParam = this.getQueryParam('Session'); >> - this.sessionId = sessionIdParam || (options.sessionId || >> null); >> + // Override the pre-created sessionId by user >> specified sessionId(if exist) >> + this.sessionId = sessionIdParam || >> options.sessionId || this.sessionId; >> >> if (options.applicationDefinitionURL) { >> this.applicationDefinitionURL = >> options.applicationDefinitionURL; >> @@ -252,11 +253,11 @@ >> this.sScriptLang = ""; >> >> /* >> - * if the application has been loaded from the >> same >> host as >> - * fusion is installed in, then technically we >> don't need to >> - * use the redirect script because we conform to >> the >> - * Same Origin Policy for XmlHttpRequest to >> work. >> - */ >> + * if the application has been loaded from the >> same host as >> + * fusion is installed in, then technically we >> don't need to >> + * use the redirect script because we conform to >> the >> + * Same Origin Policy for XmlHttpRequest to >> work. >> + */ >> var test = >> window.location.protocol+'//'+window.location.host; >> var configUrl = 'config.json'; >> //if (this.fusionURL.indexOf(test,0) == 0) { >> @@ -1147,7 +1148,7 @@ >> >> var fusionURL = r + Fusion.getFusionURL() + configUrl; >> >> - var xhr = new XMLHttpRequest(); >> + var xhr = getXmlHttpRequest(); >> xhr.open("GET", fusionURL, false); >> xhr.send(null); >> >> @@ -1174,7 +1175,7 @@ >> } >> Fusion.configuration.mapguide.mapAgentUrl = s + >> 'mapagent/mapagent.fcgi'; >> return Fusion.configuration.mapguide.mapAgentUrl; >> - } >> + } >> >> var addElement = function(element) { >> if (!element) { >> @@ -1188,29 +1189,50 @@ >> } >> >> document.writeln('<script src="' + src + '"><\/script>'); >> - } >> + } >> >> - if(navigator.userAgent.indexOf("MSIE")>0 || >> navigator.userAgent.indexOf("Firefox")>0){ >> - var appDefUrl = >> Fusion.getQueryParam('ApplicationDefinition'); >> - if(appDefUrl){ >> - >> - var xhr = new XMLHttpRequest(); >> - var mapAgentUrl = getAgentUrl(); >> - xhr.open("GET", mapAgentUrl + >> "? >> OPERATION >> =GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu >> ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", >> false); >> - xhr.send(null); >> - var appDefXML = xhr.responseXML.documentElement; >> >> - >> - if(appDefXML){ >> - var googleElement = >> appDefXML.getElementsByTagName("GoogleScript")[0]; >> - var yahooElement = >> appDefXML.getElementsByTagName("YahooScript")[0]; >> - var veElement = >> appDefXML.getElementsByTagName("VirtualEarthScript")[0]; >> + var getXmlHttpRequest = function(){ >> + try { return new XMLHttpRequest(); } >> + catch (e) { try { return new >> ActiveXObject('Msxml2.XMLHTTP'); } >> + catch (e) { try { return new >> ActiveXObject('Microsoft.XMLHTTP'); } >> + catch (e) { return null; }}} >> + } >> + >> + /** >> + * Function: createSessionId >> + * >> + * Pre-create a session to avoid the 401 Unauthorized dialog >> + * >> + */ >> + var createSessionId = function(){ >> + var xhr = getXmlHttpRequest(); >> + xhr.open("GET", >> Fusion.fusionURL+"layers/MapGuide/php/CreateSession.php",false); >> + xhr.send(null); >> + var o; >> + eval('o='+xhr.responseText); >> + Fusion.sessionId = o.sessionId; >> + } >> + >> + createSessionId(); >> + var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); >> + if(appDefUrl){ >> + var xhr = new getXmlHttpRequest(); >> + var mapAgentUrl = getAgentUrl(); >> + xhr.open("GET", mapAgentUrl + >> "? >> OPERATION >> =GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGu >> ide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text >> %2Fxml&SESSION="+ >> Fusion.sessionId, false); >> + xhr.send(null); >> + var appDefXML = xhr.responseXML.documentElement; >> + >> + if(appDefXML){ >> + var googleElement = >> appDefXML.getElementsByTagName("GoogleScript")[0]; >> + var yahooElement = >> appDefXML.getElementsByTagName("YahooScript")[0]; >> + var veElement = >> appDefXML.getElementsByTagName("VirtualEarthScript")[0]; >> >> - addElement(googleElement); >> - addElement(yahooElement); >> - addElement(veElement); >> - } >> + addElement(googleElement); >> + addElement(yahooElement); >> + addElement(veElement); >> } >> } >> + >> >> })(); >> >> >> _______________________________________________ >> fusion-commits mailing list >> [hidden email] >> http://lists.osgeo.org/mailman/listinfo/fusion-commits >> >> _______________________________________________ >> fusion-dev mailing list >> [hidden email] >> http://lists.osgeo.org/mailman/listinfo/fusion-dev > > > __________________________________________ > > Paul Spencer > Chief Technology Officer > DM Solutions Group Inc > http://research.dmsolutions.ca/ > > _______________________________________________ > fusion-dev mailing list > [hidden email] > http://lists.osgeo.org/mailman/listinfo/fusion-dev > __________________________________________ Paul Spencer Chief Technology Officer DM Solutions Group Inc http://research.dmsolutions.ca/ _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Nolte, Tim
|
Hey All,
Can someone with a working MapGuide development environment test out the changes I've made to the Legend.js file. I don't have my MapGuide install setup yet to test that side of things. Everything is working just fine on the MapServer side. Once I get confirmation that all is good I will submit all my changes for the Legend issues in MapServer. Thanks! - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Nolte, Tim
|
In reply to this post
by Paul Spencer-2
Hey Paul,
Again just trying to make sure I'm following the correct protocols here. I'm ready to commit some changes to the trunk. Is there a code review/approval process that I need to follow? Also, for any changes that I make should I be creating a Trac ticket if there isn't one already, so that I can tag my commit with a ticket #? Thanks! - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
|
Paul Spencer-2
|
No particular process but for larger commits that potentially break
lots of stuff, it would be good to post a patch (use svn diff) for review. You should be creating/using tickets for all commits but for trivial ones like whitespace and documentation updates we don't bother normally. Sometimes a commit slips through without a ticket though, that's usually okay but if it is an important improvement its good to record it somewhere where it can be noted in the release notes. Cheers Paul On 2009-11-10, at 8:47 AM, Nolte, Tim wrote: > Hey Paul, > > Again just trying to make sure I'm following the correct protocols > here. > I'm ready to commit some changes to the trunk. Is there a code > review/approval process that I need to follow? Also, for any changes > that I make should I be creating a Trac ticket if there isn't one > already, so that I can tag my commit with a ticket #? Thanks! > > - Tim > > ---- > Timothy J Nolte - [hidden email] > Network Planning Engineer > > iPCS Wireless, Inc. > 4717 Broadmoor Ave, Suite G > Kentwood, MI 49512 > > Office: 616-656-5163 > PCS: 616-706-2438 > Fax: 616-554-6484 > Web: www.ipcswirelessinc.com __________________________________________ Paul Spencer Chief Technology Officer DM Solutions Group Inc http://research.dmsolutions.ca/ _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Nolte, Tim
|
So I have had a problem where my multiple maps (OpenLayers layer) have
not been stacked in the right order according to my ApplicationDefinition. It appears that with the current process for loading maps is more synchronous this is causing OpenLayers to apply a z-index based on which image has been rendered first. Are others aware of this, or have others experienced the same issue? As I've looked into the OpenLayers API there seems like a possibility of perhaps specifying a z-index to be used when a layer is rendered. This would allow us to add an additional layer variable for storing the predefined z-index to be used by OpenLayer when rendering which would allow layers to still be rendered synchronously and have them stacked in the expected order. What are the thoughts on this? Is this a possible solution? - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
|
Nolte, Tim
|
So I have figured out a fix for this. Can anyone verify if they see this
problem in MapGuide as well? I'm not sure if it is typical to build multiple MapGuide layers into a MapGroup or not. This works very nicely on the MapServer side. - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Nolte, Tim Sent: Wednesday, November 11, 2009 9:32 AM To: [hidden email] Subject: [fusion-dev] OpenLayers Layer z-indexes So I have had a problem where my multiple maps (OpenLayers layer) have not been stacked in the right order according to my ApplicationDefinition. It appears that with the current process for loading maps is more synchronous this is causing OpenLayers to apply a z-index based on which image has been rendered first. Are others aware of this, or have others experienced the same issue? As I've looked into the OpenLayers API there seems like a possibility of perhaps specifying a z-index to be used when a layer is rendered. This would allow us to add an additional layer variable for storing the predefined z-index to be used by OpenLayer when rendering which would allow layers to still be rendered synchronously and have them stacked in the expected order. What are the thoughts on this? Is this a possible solution? - Tim ---- Timothy J Nolte - [hidden email] Network Planning Engineer iPCS Wireless, Inc. 4717 Broadmoor Ave, Suite G Kentwood, MI 49512 Office: 616-656-5163 PCS: 616-706-2438 Fax: 616-554-6484 Web: www.ipcswirelessinc.com _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev _______________________________________________ fusion-dev mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/fusion-dev |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |