Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] How to properly set {OrionHome} (WAR file issue)

The calculation in the client still needs to be fixed and I've retargeted https://bugs.eclipse.org/bugs/show_bug.cgi?id=373450 to RC1 but the code should be something along the lines of...

var temp = document.createElement("a");
temp.href = "">
var orionhome = temp.href;

or better still if you are using the W3C WebApps URL-shim (e.g. require(["orion/URL-shim"], function(){})) or if your browser natively supports it...)

var orionhome = new URL(require.toUrl("."), window.location).href;

-Simon


Inactive hide details for Javier H Pedemonte ---01/30/2013 12:16:58 PM---I've been trying to get Maqetta/Orion working when runJavier H Pedemonte ---01/30/2013 12:16:58 PM---I've been trying to get Maqetta/Orion working when running from a WAR file  [1].  We've fixed most o


    From:

Javier H Pedemonte <pedemont@xxxxxxxxxx>

    To:

orion-dev@xxxxxxxxxxx,

    Date:

01/30/2013 12:16 PM

    Subject:

[orion-dev] How to properly set {OrionHome} (WAR file issue)

    Sent by:

orion-dev-bounces@xxxxxxxxxxx




I've been trying to get Maqetta/Orion working when running from a WAR file [1].  We've fixed most of the Maqetta issues and identified some Orion ones. 

Now, I'm running into an issue where the Orion client doesn't work, due to the "OrionHome" variable.  As part of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=373450, it was set to the hostname of the loaded URL.  The problem is that when running from a WAR file, all URLs contain a base "context", corresponding to the name of the WAR file.  In our case, with a release named "maqetta.war", all URLs look like http(s)://[hostname]/maqetta/... -- but Orion fails because "OrionHome" is missing the "/maqetta" bit. 

I think I should be good to go if I can just properly set OrionHome in the 3 or 4 places it is set; most of Orion client seems to make direct use of this variable.  The question is how to set OrionHome correctly?  Does Orion already have some core code that could be useful in this case?  Is there an easy way to determine from which base URL Orion is running?
 

I already have some code (a bit of a hack, really) on the server that can tell if Maqetta/Orion is running from a WAR.  But what's the best way to get that information from the server to the client code?  If someone could point me to the correct Orion classes, I could get this working...
 


[1] Eclipse bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=377823 
   Maqetta bug:
https://github.com/maqetta/maqetta/issues/19 


Javier Pedemonte
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


GIF image

GIF image


Back to the top