Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 373450 - URI Template/PageUtil should support an {OrionHome} variable
Summary: URI Template/PageUtil should support an {OrionHome} variable
Status: CLOSED WONTFIX
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 362067
  Show dependency tree
 
Reported: 2012-03-06 18:22 EST by Susan McCourt CLA
Modified: 2017-01-10 15:46 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2012-03-06 18:22:46 EST
It might be necessary for a plugin (hosted at, say, github) to pass an Orion URL to another site.  So we need to know the fully qualified path of the orion instance.

Simon suggested we might have metadata on every object such as OrionHome.  
Then someone expanding a URI template from a plugin could use this metadata to expand the template.

Right now I have hardcoded parsing of window.location.href into a hostname and build fake metadata with "OrionHome" property specified.

Another issue is that currently the "Location" property in our metadata is relative.  This means that if a plugin wants to pass a location to another site, it's not going to be correct.  We need a way to build a fully qualified path from a Location property.  Simon suggested that we probably should be using fully qualified paths in the URI template rather than the relative ones, or perhaps we would have helper methods to fully qualify a path.
Comment 1 Susan McCourt CLA 2012-03-20 11:56:55 EDT
I currently have extension points in three places spoofing up this variable.
Comment 2 libing wang CLA 2012-04-13 11:21:34 EDT
I think Bug 376729  depends on this. But please remove the dependency if otherwise, Susan.
Comment 3 Susan McCourt CLA 2012-04-13 12:31:52 EDT
(In reply to comment #2)
> I think Bug 376729  depends on this. But please remove the dependency if
> otherwise, Susan.

Removing dependency.  Having this bug implemented means we could do the hostname construction in one place for sure.  But this is more a bug about making the variable available, and bug 376729 is about the parsing being wrong.
Comment 4 Susan McCourt CLA 2012-04-13 12:54:27 EDT
Marking M2 because this is a plugin API issue.
Two issues:

- making OrionHome universally available via PageUtil...so that any code that wants to pass OrionHome can get it without having to calculate it.  (use cases are bug 376726, the pixlr plugin, etc.  places where we want to tell another site how to get back to Orion)

- deciding whether metadata.Location includes the hostname.  For example, we currently have to use {OrionHome}{Location} to get a full path to something.  Should this be necessary?
Comment 5 Simon Kaegi CLA 2012-05-28 12:27:26 EDT
Taking this bug but moving it to 1.0
Comment 6 Simon Kaegi CLA 2013-02-05 14:43:55 EST
For 2.0 I've at least fixed the orion home calculation -- moving to 3.0 to look at whether or not an OrionHome page param is a good idea.
Comment 7 Mark Macdonald CLA 2013-03-15 17:30:47 EDT
(In reply to comment #6)
> For 2.0 I've at least fixed the orion home calculation -- moving to 3.0 to
> look at whether or not an OrionHome page param is a good idea.

Our current algorithm for calculating OrionHome fails in RequireJS 2.x (see bug 402976 comment #2), and we got a report of a similar problem when Orion 2.0 is used with the Dojo AMD loader.

I the problem is with this pattern:
 require.toUrl(".")
Comment 8 John Arthorne CLA 2015-05-05 16:30:18 EDT
This open bug report had a target milestone in the past. The target milestone has been removed. Please target for a date in the future or leave the target blank if it is not known.
Comment 9 Michael Rennie CLA 2017-01-10 15:46:30 EST
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html