Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341633

Summary: using platform:/resource URIs for model references
Product: [Modeling] EMF Reporter: Christian Waniek <chris.waniek>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Screenshot for a better understanding of the problem none

Description Christian Waniek CLA 2011-04-01 10:22:50 EDT
Created attachment 192362 [details]
Screenshot for a better understanding of the problem

I'm using EMF 2.6.1

My use case:
I have a EClass A which can have a reference to other A's. Know I work with this model. I create two eclipse projects. Each propject contains a model with an instance of A, let's call them A1 and A2. Now A1 has to reference A2. So I load the resource from the project which contains A2 and add the reference.

The reference in the XMI is stored as a relatice URI. But I think it would be way better to store the URI as a platform:/resource URI, because it would be independent of the real location of the project on the HDD. Especially if can't make sure that the project are always in the same relative location.

See also attached screenshot...
Comment 1 Ed Merks CLA 2011-04-01 11:33:39 EDT
I don't agree with you.  As soon as you use platform:/resource you'd not be able to open the resource with file: URIs.  I.e., you can't be sure it's always in a workspace. 

In any case, it's your choice if you want to tailor things yourself for your resources via this option

  /**
   * A {@link URIHandler} value that will be used to control how URIs are {@link URI#resolve(URI) resolved} during load 
   * and {@link URI#deresolve(URI) deresolved} during save.
   * @see URI
   * @see URIHandler
   * @see XMLHelper#resolve(URI, URI)
   * @see XMLHelper#deresolve(URI)
   * @see URIHandlerImpl
   */
  String OPTION_URI_HANDLER = "URI_HANDLER";

But I won't change any of EMF's existing resources to do that.